]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
vmspawn: switch from -drive to -blockdev option
authorJörg Behrmann <behrmann@physik.fu-berlin.de>
Sun, 2 Mar 2025 15:07:54 +0000 (16:07 +0100)
committerLuca Boccassi <luca.boccassi@gmail.com>
Tue, 4 Mar 2025 21:28:53 +0000 (21:28 +0000)
(cherry picked from commit 369655330d57a82b6f346a77798968f135221c99)

src/vmspawn/vmspawn.c

index 70e5a312656f3b8ff69796fc343b36a9b6d95c48..8c00083258d7cf0112b7ff07efd3748d859c92e4 100644 (file)
@@ -1738,7 +1738,7 @@ static int run_virtual_machine(int kvm_device_fd, int vhost_device_fd) {
         STRV_FOREACH(drive, arg_extra_drives) {
                 _cleanup_free_ char *escaped_drive = NULL;
 
-                r = strv_extend(&cmdline, "-drive");
+                r = strv_extend(&cmdline, "-blockdev");
                 if (r < 0)
                         return log_oom();
 
@@ -1746,7 +1746,7 @@ static int run_virtual_machine(int kvm_device_fd, int vhost_device_fd) {
                 if (!escaped_drive)
                         return log_oom();
 
-                r = strv_extendf(&cmdline, "format=raw,cache=unsafe,file=%s", escaped_drive);
+                r = strv_extendf(&cmdline, "driver=raw,cache.direct=off,cache.no-flush=on,file.driver=file,file.filename=%s", escaped_drive);
                 if (r < 0)
                         return log_oom();
         }