1
0
mirror of https://github.com/systemd/systemd.git synced 2025-03-19 22:50:17 +03:00

vmspawn: switch from -drive to -blockdev option

(cherry picked from commit 369655330d57a82b6f346a77798968f135221c99)
This commit is contained in:
Jörg Behrmann 2025-03-02 16:07:54 +01:00 committed by Luca Boccassi
parent f7b5e94a1a
commit 59f2d9b2cc

View 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();
}