diff options
| author | Michael Tokarev <mjt@tls.msk.ru> | 2025-08-01 14:53:14 +0300 |
|---|---|---|
| committer | Stefan Hajnoczi <stefanha@redhat.com> | 2025-08-05 15:03:08 -0400 |
| commit | b217d987a3c5c6e2473956723b396bc1ff0f5b2b (patch) | |
| tree | 748d312a7f83788950def6d2ba2bcb6e58348e4b /python/scripts/mkvenv.py | |
| parent | 8ee899e9b1a07657998279be0668e39851f3b68c (diff) | |
| download | focaccia-qemu-b217d987a3c5c6e2473956723b396bc1ff0f5b2b.tar.gz focaccia-qemu-b217d987a3c5c6e2473956723b396bc1ff0f5b2b.zip | |
qga: correctly write to /sys/power/state on linux
Commit v9.0.0-343-g2048129625 introduced usage of g_file_set_contents() function to write to /sys/power/state. This function uses G_FILE_SET_CONTENTS_CONSISTENT flag to g_file_set_contents_full(), which is implemented by creating a temp file in the same directory and renaming it to the final destination. Which is not how sysfs works. Here, there's not a big deal to do open/write/close - it becomes almost the same as using g_file_set_contents[_full](). But it does not have surprises like this. Also, since this is linux code, it should be ok to use %m in the error reporting function. Fixes: 2048129625 "qga/commands-posix: don't do fork()/exec() when suspending via sysfs" Resolves: https://gitlab.com/qemu-project/qemu/-/issues/3057 Signed-off-by: Michael Tokarev <mjt@tls.msk.ru> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Message-ID: <20250801115316.6845-1-mjt@tls.msk.ru> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'python/scripts/mkvenv.py')
0 files changed, 0 insertions, 0 deletions