Merge pull request #229313 from mped-oticon/mped_proxmox_assert

nixos/proxmox-image: Disable O_DIRECT to fix assert when writing to tmpfs

authored by Ryan Lahfa and committed by GitHub 98167d57 d57e7ca1

+16
+16
nixos/modules/virtualisation/proxmox-image.nix
··· 193 193 sha256 = "sha256-9rN1x5UfcoQCeYsLqrsthkeMpT1Eztvvq74cRr9G+Dk="; 194 194 }; 195 195 patches = [ 196 + # Proxmox' VMA tool is published as a particular patch upon QEMU 196 197 (pkgs.fetchpatch { 197 198 url = 198 199 let ··· 201 202 in "https://git.proxmox.com/?p=pve-qemu.git;a=blob_plain;hb=${rev};f=${path}"; 202 203 hash = "sha256-2Dz+ceTwrcyYYxi76RtyY3v15/2pwGcDhFuoZWlgbjc="; 203 204 }) 205 + 206 + # Proxmox' VMA tool uses O_DIRECT which fails on tmpfs 207 + # Filed to upstream issue tracker: https://bugzilla.proxmox.com/show_bug.cgi?id=4710 208 + (pkgs.writeText "inline.patch" '' 209 + --- a/vma-writer.c 2023-05-01 15:11:13.361341177 +0200 210 + +++ b/vma-writer.c 2023-05-01 15:10:51.785293129 +0200 211 + @@ -306,7 +306,7 @@ 212 + /* try to use O_NONBLOCK */ 213 + fcntl(vmaw->fd, F_SETFL, fcntl(vmaw->fd, F_GETFL)|O_NONBLOCK); 214 + } else { 215 + - oflags = O_NONBLOCK|O_DIRECT|O_WRONLY|O_EXCL; 216 + + oflags = O_NONBLOCK|O_WRONLY|O_EXCL; 217 + vmaw->fd = qemu_create(filename, oflags, 0644, errp); 218 + } 219 + '') 204 220 ]; 205 221 206 222 buildInputs = super.buildInputs ++ [ pkgs.libuuid ];