This website requires JavaScript.
Explore
Help
Sign In
External
/
libvirt
Watch
1
Star
0
Fork
0
You've already forked libvirt
mirror of
https://gitlab.com/libvirt/libvirt.git
synced
2024-12-25 07:05:28 +00:00
Code
Issues
Packages
Projects
Releases
Wiki
Activity
d8637214a4
libvirt
/
.x-sc_avoid_write
6 lines
80 B
Plaintext
Raw
Normal View
History
Unescape
Escape
Use safewrite in place of write, in many cases. Also add "make syntax-check" rules to ensure no new uses sneak in. There are many uses of write like this: if (write (fd, xml, towrite) != towrite) return -1; The problem is that the syscall can succeed, yet write less than the requested number of bytes, so the caller should retry rather than simply failing. This patch changes most of them to use util.c's safewrite wrapper, which encapsulates the process. Also, there were a few cases in which the retry loop was open-coded, and I replaced those, too. * Makefile.maint (sc_avoid_write): New rule, to avoid recurrence. * .x-sc_avoid_write: New file. Record two legitimate exemptions. * qemud/qemud.c (sig_handler, qemudClientWriteBuf): Use safewrite, not write. * src/conf.c (__virConfWriteFile): Likewise. * src/qemu_conf.c (qemudSaveConfig, qemudSaveNetworkConfig): Likewise. * src/qemu_driver.c (qemudWaitForMonitor, qemudStartVMDaemon) (qemudVMData, PROC_IP_FORWARD): Likewise. * proxy/libvirt_proxy.c: Include "util.h". (proxyWriteClientSocket): Use safewrite. * src/test.c (testDomainSave, testDomainCoreDump): Likewise. * src/proxy_internal.c (virProxyWriteClientSocket): Likewise. * src/virsh.c: Include "util-lib.h". (vshOutputLogFile): Use safewrite. * src/console.c: Include "util-lib.h". (vshRunConsole): Use safewrite.
2008-02-22 15:55:04 +00:00
^src/util\.c$
^src/xend_internal\.c$
Avoid new "make syntax-check" failures. * .x-sc_avoid_write: Exempt src/util-lib.c, too. * Makefile.maint (sc_unmarked_diagnostics): Filter out false positives. * src/storage_backend_fs.c (virStorageBackendFileSystemVolCreate): Use safewrite, not write. * src/storage_backend_logical.c (virStorageBackendLogicalBuildPool): Likewise.
2008-02-25 10:00:16 +00:00
^src/util-lib\.c$
Make error reporting threadsafe by avoiding strerror
2009-01-20 17:13:33 +00:00
^qemud/qemud.c$
exempt gnulib from write-avoidance syntax check
2008-10-28 17:42:41 +00:00
^gnulib/
Reference in New Issue
Copy Permalink