Re: [Libvir] PATCH 2/4: Xen driver support for serial/paralle

2008-04-25 Thread Daniel Veillard
On Thu, Apr 24, 2008 at 10:14:49PM +0100, Daniel P. Berrange wrote:
 On Thu, Apr 24, 2008 at 10:42:34PM +0200, Jim Meyering wrote:
  All of the virBufferAddLit and virBufferVSprintf calls
  above can fail with ENOMEM.  I see that there are *many* more
  virBufferAddLit and virBufferVSprintf calls that ignore their
  return values (over 300), so maybe I'm missing something.
 
 Yes, the entire set of Xen drivers is basically fubar wrt to checking
 virBufferXXX return values. I felt that needed addresing independantly
 changing everything in one go, so didn't try to address that in this
 patch.

  Maybe the best is to store in the buffer the fact that there have been
an error at some point, and check that value before extracting the content
in a single place, that would make the code cleaner, and makes harder to
miss one test.

Daniel

-- 
Red Hat Virtualization group http://redhat.com/virtualization/
Daniel Veillard  | virtualization library  http://libvirt.org/
[EMAIL PROTECTED]  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine  http://rpmfind.net/

--
Libvir-list mailing list
Libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


Re: [libvir] [PATCH] Change group ownership of /var/run/libvirt/

2008-04-25 Thread Guido Günther
On Thu, Apr 24, 2008 at 07:20:45PM +0400, Anton Protopopov wrote:
 1) If libvirtd is running as root, main() will try to change the group
 ownership of /var/run/libvirt to one specified by unix_sock_gid.
 2) Default permissions on /var/run/libvirt are now 0750
How does this match with the default permissions of the read only
socket?
 unix_sock_ro_perms = 0777
Shouldnt the /var/run/libvirt stay 0755?
 -- Guido

--
Libvir-list mailing list
Libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


Re: [Libvir] [PATCH] avoid problems with sign-extended char operand to is* functions

2008-04-25 Thread Daniel Veillard
On Thu, Apr 24, 2008 at 10:01:10PM +0200, Jim Meyering wrote:
 I spotted this in existing code while doing a review:
 These uses all cause trouble if the byte in question has a value
 larger than 127 and the char type is signed.
 
   avoid problems with sign-extended char operand to is* functions
   * src/util.h (to_uchar): Define function.
   * src/sexpr.c (_string2sexpr): Apply to_uchar to is* operand.
   * src/nodeinfo.c (linuxNodeInfoCPUPopulate): Likewise.
   * src/qemu_driver.c (qemudExtractMonitorPath): Likewise.
   * src/stats_linux.c (xenLinuxDomainDeviceID): Likewise.
   * src/util.c (TOLOWER, __virMacAddrCompare, virParseMacAddr): Likewise.
   * src/virsh.c (cmdVcpupin, vshCommandGetToken): Likewise.

  Hum, yes, let's fix this.
But honnestly, we use the is* functions for parsing and checking input,
and one thing I worry about is having a behaviour different based
on the user locale. For example I see we now use isupper/islower/isspace
which are locale dependant, they seems to be confined to places which are
not raw user input, but we should keep an eye to avoid problems.
  
  Patch is fine by me, +1

Daniel

-- 
Red Hat Virtualization group http://redhat.com/virtualization/
Daniel Veillard  | virtualization library  http://libvirt.org/
[EMAIL PROTECTED]  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine  http://rpmfind.net/

--
Libvir-list mailing list
Libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


[Libvir] libvirt.org is not correctly viewed on IE

2008-04-25 Thread Atsushi SAKAI
Hi, Dan

My collegue says
the libvirt.org web pages are not correctly viewed 
from InternetExplorer.(CSS problem ?)

Where should I report it?

Of course, it views fine on Firefox!
(I always use Firefox)

Thanks
Atsushi SAKAI





--
Libvir-list mailing list
Libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


Re: [Libvir] PATCH 4/4: Xen test suite support

2008-04-25 Thread Jim Meyering
Daniel P. Berrange [EMAIL PROTECTED] wrote:
 This patch updates the Xen test suite to cover the new serial and paralle
 device syntax extensions

Looks good.

  sexpr2xmldata/sexpr2xml-fv-parallel-tcp.xml|   44 ++
  sexpr2xmldata/sexpr2xml-fv-serial-file.xml |   48 ++
  sexpr2xmldata/sexpr2xml-fv-serial-null.xml |   46 ++
  sexpr2xmldata/sexpr2xml-fv-serial-pipe.xml |   48 ++
  sexpr2xmldata/sexpr2xml-fv-serial-pty.xml  |   46 ++
  sexpr2xmldata/sexpr2xml-fv-serial-stdio.xml|   46 ++
  sexpr2xmldata/sexpr2xml-fv-serial-tcp-telnet.xml   |   48 ++
  sexpr2xmldata/sexpr2xml-fv-serial-tcp.xml  |   48 ++
  sexpr2xmldata/sexpr2xml-fv-serial-udp.xml  |   50 ++
  sexpr2xmldata/sexpr2xml-fv-serial-unix.xml |   48 ++
  xmconfigdata/test-fullvirt-parallel-tcp.xml|   45 ++
  xmconfigdata/test-fullvirt-serial-file.xml |   49 ++
  xmconfigdata/test-fullvirt-serial-null.xml |   47 ++
  xmconfigdata/test-fullvirt-serial-pipe.xml |   49 ++
  xmconfigdata/test-fullvirt-serial-pty.xml  |   47 ++
  xmconfigdata/test-fullvirt-serial-stdio.xml|   47 ++
  xmconfigdata/test-fullvirt-serial-tcp-telnet.xml   |   49 ++
  xmconfigdata/test-fullvirt-serial-tcp.xml  |   49 ++
  xmconfigdata/test-fullvirt-serial-udp.xml  |   51 ++
  xmconfigdata/test-fullvirt-serial-unix.xml |   49 ++
  xml2sexprdata/xml2sexpr-fv-parallel-tcp.xml|   40 ++
  xml2sexprdata/xml2sexpr-fv-serial-file.xml |   40 ++
  xml2sexprdata/xml2sexpr-fv-serial-null.xml |   39 ++
  xml2sexprdata/xml2sexpr-fv-serial-pipe.xml |   40 ++
  xml2sexprdata/xml2sexpr-fv-serial-pty.xml  |   39 ++
  xml2sexprdata/xml2sexpr-fv-serial-stdio.xml|   39 ++
  xml2sexprdata/xml2sexpr-fv-serial-tcp-telnet.xml   |   40 ++
  xml2sexprdata/xml2sexpr-fv-serial-tcp.xml  |   40 ++
  xml2sexprdata/xml2sexpr-fv-serial-udp.xml  |   41 ++
  xml2sexprdata/xml2sexpr-fv-serial-unix.xml |   40 ++

I noticed that there's a huge amount of duplication in these new .xml
files.  Each typically differs in just a single attribute or two from
one or more others.

Eventually, it'd be good for maintainability to factor out some sort of
template(s) and store in version control only the pieces that say how
to change a template into the desired expected output file.

--
Libvir-list mailing list
Libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


Re: [Libvir] libvirt.org is not correctly viewed on IE

2008-04-25 Thread Daniel Veillard
On Fri, Apr 25, 2008 at 09:04:07PM +0900, Atsushi SAKAI wrote:
 Hi, Dan
 
 My collegue says
 the libvirt.org web pages are not correctly viewed 
 from InternetExplorer.(CSS problem ?)
 
 Where should I report it?

  here I guess, what's the problem ?

Daniel

-- 
Red Hat Virtualization group http://redhat.com/virtualization/
Daniel Veillard  | virtualization library  http://libvirt.org/
[EMAIL PROTECTED]  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine  http://rpmfind.net/

--
Libvir-list mailing list
Libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


Re: [Libvir] libvirt.org is not correctly viewed on IE

2008-04-25 Thread Atsushi SAKAI
Hi, Daniel

Nothing Heavy.
Just left side window does not appear on IE.

But, It should be fixed as nice to have,
since IE is also a major Web browser.
(libvirt is also working on Windows.)

Or should I check for my spare time?

Thanks
Atsushi SAKAI


Daniel Veillard [EMAIL PROTECTED] wrote:

 On Fri, Apr 25, 2008 at 09:04:07PM +0900, Atsushi SAKAI wrote:
  Hi, Dan
  
  My collegue says
  the libvirt.org web pages are not correctly viewed 
  from InternetExplorer.(CSS problem ?)
  
  Where should I report it?
 
   here I guess, what's the problem ?
 
 Daniel
 
 -- 
 Red Hat Virtualization group http://redhat.com/virtualization/
 Daniel Veillard  | virtualization library  http://libvirt.org/
 [EMAIL PROTECTED]  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
 http://veillard.com/ | Rpmfind RPM search engine  http://rpmfind.net/


--
Libvir-list mailing list
Libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


Re: [Libvir] libvirt.org is not correctly viewed on IE

2008-04-25 Thread Daniel Veillard
On Fri, Apr 25, 2008 at 09:38:02PM +0900, Atsushi SAKAI wrote:
 Hi, Daniel
 
 Nothing Heavy.
 Just left side window does not appear on IE.
 
 But, It should be fixed as nice to have,
 since IE is also a major Web browser.
 (libvirt is also working on Windows.)

  Well I certainly can't test it, I have no IE around really,
could be a layering problem, are your colleagues able to click
on the search box on the top right and input a search ? (if
yes this means we could try putting an explicit z-index on 
the site map). it's the site map (Home/News/...) that they
are not seeing, right ?

Daniel

-- 
Red Hat Virtualization group http://redhat.com/virtualization/
Daniel Veillard  | virtualization library  http://libvirt.org/
[EMAIL PROTECTED]  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine  http://rpmfind.net/

--
Libvir-list mailing list
Libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


Re: [Libvir] libvirt.org is not correctly viewed on IE

2008-04-25 Thread Daniel Veillard
On Fri, Apr 25, 2008 at 09:51:50PM +0900, Atsushi SAKAI wrote:
 Hi, Daniel
 
 I checked further.
 IE7 shows fine.(on my colleague machine.)
 IE6 lacks left side.(my and other colleague machine.)

  Well if not too hard we should try to fix the CSS to help rendering on IE 6 
too,

  thanks,

Daniel

-- 
Red Hat Virtualization group http://redhat.com/virtualization/
Daniel Veillard  | virtualization library  http://libvirt.org/
[EMAIL PROTECTED]  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine  http://rpmfind.net/

--
Libvir-list mailing list
Libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


Re: [Libvir] libvirt.org is not correctly viewed on IE

2008-04-25 Thread Daniel Veillard
On Fri, Apr 25, 2008 at 02:13:59PM +0100, Daniel P. Berrange wrote:
 On Fri, Apr 25, 2008 at 09:09:17AM -0400, Daniel Veillard wrote:
Well I certainly can't test it, I have no IE around really,
  could be a layering problem, are your colleagues able to click
  on the search box on the top right and input a search ? (if
  yes this means we could try putting an explicit z-index on 
  the site map). it's the site map (Home/News/...) that they
  are not seeing, right ?
 
 I doubt it'll that easy. I suspect we're hitting one of the bugs in the
 IE6 box model, particularly wrt to -ve margins. I'll have to find a 
 copy of IE6 and put in a hack for it.

  Well i wanted to know if Search was working (i.e. z-index being supported)
too :-)

Daniel

-- 
Red Hat Virtualization group http://redhat.com/virtualization/
Daniel Veillard  | virtualization library  http://libvirt.org/
[EMAIL PROTECTED]  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine  http://rpmfind.net/

--
Libvir-list mailing list
Libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


Re: [libvir] [PATCH] Change group ownership of /var/run/libvirt/

2008-04-25 Thread Daniel Veillard
On Fri, Apr 25, 2008 at 12:57:23PM +0400, Anton Protopopov wrote:
 2008/4/25, Guido Günther [EMAIL PROTECTED]:
  On Thu, Apr 24, 2008 at 07:20:45PM +0400, Anton Protopopov wrote:
1) If libvirtd is running as root, main() will try to change the group
ownership of /var/run/libvirt to one specified by unix_sock_gid.
2) Default permissions on /var/run/libvirt are now 0750
 
  How does this match with the default permissions of the read only
   socket?
unix_sock_ro_perms = 0777
 
 Yes, you are right. That doesn't match...
 
   Shouldnt the /var/run/libvirt stay 0755?
 
 Yes, it should.
 
   -- Guido
 
 
 New patch is attached

 Okidoc, patch applied !
  thanks :-)

Daniel

-- 
Red Hat Virtualization group http://redhat.com/virtualization/
Daniel Veillard  | virtualization library  http://libvirt.org/
[EMAIL PROTECTED]  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine  http://rpmfind.net/

--
Libvir-list mailing list
Libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


[Libvir] [PATCH] avoid format-related warnings

2008-04-25 Thread Jim Meyering
This avoids two warnings:

avoid format-related warnings
* qemud/qemud.c (main): Fix a bogus format string reported as umarked.
* src/virsh.c (cmdVcpupin): Non-literal with no args.

Signed-off-by: Jim Meyering [EMAIL PROTECTED]
---
 qemud/qemud.c |4 ++--
 src/virsh.c   |2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/qemud/qemud.c b/qemud/qemud.c
index a7b27ee..a9d825d 100644
--- a/qemud/qemud.c
+++ b/qemud/qemud.c
@@ -2164,8 +2164,8 @@ int main(int argc, char **argv) {
 const char *sockdirname = LOCAL_STATE_DIR /run/libvirt;

 if (chown(sockdirname, -1, unix_sock_gid)  0)
-qemudLog(QEMUD_ERR, %s %s,
-_(Failed to change group ownership of ), sockdirname);
+qemudLog(QEMUD_ERR, _(Failed to change group ownership of %s),
+ sockdirname);
 }

 if (godaemon) {
diff --git a/src/virsh.c b/src/virsh.c
index ef6165b..5e098a7 100644
--- a/src/virsh.c
+++ b/src/virsh.c
@@ -1745,7 +1745,7 @@ cmdVcpupin(vshControl * ctl, vshCmd * cmd)
 }

 if (vcpu = info.nrVirtCpu) {
-vshError(ctl, FALSE, _(vcpupin: Invalid vCPU number.));
+vshError(ctl, FALSE, %s, _(vcpupin: Invalid vCPU number.));
 virDomainFree(dom);
 return FALSE;
 }
--
1.5.5.1.69.g2ffd

--
Libvir-list mailing list
Libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


[Libvir] [PATCH] avoid make distcheck failure

2008-04-25 Thread Jim Meyering
make distcheck was failing.  This fixes it:

avoid make distcheck failure
* docs/Makefile.am (EXTRA_DIST): Replace wildcards html/*.html
and html/*.png the corresponding lists of file names.

Signed-off-by: Jim Meyering [EMAIL PROTECTED]
---
 docs/Makefile.am |   11 +--
 1 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/docs/Makefile.am b/docs/Makefile.am
index feb72c1..c6f6032 100644
--- a/docs/Makefile.am
+++ b/docs/Makefile.am
@@ -63,8 +63,15 @@ fig = \
 EXTRA_DIST=\
   libvirt-api.xml libvirt-refs.xml apibuild.py \
   site.xsl newapi.xsl news.xsl page.xslChangeLog.xsl   \
-  $(dot_html) $(dot_html_in) $(gif) html/*.html html/*.png \
-  $(xml) $(rng) $(fig) $(png) \
+  $(dot_html) $(dot_html_in) $(gif)\
+  html/index.html  \
+  html/libvirt-libvirt.html\
+  html/libvirt-virterror.html  \
+  html/home.png\
+  html/left.png\
+  html/right.png   \
+  html/up.png  \
+  $(xml) $(rng) $(fig) $(png)  \
   virsh.pod ChangeLog.awk

 all: web $(top_builddir)/NEWS $(man_MANS)
--
1.5.5.1.69.g2ffd

--
Libvir-list mailing list
Libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


Re: [Libvir] libvirt.org is not correctly viewed on IE

2008-04-25 Thread Daniel P. Berrange
On Fri, Apr 25, 2008 at 09:51:50PM +0900, Atsushi SAKAI wrote:
 Hi, Daniel
 
 I checked further.
 IE7 shows fine.(on my colleague machine.)
 IE6 lacks left side.(my and other colleague machine.)

I have fixed the layout and it now displays correctly in IE6  7

Regards,
Dan.
-- 
|: Red Hat, Engineering, Boston   -o-   http://people.redhat.com/berrange/ :|
|: http://libvirt.org  -o-  http://virt-manager.org  -o-  http://ovirt.org :|
|: http://autobuild.org   -o- http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505  -o-  F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|

--
Libvir-list mailing list
Libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


Re: [Libvir] PATCH 2/4: Xen driver support for serial/paralle

2008-04-25 Thread Daniel P. Berrange
On Fri, Apr 25, 2008 at 03:11:44AM -0400, Daniel Veillard wrote:
 On Thu, Apr 24, 2008 at 10:14:49PM +0100, Daniel P. Berrange wrote:
  On Thu, Apr 24, 2008 at 10:42:34PM +0200, Jim Meyering wrote:
   All of the virBufferAddLit and virBufferVSprintf calls
   above can fail with ENOMEM.  I see that there are *many* more
   virBufferAddLit and virBufferVSprintf calls that ignore their
   return values (over 300), so maybe I'm missing something.
  
  Yes, the entire set of Xen drivers is basically fubar wrt to checking
  virBufferXXX return values. I felt that needed addresing independantly
  changing everything in one go, so didn't try to address that in this
  patch.
 
   Maybe the best is to store in the buffer the fact that there have been
 an error at some point, and check that value before extracting the content
 in a single place, that would make the code cleaner, and makes harder to
 miss one test.

So we've two options:

 - Make all the virBuffer* functions be void, and keep an internal
   error flag to be checked at the end

 - Annotate all the virBuffer* functions with __attribute((warn_unused_result))
   which forces the caller to check the return value


I'm acutally inclined to go for the former, since it'll let us remove a
large number of 'goto no_memory' statements giving clearer code

I think I'd also like to mak the virBuffer struct private, so people
can't access the data field directly - force them to go via an API to
get hold of the internal char * - this lets us ensure they don't access
the data if an error has occurred.

Dan.
-- 
|: Red Hat, Engineering, Boston   -o-   http://people.redhat.com/berrange/ :|
|: http://libvirt.org  -o-  http://virt-manager.org  -o-  http://ovirt.org :|
|: http://autobuild.org   -o- http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505  -o-  F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|

--
Libvir-list mailing list
Libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


Re: [Libvir] PATCH 2/4: Xen driver support for serial/paralle

2008-04-25 Thread Jim Meyering
Daniel P. Berrange [EMAIL PROTECTED] wrote:

 On Fri, Apr 25, 2008 at 03:11:44AM -0400, Daniel Veillard wrote:
 On Thu, Apr 24, 2008 at 10:14:49PM +0100, Daniel P. Berrange wrote:
  On Thu, Apr 24, 2008 at 10:42:34PM +0200, Jim Meyering wrote:
   All of the virBufferAddLit and virBufferVSprintf calls
   above can fail with ENOMEM.  I see that there are *many* more
   virBufferAddLit and virBufferVSprintf calls that ignore their
   return values (over 300), so maybe I'm missing something.
 
  Yes, the entire set of Xen drivers is basically fubar wrt to checking
  virBufferXXX return values. I felt that needed addresing independantly
  changing everything in one go, so didn't try to address that in this
  patch.

   Maybe the best is to store in the buffer the fact that there have been
 an error at some point, and check that value before extracting the content
 in a single place, that would make the code cleaner, and makes harder to
 miss one test.

 So we've two options:

  - Make all the virBuffer* functions be void, and keep an internal
error flag to be checked at the end

  - Annotate all the virBuffer* functions with 
 __attribute((warn_unused_result))
which forces the caller to check the return value

 I'm acutally inclined to go for the former, since it'll let us remove a
 large number of 'goto no_memory' statements giving clearer code

I agree.

 I think I'd also like to mak the virBuffer struct private, so people
 can't access the data field directly - force them to go via an API to
 get hold of the internal char * - this lets us ensure they don't access
 the data if an error has occurred.

Sounds good.  As a second step, I guess.
If we're revamping, then it'd be good to move away from the
pointer-hiding typedef in the current implementation:

typedef virBuffer *virBufferPtr;

That makes it hard to declare such a parameter const,
as it will have to be in the string-extracting or
error-state-querying functions.

The alternative is to use e.g.,

typedef const virBuffer *virBufferConstPtr;

but that's far less readable and doesn't scale well.

--
Libvir-list mailing list
Libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list