libvirt/qemud
Jim Meyering b59d9c85f1 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
..
.cvsignore Ignore libvirtd.init, Daniel 2007-07-06 07:11:24 +00:00
default-network.xml Improve support for virtual networking 2007-03-13 22:43:22 +00:00
event.c Enable the <config.h>-requiring test; fix violations 2008-01-29 18:15:54 +00:00
event.h Allow updating of existing timers & file handle event watches 2007-09-19 01:27:32 +00:00
internal.h Portability improvements for Mac OS X. 2008-01-23 14:54:41 +00:00
libvirtd.conf Added PolicyKit authentication support 2007-12-05 18:21:27 +00:00
libvirtd.init.in Initial integration of SASL authentication, working for Kerberos only 2007-12-05 15:24:15 +00:00
libvirtd.policy Added PolicyKit authentication support 2007-12-05 18:21:27 +00:00
libvirtd.sasl Remove all trailing blanks; turn on the rule to detect them. 2008-02-05 19:27:37 +00:00
libvirtd.sysconf Initial integration of SASL authentication, working for Kerberos only 2007-12-05 15:24:15 +00:00
Makefile.am Move safewrite and saferead to a separate file. 2008-02-22 15:53:13 +00:00
mdns.c Enable another syntax-check rule. 2008-02-07 19:20:36 +00:00
mdns.h Remove all trailing blanks; turn on the rule to detect them. 2008-02-05 19:27:37 +00:00
qemud.c Use safewrite in place of write, in many cases. 2008-02-22 15:55:04 +00:00
remote_dispatch_localvars.h Add remote daemon support for storage APIs 2008-02-20 15:22:35 +00:00
remote_dispatch_proc_switch.h Add remote daemon support for storage APIs 2008-02-20 15:22:35 +00:00
remote_dispatch_prototypes.h Add remote daemon support for storage APIs 2008-02-20 15:22:35 +00:00
remote_generate_stubs.pl Add whitelisting of users. Remove IP whitelisting. Make auth schemes configurable 2007-12-05 15:34:05 +00:00
remote_protocol.c Add remote daemon support for storage APIs 2008-02-20 15:22:35 +00:00
remote_protocol.h Add remote daemon support for storage APIs 2008-02-20 15:22:35 +00:00
remote_protocol.x Add remote daemon support for storage APIs 2008-02-20 15:22:35 +00:00
remote.c Update to work with new policy kit APIs 2008-02-20 16:54:35 +00:00
rpcgen_fix.pl Mon Jun 11 12:34:00 BST 2007 Richard W.M. Jones <rjones@redhat.com> 2007-06-11 11:36:17 +00:00