Jim Meyering [EMAIL PROTECTED] wrote:
While looking at misuses of write, I found problems in src/openvz_conf.c
Here's the first fix:
Handle failed openvzLocateConfDir.
* src/openvz_conf.c (openvzLocateConfDir, openvzGetVPSUUID):
(openvzSetUUID): Don't dereference NULL upon
Jim Meyering [EMAIL PROTECTED] wrote:
...
+if (conf_dir != NULL)
+return -1
Whoa.
Chris Lalance pointed out another obvious flaw.
I meant to add *this*:
+if (conf_dir == NULL)
+return -1
Will repost shortly.
Thanks, Chris!
Here's the corrected patch:
Use safewrite in place of write, in many cases.
And 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
Jim Meyering [EMAIL PROTECTED] wrote:
While looking at misuses of write, I found problems in src/openvz_conf.c
Here's the first fix:
Handle failed openvzLocateConfDir.
* src/openvz_conf.c (openvzLocateConfDir, openvzGetVPSUUID):
(openvzSetUUID): Don't dereference NULL upon
On Wed, Feb 20, 2008 at 02:56:06PM +0100, Jim Meyering wrote:
While looking at misuses of write, I found problems in src/openvz_conf.c
Here's the first fix:
Handle failed openvzLocateConfDir.
* src/openvz_conf.c (openvzLocateConfDir, openvzGetVPSUUID):
(openvzSetUUID):
On Wed, Feb 20, 2008 at 02:53:49PM +0100, Jim Meyering wrote:
Use safewrite in place of write, in many cases.
And 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
On Wed, Feb 20, 2008 at 03:23:52PM +0100, Jim Meyering wrote:
Jim Meyering [EMAIL PROTECTED] wrote:
...
+if (conf_dir != NULL)
+return -1
Whoa.
Chris Lalance pointed out another obvious flaw.
I meant to add *this*:
+if (conf_dir == NULL)
+return -1
Daniel Veillard [EMAIL PROTECTED] wrote:
On Wed, Feb 20, 2008 at 02:53:49PM +0100, Jim Meyering wrote:
Use safewrite in place of write, in many cases.
And 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) !=
There were a few trailing blanks in a generated Makefile.am file.
This patch fixes the python script not to emit the offending spaces:
Avoid make syntax-check failure.
* docs/examples/index.py: Don't emit trailing blanks.
* docs/examples/Makefile.am: Regenerate.
On Wed, 2008-02-20 at 16:42 +0100, Jim Meyering wrote:
If I do as you suggest and move the safewrite definition into util.h,
and make it static inline, then both problems go away.
Make sure to try and build this with gcc-4.3.0 - remember that we
un-inlined xstrtol() because of:
On Wed, Feb 20, 2008 at 04:42:12PM +0100, Jim Meyering wrote:
Daniel Veillard [EMAIL PROTECTED] wrote:
maybe for case outside of the library adding a copy of safewrite
in virsh.c would be a good way to do this while keeping the code
consistent. The duplication of that small function
On Wed, Feb 20, 2008 at 02:52:54AM -0500, Daniel Veillard wrote:
On Wed, Feb 20, 2008 at 04:00:39AM +, Daniel P. Berrange wrote:
On Tue, Feb 12, 2008 at 04:30:07AM +, Daniel P. Berrange wrote:
This defines the public API for the storage pool and volume support.
The naming of the
On Wed, Feb 20, 2008 at 04:56:21PM +0100, Jim Meyering wrote:
There were a few trailing blanks in a generated Makefile.am file.
This patch fixes the python script not to emit the offending spaces:
Avoid make syntax-check failure.
* docs/examples/index.py: Don't emit trailing
On Wed, Feb 20, 2008 at 04:10:30PM +, Daniel P. Berrange wrote:
On Wed, Feb 20, 2008 at 02:52:54AM -0500, Daniel Veillard wrote:
On Wed, Feb 20, 2008 at 04:00:39AM +, Daniel P. Berrange wrote:
On Tue, Feb 12, 2008 at 04:30:07AM +, Daniel P. Berrange wrote:
This defines the
Hi Jim,
comments inline
Jim Meyering wrote:
diff --git a/proxy/libvirt_proxy.c b/proxy/libvirt_proxy.c
index d96d3db..a22ba6c 100644
--- a/proxy/libvirt_proxy.c
+++ b/proxy/libvirt_proxy.c
@@ -2,7 +2,7 @@
* proxy_svr.c: root suid proxy server for Xen access to APIs with no
*
Mark McLoughlin [EMAIL PROTECTED] wrote:
On Wed, 2008-02-20 at 16:42 +0100, Jim Meyering wrote:
If I do as you suggest and move the safewrite definition into util.h,
and make it static inline, then both problems go away.
Make sure to try and build this with gcc-4.3.0 - remember that we
Currently the qemu driver doesn't use virErrorMsg when raising error
messages. This causes some errors to appear as libvir: QEMU error:
if a custom string wasn't raised, which isn't all that useful. The
patch below fixes this.
Thanks,
Cole
diff --git a/src/qemu_conf.c b/src/qemu_conf.c
index
Jim Paris [EMAIL PROTECTED] wrote:
Jim Meyering wrote:
...
Hi Jim,
-retry:
-ret = write(pollInfos[nr].fd, (char *) req, req-len);
+ret = safewrite(pollInfos[nr].fd, (char *) req, req-len);
if (ret 0) {
Should this check (ret == req-len) instead? safewrite() will return
an
There were several unchecked syscalls in this function, along with the
at-least-theoretical risk of a file descriptor leak, so I rewrote this
function to avoid all that, using a stream rather than a bare file
descriptor.
Subject: [PATCH] Rewrite openvzSetUUID.
* src/openvz_conf.c
Daniel P. Berrange [EMAIL PROTECTED] wrote:
All committed.
Congratulations! :-)
--
Libvir-list mailing list
Libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Jim Meyering wrote:
It *could* perform that test, but I think it is slightly more
maintainable (no duplication of that potentially nontrivial expression)
and just as correct to check only ret 0.
Not having the duplicated expression is certainly good, if it's
correct to do so (and it seems
Jim Meyering wrote:
+ /* Record failure if any of these fails,
+and be careful always to close the stream. */
+ if ((fseek(fp, 0, SEEK_END) 0)
+ + (fprintf(fp, \n#UUID: %s\n, uuidstr) 0);
+ + (fclose(fp) == EOF))
+ ret = -1;
I don't think you want
On Wed, Feb 20, 2008 at 04:39:31PM +, Daniel P. Berrange wrote:
On Wed, Feb 20, 2008 at 04:10:30PM +, Daniel P. Berrange wrote:
On Wed, Feb 20, 2008 at 02:52:54AM -0500, Daniel Veillard wrote:
So let's push this !
All committed. Now to find out what I broke :-) It passes an
Jim Paris [EMAIL PROTECTED] wrote:
Jim Meyering wrote:
+/* Record failure if any of these fails,
+ and be careful always to close the stream. */
+if ((fseek(fp, 0, SEEK_END) 0)
++ (fprintf(fp, \n#UUID: %s\n, uuidstr) 0);
++ (fclose(fp) == EOF))
+ret
A little over a month ago I proposed an API extension for enabling long
operations to be done as asynchronous background jobs.
http://www.redhat.com/archives/libvir-list/2008-January/msg00040.html
While the proof of concept definitely worked, having played around thought
about it a little more
On Wed, Feb 20, 2008 at 12:28:23PM -0500, Cole Robinson wrote:
Currently the qemu driver doesn't use virErrorMsg when raising error
messages. This causes some errors to appear as libvir: QEMU error:
if a custom string wasn't raised, which isn't all that useful. The
patch below fixes this.
I wrote:
...
diff --git a/src/openvz_conf.c b/src/openvz_conf.c
...
+ FILE *fp = fopen(conf_file, a);
+ if (fp == NULL)
+ return -1;
...
+ /* Record failure if fseek, fprintf or fclose fails,
+and be careful always to close the stream. */
+ if (fseek(fp, 0,
This patch contains the new files lxc_driver.c and lxc_driver.h
Index: src/lxc_driver.c
===
RCS file: src/lxc_driver.c
diff -N src/lxc_driver.c
--- /dev/null1 Jan 1970 00:00:00 -
+++ src/lxc_driver.c19 Feb 2008 18:54:30
28 matches
Mail list logo