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
This patch contains the new files lxc_conf.c and lxc_conf.h
Index: src/lxc_conf.c
===
RCS file: src/lxc_conf.c
diff -N src/lxc_conf.c
--- /dev/null1 Jan 1970 00:00:00 -
+++ src/lxc_conf.c20 Feb 2008 23:02:14 -
@@ -0,0
This patch contains the base linux container support
* new switch --with-lxc to enable support (off by default)
* Add new source files to Makefile.am
* Add define for lxc in driver.h
* Add call to lxcRegister() in libvirt.c
* Add define for errors from lxc in virterror.h
* Add case for errors fro
The following set of patches add the first batch of linux container
support to libvirt. The work is not complete but I wanted to start
getting some of this out for comments. This set of patches supports the
following:
* new switch --with-lxc to enable linux container support (off by default)
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(f
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
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
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
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
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 seem
"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
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 pa
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 (
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()
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 e
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 - remembe
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 defin
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 trailin
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 functi
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:
int
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
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.
Signed-o
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,
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;
>
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)
> >>
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)
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
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 NUL
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 NU
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 failure.
Signed-off-by: Jim Meyering
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
32 matches
Mail list logo