Re: [libvirt] [PATCH] Fix parsing of bond interface XML

2013-03-21 Thread Eric Blake
On 03/21/2013 03:50 PM, Jim Fehlig wrote:
 Noticed that parsing bond interface XML containing the miimon element
 fails
 
   interface type=bond name=bond0
 ...
 bond mode=active-backup
   miimon freq=100 carrier=netif/
   ...
 /bond
   /interface
 
 This configuration does not contain the optional updelay and downdelay
 attributes, but parsing will fail due to returning the result of
 virXPathULong (a -1 when the attribute doesn't exist) from
 virInterfaceDefParseBond after examining the updelay attribute.
 
 I considered just adding a ret = 0; near the bottom of
 virInterfaceDefParseBond, but see there is no cleanup in the error
 label.  Instead, just return failure where failure occurs and
 return success if the end of the function is reached.
 ---

  virInterfaceDefParseBond(virInterfaceDefPtr def,
   xmlXPathContextPtr ctxt) {
 -int ret = -1;
 +int res;
  unsigned long tmp;

Pre-existing, but this is a long...

  if (virXPathNode(./miimon[1], ctxt) != NULL) {
  def-data.bond.monit = VIR_INTERFACE_BOND_MONIT_MII;
  
 -ret = virXPathULong(string(./miimon/@freq), ctxt, tmp);
 -if ((ret == -2) || (ret == -1)) {
 +res = virXPathULong(string(./miimon/@freq), ctxt, tmp);
 +if ((res == -2) || (res == -1)) {
  virReportError(VIR_ERR_XML_ERROR,
 %s, _(bond interface miimon freq missing or 
 invalid));
 -goto error;
 +return -1;
  }
  def-data.bond.frequency = (int) tmp;

yet here we want it to be an int.  Why not use virXPathInt() on an int
in the first place, so that we don't risk silent truncation?  In fact,
why even have tmp, when we can:

ret = virXPathInt(string(./miimon/@freq), ctxt,
  def-data.bond.frequency)

in the first place?

As long as we are cleaning up this function, we might as well clean up
the unintentional silent truncation.

-- 
Eric Blake   eblake redhat com+1-919-301-3266
Libvirt virtualization library http://libvirt.org



signature.asc
Description: OpenPGP digital signature
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [PATCH] nwfilter: probe for inverted ctdir

2013-03-21 Thread Eric Blake
On 03/21/2013 04:04 PM, Stefan Berger wrote:
 Linux netfilter at some point inverted the meaning of the '--ctdir reply'
 and newer netfilter implementations now expect '--ctdir original'
 instread and vice-versa.

s/instread/instead/

 We probe for this netfilter change via a UDP message over loopback and 3
 filtering rules applied to INPUT. If the sent byte arrives, the newer
 netfilter implementation has been detected.
 
 Signed-off-by: Stefan Berger stef...@linux.vnet.ibm.com
 
 ---
  src/nwfilter/nwfilter_ebiptables_driver.c |  123
 ++
  1 file changed, 123 insertions(+)
 

 +/*
 + * --ctdir original vs. reply's meaning was inverted in the netfilter
 + * at some point. We probe for it.
 + */
 +static bool iptables_ctdir_corrected = false;

C guarantees that this is initialized to false without having to
explicitly state that.

Looks big, but it's a one-time probe done at initialization, and seems
like it does the trick.  You may want to wait for a review from Laine,
but I didn't spot anything else wrong.

-- 
Eric Blake   eblake redhat com+1-919-301-3266
Libvirt virtualization library http://libvirt.org



signature.asc
Description: OpenPGP digital signature
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

[libvirt] [PATCH V2] Fix parsing of bond interface XML

2013-03-21 Thread Jim Fehlig
Noticed that parsing bond interface XML containing the miimon element
fails

  interface type=bond name=bond0
...
bond mode=active-backup
  miimon freq=100 carrier=netif/
  ...
/bond
  /interface

This configuration does not contain the optional updelay and downdelay
attributes, but parsing will fail due to returning the result of
virXPathULong (a -1 when the attribute doesn't exist) from
virInterfaceDefParseBond after examining the updelay attribute.

While fixing this bug, cleanup the function to use virXPathInt instead
of virXPathULong, and store the result directly instead of using a tmp
variable.  Using virXPathInt actually fixes a potential silent
truncation bug noted by Eric Blake.

Also, there is no cleaup in the error label.  Remove the label,
returning failure where failure occurs and success if the end of the
function is reached.
---

V2:
Use virXPathInt instead of virXPathULong to avoid silent truncation,
and store value directly in the def structure instead of using a tmp
variable.

 src/conf/interface_conf.c | 63 ---
 1 file changed, 27 insertions(+), 36 deletions(-)

diff --git a/src/conf/interface_conf.c b/src/conf/interface_conf.c
index 9301ec0..7ca9c86 100644
--- a/src/conf/interface_conf.c
+++ b/src/conf/interface_conf.c
@@ -572,81 +572,72 @@ error:
 static int
 virInterfaceDefParseBond(virInterfaceDefPtr def,
  xmlXPathContextPtr ctxt) {
-int ret = -1;
-unsigned long tmp;
+int res;
 
 def-data.bond.mode = virInterfaceDefParseBondMode(ctxt);
 if (def-data.bond.mode  0)
-goto error;
+return -1;
 
-ret = virInterfaceDefParseBondItfs(def, ctxt);
-if (ret != 0)
-   goto error;
+if (virInterfaceDefParseBondItfs(def, ctxt) != 0)
+return -1;
 
 if (virXPathNode(./miimon[1], ctxt) != NULL) {
 def-data.bond.monit = VIR_INTERFACE_BOND_MONIT_MII;
 
-ret = virXPathULong(string(./miimon/@freq), ctxt, tmp);
-if ((ret == -2) || (ret == -1)) {
+res = virXPathInt(string(./miimon/@freq), ctxt,
+  def-data.bond.frequency);
+if ((res == -2) || (res == -1)) {
 virReportError(VIR_ERR_XML_ERROR,
%s, _(bond interface miimon freq missing or 
invalid));
-goto error;
+return -1;
 }
-def-data.bond.frequency = (int) tmp;
 
-ret = virXPathULong(string(./miimon/@downdelay), ctxt, tmp);
-if (ret == -2) {
+res = virXPathInt(string(./miimon/@downdelay), ctxt,
+  def-data.bond.downdelay);
+if (res == -2) {
 virReportError(VIR_ERR_XML_ERROR,
%s, _(bond interface miimon downdelay invalid));
-goto error;
-} else if (ret == 0) {
-def-data.bond.downdelay = (int) tmp;
+return -1;
 }
 
-ret = virXPathULong(string(./miimon/@updelay), ctxt, tmp);
-if (ret == -2) {
+res = virXPathInt(string(./miimon/@updelay), ctxt,
+  def-data.bond.updelay);
+if (res == -2) {
 virReportError(VIR_ERR_XML_ERROR,
%s, _(bond interface miimon updelay invalid));
-goto error;
-} else if (ret == 0) {
-def-data.bond.updelay = (int) tmp;
+return -1;
 }
 
 def-data.bond.carrier = virInterfaceDefParseBondMiiCarrier(ctxt);
-if (def-data.bond.carrier  0) {
-ret = -1;
-goto error;
-}
+if (def-data.bond.carrier  0)
+return -1;
 
 } else if (virXPathNode(./arpmon[1], ctxt) != NULL) {
 
 def-data.bond.monit = VIR_INTERFACE_BOND_MONIT_ARP;
 
-ret = virXPathULong(string(./arpmon/@interval), ctxt, tmp);
-if ((ret == -2) || (ret == -1)) {
+res = virXPathInt(string(./arpmon/@interval), ctxt,
+  def-data.bond.interval);
+if ((res == -2) || (res == -1)) {
 virReportError(VIR_ERR_XML_ERROR,
%s, _(bond interface arpmon interval missing or 
invalid));
-goto error;
+return -1;
 }
-def-data.bond.interval = (int) tmp;
 
 def-data.bond.target =
 virXPathString(string(./arpmon/@target), ctxt);
 if (def-data.bond.target == NULL) {
 virReportError(VIR_ERR_XML_ERROR,
%s, _(bond interface arpmon target missing));
-ret = -1;
-goto error;
+return -1;
 }
 
 def-data.bond.validate = virInterfaceDefParseBondArpValid(ctxt);
-if (def-data.bond.validate  0) {
-ret = -1;
-goto error;
-}
+if (def-data.bond.validate  0)
+return -1;
 }
-error:
-return ret;
+
+return 0;
 }
 
 static int
-- 
1.8.0.1

--
libvir-list 

Re: [libvirt] [PATCH] Fix parsing of bond interface XML

2013-03-21 Thread Jim Fehlig
Eric Blake wrote:
 On 03/21/2013 03:50 PM, Jim Fehlig wrote:
   
 Noticed that parsing bond interface XML containing the miimon element
 fails

   interface type=bond name=bond0
 ...
 bond mode=active-backup
   miimon freq=100 carrier=netif/
   ...
 /bond
   /interface

 This configuration does not contain the optional updelay and downdelay
 attributes, but parsing will fail due to returning the result of
 virXPathULong (a -1 when the attribute doesn't exist) from
 virInterfaceDefParseBond after examining the updelay attribute.

 I considered just adding a ret = 0; near the bottom of
 virInterfaceDefParseBond, but see there is no cleanup in the error
 label.  Instead, just return failure where failure occurs and
 return success if the end of the function is reached.
 ---
 

   
  virInterfaceDefParseBond(virInterfaceDefPtr def,
   xmlXPathContextPtr ctxt) {
 -int ret = -1;
 +int res;
  unsigned long tmp;
 

 Pre-existing, but this is a long...

   
  if (virXPathNode(./miimon[1], ctxt) != NULL) {
  def-data.bond.monit = VIR_INTERFACE_BOND_MONIT_MII;
  
 -ret = virXPathULong(string(./miimon/@freq), ctxt, tmp);
 -if ((ret == -2) || (ret == -1)) {
 +res = virXPathULong(string(./miimon/@freq), ctxt, tmp);
 +if ((res == -2) || (res == -1)) {
  virReportError(VIR_ERR_XML_ERROR,
 %s, _(bond interface miimon freq missing or 
 invalid));
 -goto error;
 +return -1;
  }
  def-data.bond.frequency = (int) tmp;
 

 yet here we want it to be an int.  Why not use virXPathInt() on an int
 in the first place, so that we don't risk silent truncation?  In fact,
 why even have tmp, when we can:

 ret = virXPathInt(string(./miimon/@freq), ctxt,
   def-data.bond.frequency)

 in the first place?
   

The current behavior is to store the value in def depending on the
return value of virXPathULong.  But looking at the function, this is
only done when the return value is 0.  And it seems the virXPath
functions only store the value when returning 0, so IMO your proposal is
correct.  I've sent a V2.

Thanks,
Jim

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


Re: [libvirt] [PATCH V2] Fix parsing of bond interface XML

2013-03-21 Thread Eric Blake
On 03/21/2013 05:13 PM, Jim Fehlig wrote:
 Noticed that parsing bond interface XML containing the miimon element
 fails
 
   interface type=bond name=bond0
 ...
 bond mode=active-backup
   miimon freq=100 carrier=netif/
   ...
 /bond
   /interface
 
 This configuration does not contain the optional updelay and downdelay
 attributes, but parsing will fail due to returning the result of
 virXPathULong (a -1 when the attribute doesn't exist) from
 virInterfaceDefParseBond after examining the updelay attribute.
 
 While fixing this bug, cleanup the function to use virXPathInt instead
 of virXPathULong, and store the result directly instead of using a tmp
 variable.  Using virXPathInt actually fixes a potential silent
 truncation bug noted by Eric Blake.
 
 Also, there is no cleaup in the error label.  Remove the label,

s/cleaup/cleanup/

 returning failure where failure occurs and success if the end of the
 function is reached.
 ---
 

ACK

-- 
Eric Blake   eblake redhat com+1-919-301-3266
Libvirt virtualization library http://libvirt.org



signature.asc
Description: OpenPGP digital signature
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [PATCH V2] Fix parsing of bond interface XML

2013-03-21 Thread Jim Fehlig
Eric Blake wrote:
 On 03/21/2013 05:13 PM, Jim Fehlig wrote:
   
 Noticed that parsing bond interface XML containing the miimon element
 fails

   interface type=bond name=bond0
 ...
 bond mode=active-backup
   miimon freq=100 carrier=netif/
   ...
 /bond
   /interface

 This configuration does not contain the optional updelay and downdelay
 attributes, but parsing will fail due to returning the result of
 virXPathULong (a -1 when the attribute doesn't exist) from
 virInterfaceDefParseBond after examining the updelay attribute.

 While fixing this bug, cleanup the function to use virXPathInt instead
 of virXPathULong, and store the result directly instead of using a tmp
 variable.  Using virXPathInt actually fixes a potential silent
 truncation bug noted by Eric Blake.

 Also, there is no cleaup in the error label.  Remove the label,
 

 s/cleaup/cleanup/
   

Will fix.

   
 returning failure where failure occurs and success if the end of the
 function is reached.
 ---

 

 ACK
   

But I'm going to wait to push this until I test it!  After fiddling with
the network too much on my test machine, I can no longer reach it.  I'll
have access to that machine tomorrow and will push this after testing.

Thanks,
Jim

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


Re: [libvirt] [PATCH] nwfilter: probe for inverted ctdir

2013-03-21 Thread Stefan Berger

On 03/21/2013 06:26 PM, Eric Blake wrote:

On 03/21/2013 04:04 PM, Stefan Berger wrote:
C guarantees that this is initialized to false without having to
explicitly state that.

Looks big, but it's a one-time probe done at initialization, and seems
like it does the trick.  You may want to wait for a review from Laine,
but I didn't spot anything else wrong.


One problem:

src/nwfilter/nwfilter_ebiptables_driver.c:4346:if 
(inet_aton(127.0.0.1, serveraddr.sin_addr) == 0) {

maint.mk: use inet_aton_r, not inet_aton

I don't think this function exists...

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


Re: [libvirt] [PATCH] Make virsh support '~' and '$HOME' in interactive mode

2013-03-21 Thread Zhang Xiaohe

于 2013年03月21日 21:08, Eric Blake 写道:

On 03/21/2013 04:20 AM, Daniel P. Berrange wrote:

In other words, if we're going to do this, go all the way and use
wordexp() to get shell-like expansion, instead of reinventing it
ourselves.  Except that wordexp() is not portable to mingw, and not
provided in gnulib.



Also, we'll need a way to escape the special meaning of '~'
and '$' to get them treated as literal characters instead of
special characters.


We already have the ability to quote characters, so that we can embed
spaces; our quoting rules are (intentionally) copied on shell rules, so
they would still work with a wordexp() approach.


This seems better than just expanding $HOME, i will try this wordexp().
One question, is variable can be accepted in the position of command
and option? That is, is this form
virsh # $VAR --$OPT=~/rpmbuild
could be valid?


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

Re: [libvirt] [PATCH] nwfilter: probe for inverted ctdir

2013-03-21 Thread Eric Blake
On 03/21/2013 06:40 PM, Stefan Berger wrote:
 On 03/21/2013 06:26 PM, Eric Blake wrote:
 On 03/21/2013 04:04 PM, Stefan Berger wrote:
 C guarantees that this is initialized to false without having to
 explicitly state that.

 Looks big, but it's a one-time probe done at initialization, and seems
 like it does the trick.  You may want to wait for a review from Laine,
 but I didn't spot anything else wrong.

 One problem:
 
 src/nwfilter/nwfilter_ebiptables_driver.c:4346:if
 (inet_aton(127.0.0.1, serveraddr.sin_addr) == 0) {
 maint.mk: use inet_aton_r, not inet_aton
 
 I don't think this function exists...

Indeed not the best of messages from cfg.mk; but the explanation lies in
Makefile.nonreentrant - we are explicitly rejecting inet_aton() in favor
of getaddrinfo().  For that matter,
src/util/virsocketaddr.c:virSocketAddrParse() might make your attempt
more compact.

-- 
Eric Blake   eblake redhat com+1-919-301-3266
Libvirt virtualization library http://libvirt.org



signature.asc
Description: OpenPGP digital signature
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [PATCH] Make virsh support '~' and '$HOME' in interactive mode

2013-03-21 Thread Eric Blake
On 03/21/2013 07:33 PM, Zhang Xiaohe wrote:
 于 2013年03月21日 21:08, Eric Blake 写道:
 On 03/21/2013 04:20 AM, Daniel P. Berrange wrote:

 In other words, if we're going to do this, go all the way and use
 wordexp() to get shell-like expansion, instead of reinventing it
 ourselves.  Except that wordexp() is not portable to mingw, and not
 provided in gnulib.


 Also, we'll need a way to escape the special meaning of '~'
 and '$' to get them treated as literal characters instead of
 special characters.

 We already have the ability to quote characters, so that we can embed
 spaces; our quoting rules are (intentionally) copied on shell rules, so
 they would still work with a wordexp() approach.

 This seems better than just expanding $HOME, i will try this wordexp().
 One question, is variable can be accepted in the position of command
 and option? That is, is this form
 virsh # $VAR --$OPT=~/rpmbuild
 could be valid?

wordexp() is not portable to mingw, and not provided by gnulib.  If you
try to use wordexp(), you will basically be re-writing a big chunk of
/bin/sh.  At this point, I'm not sure it's worth the complexity.
Interactive virsh does not need to be a full-blown shell.  From the
command line, you already have the shell parsing things before handing
it to virsh.

-- 
Eric Blake   eblake redhat com+1-919-301-3266
Libvirt virtualization library http://libvirt.org



signature.asc
Description: OpenPGP digital signature
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [PATCH 2/2] make: regenerate bindings when classname.py changes

2013-03-21 Thread Guannan Ren

On 03/21/2013 06:48 PM, Osier Yang wrote:

On 2013年03月21日 16:41, Guannan Ren wrote:

---
  python/Makefile.am | 9 +++--
  1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/python/Makefile.am b/python/Makefile.am
index 55c5e41..18da9a2 100644
--- a/python/Makefile.am
+++ b/python/Makefile.am
@@ -26,7 +26,8 @@ CLASSES_EXTRA = \
  libvirt-override-virConnect.py \
  libvirt-override-virDomain.py \
  libvirt-override-virDomainSnapshot.py \
-libvirt-override-virStream.py
+libvirt-override-virStream.py \
+libvirt-override-virStoragePool.py


ACK to this.



  EXTRA_DIST =\
  generator.py\
@@ -109,7 +110,11 @@ LXC_GENERATED= libvirt-lxc-export.c \
 libvirt-lxc.h \
 libvirt_lxc.py

-$(GENERATE).stamp: $(srcdir)/$(GENERATE) $(API_DESC) 
$(QEMU_API_DESC) $(LXC_API_DESC)

+$(GENERATE).stamp: $(srcdir)/$(GENERATE) \
+   $(API_DESC) \
+   $(QEMU_API_DESC) \
+   $(LXC_API_DESC) \
+   $(CLASSES_EXTRA)


Why do we need to add the manually created files here?



 The problem here is that after we edit or make some changes to 
these manually-created files,

 then, run make, the libvirt.py wrapper file is not be updated.
 The fix here is to update the libvirt.py by running that recipe 
again, so adding $(CLASS_EXTRA)

 to one of that stamp file's prerequisites.


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

Re: [libvirt] [PATCH 1/2] python: treat flags as default argument with value 0

2013-03-21 Thread Guannan Ren

On 03/21/2013 06:47 PM, Osier Yang wrote:

On 2013年03月21日 16:41, Guannan Ren wrote:

The following four functions have not changed because default arguments
have to come after positional arguments. Changing them will break the
the binding APIs.

migrate(self, dconn, flags, dname, uri, bandwidth):
migrate2(self, dconn, dxml, flags, dname, uri, bandwidth):
migrateToURI(self, duri, flags, dname, bandwidth):
migrateToURI2(self, dconnuri, miguri, dxml, flags, dname, bandwidth):


So how are they filtered? ...



  If we add flags=0 to above four APIs, we have to move the 
flags arguments
  to the last position in the arguments list because the rule 
default arguments
  have to come after positional arguments. Changing them will 
break the binding

  APIs. so I didn't touch them.






---
  python/generator.py  |  2 ++
  python/libvirt-override-virConnect.py| 14 +++---
  python/libvirt-override-virDomain.py |  2 +-
  python/libvirt-override-virDomainSnapshot.py |  2 +-
  python/libvirt-override-virStoragePool.py|  2 +-
  python/libvirt-override.py   |  2 +-
  6 files changed, 13 insertions(+), 11 deletions(-)

diff --git a/python/generator.py b/python/generator.py
index d269e88..bb53fcf 100755
--- a/python/generator.py
+++ b/python/generator.py
@@ -1487,6 +1487,8 @@ def buildWrappers(module):
  if n != index:
  classes.write(, %s % arg[0])
  n = n + 1
+if arg[0] == flags:
+classes.write(=0);


...As I see you write flags=0 for all the automatically generated
APIs here? And is there any risk to have other APIs of which flags
doesn't default to 0? Except the ones you mentioned in commit log.




   Yes,  I am not sure if the 0 is appropriatefor every APIs.
   I need more advice here.
   According to my test, they can accept the 0 value all.



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

Re: [libvirt] [PATCH 1/2] python: treat flags as default argument with value 0

2013-03-21 Thread Eric Blake
On 03/21/2013 04:47 AM, Osier Yang wrote:
 On 2013年03月21日 16:41, Guannan Ren wrote:
 The following four functions have not changed because default arguments
 have to come after positional arguments. Changing them will break the
 the binding APIs.

 migrate(self, dconn, flags, dname, uri, bandwidth):
 migrate2(self, dconn, dxml, flags, dname, uri, bandwidth):
 migrateToURI(self, duri, flags, dname, bandwidth):
 migrateToURI2(self, dconnuri, miguri, dxml, flags, dname, bandwidth):
 
 So how are they filtered? ...

They are not generated; this patch adds a default to all generated
functions, then adds a default to all hand-written functions except for
those four.

 
 All the left are manually created files. So it's safe.

I agree, and since I had been asking for this,

ACK.

-- 
Eric Blake   eblake redhat com+1-919-301-3266
Libvirt virtualization library http://libvirt.org



signature.asc
Description: OpenPGP digital signature
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [PATCH 2/2] make: regenerate bindings when classname.py changes

2013-03-21 Thread Eric Blake
On 03/21/2013 02:41 AM, Guannan Ren wrote:
 ---
  python/Makefile.am | 9 +++--
  1 file changed, 7 insertions(+), 2 deletions(-)
 
 diff --git a/python/Makefile.am b/python/Makefile.am
 index 55c5e41..18da9a2 100644
 --- a/python/Makefile.am
 +++ b/python/Makefile.am
 @@ -26,7 +26,8 @@ CLASSES_EXTRA = \
   libvirt-override-virConnect.py \
   libvirt-override-virDomain.py \
   libvirt-override-virDomainSnapshot.py \
 - libvirt-override-virStream.py
 + libvirt-override-virStream.py \
 + libvirt-override-virStoragePool.py

Not alphabetically sorted.

  
  EXTRA_DIST = \
   generator.py\
 @@ -109,7 +110,11 @@ LXC_GENERATED= libvirt-lxc-export.c \
  libvirt-lxc.h \
  libvirt_lxc.py
  
 -$(GENERATE).stamp: $(srcdir)/$(GENERATE) $(API_DESC) $(QEMU_API_DESC) 
 $(LXC_API_DESC)
 +$(GENERATE).stamp: $(srcdir)/$(GENERATE) \
 +   $(API_DESC) \
 +   $(QEMU_API_DESC) \
 +   $(LXC_API_DESC) \
 +   $(CLASSES_EXTRA)
   $(AM_V_GEN)$(PYTHON) $(srcdir)/$(GENERATE) $(PYTHON)  \
   touch $@

ACK if you fix sorting.

-- 
Eric Blake   eblake redhat com+1-919-301-3266
Libvirt virtualization library http://libvirt.org



signature.asc
Description: OpenPGP digital signature
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [PATCH] Make virsh support '~' and '$HOME' in interactive mode

2013-03-21 Thread Zhang Xiaohe

于 2013年03月22日 10:17, Eric Blake 写道:

On 03/21/2013 07:33 PM, Zhang Xiaohe wrote:

于 2013年03月21日 21:08, Eric Blake 写道:

On 03/21/2013 04:20 AM, Daniel P. Berrange wrote:

In other words, if we're going to do this, go all the way and use
wordexp() to get shell-like expansion, instead of reinventing it
ourselves.  Except that wordexp() is not portable to mingw, and not
provided in gnulib.



Also, we'll need a way to escape the special meaning of '~'
and '$' to get them treated as literal characters instead of
special characters.


We already have the ability to quote characters, so that we can embed
spaces; our quoting rules are (intentionally) copied on shell rules, so
they would still work with a wordexp() approach.


This seems better than just expanding $HOME, i will try this wordexp().
One question, is variable can be accepted in the position of command
and option? That is, is this form
virsh # $VAR --$OPT=~/rpmbuild
could be valid?


wordexp() is not portable to mingw, and not provided by gnulib.  If you
try to use wordexp(), you will basically be re-writing a big chunk of
/bin/sh.  At this point, I'm not sure it's worth the complexity.
Interactive virsh does not need to be a full-blown shell.  From the
command line, you already have the shell parsing things before handing
it to virsh.

Originally, I think '~' and '$HOME' is most commonly used, so it should 
be acceptable to just expand these.

But now I'm confused. You said

if we're going to do this, go all the way

and

Interactive virsh does not need to be a full-blown shell.

I'm not sure but are you suggesting that no need to add this expansion ?

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

Re: [libvirt] [PATCH] qemu: add support for LSI MegaRAID SAS1078 (aka megasas) SCSI controller

2013-03-21 Thread Osier Yang

On 2013年03月21日 22:11, Paolo Bonzini wrote:

This does nothing more than adding the new device and capability.
The device is present since QEMU 1.2.0.

Signed-off-by: Paolo Bonzinipbonz...@redhat.com
---
  docs/formatdomain.html.in  |  6 ++--
  docs/schemas/domaincommon.rng  |  1 +
  src/conf/domain_conf.c |  3 +-
  src/conf/domain_conf.h |  1 +
  src/qemu/qemu_capabilities.c   |  2 ++
  src/qemu/qemu_capabilities.h   |  1 +
  src/qemu/qemu_command.c| 13 -
  src/vmx/vmx.c  |  3 +-
  tests/qemuhelptest.c   |  6 ++--
  .../qemuxml2argv-disk-scsi-megasas.args|  9 ++
  .../qemuxml2argv-disk-scsi-megasas.xml | 32 ++
  tests/qemuxml2argvtest.c   |  3 ++
  tests/qemuxml2xmltest.c|  1 +
  13 files changed, 73 insertions(+), 8 deletions(-)
  create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-disk-scsi-megasas.args
  create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-disk-scsi-megasas.xml


ACK

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

Re: [libvirt] [PATCH 1/2] python: treat flags as default argument with value 0

2013-03-21 Thread Eric Blake
On 03/21/2013 09:24 PM, Guannan Ren wrote:

 migrate(self, dconn, flags, dname, uri, bandwidth):
 migrate2(self, dconn, dxml, flags, dname, uri, bandwidth):
 migrateToURI(self, duri, flags, dname, bandwidth):
 migrateToURI2(self, dconnuri, miguri, dxml, flags, dname, bandwidth):

 So how are they filtered? ...

 
   If we add flags=0 to above four APIs, we have to move the
 flags arguments
   to the last position in the arguments list because the rule
 default arguments
   have to come after positional arguments. Changing them will
 break the binding
   APIs. so I didn't touch them.

Actually, we should probably use

migrate(self, dconn, flags=0, dname=None, uri=None, bandwidth=0)

with sane defaults for all arguments after the flags.  After all, the C
api states:

 * virDomainMigrate:
 * @domain: a domain object
 * @dconn: destination host (a connection object)
 * @flags: bitwise-OR of virDomainMigrateFlags
 * @dname: (optional) rename domain to this at destination
 * @uri: (optional) dest hostname/URI as seen from the source host
 * @bandwidth: (optional) specify migration bandwidth limit in Mbps

But I'm okay if you change the migrate* functions in a separate patch,
since it will be touching more than just flags.

 ...As I see you write flags=0 for all the automatically generated
 APIs here? And is there any risk to have other APIs of which flags
 doesn't default to 0? Except the ones you mentioned in commit log.

 
 
Yes,  I am not sure if the 0 is appropriatefor every APIs.
I need more advice here.
According to my test, they can accept the 0 value all.

flags == 0 should be sane for all APIs that we add.  In fact, for many
APIs, flags == 0 is the only value that we actually support, when we
haven't yet used any flags.

-- 
Eric Blake   eblake redhat com+1-919-301-3266
Libvirt virtualization library http://libvirt.org



signature.asc
Description: OpenPGP digital signature
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [PATCH 1/2] python: treat flags as default argument with value 0

2013-03-21 Thread Guannan Ren

On 03/22/2013 11:31 AM, Eric Blake wrote:

On 03/21/2013 09:24 PM, Guannan Ren wrote:


migrate(self, dconn, flags, dname, uri, bandwidth):
migrate2(self, dconn, dxml, flags, dname, uri, bandwidth):
migrateToURI(self, duri, flags, dname, bandwidth):
migrateToURI2(self, dconnuri, miguri, dxml, flags, dname, bandwidth):

So how are they filtered? ...


   If we add flags=0 to above four APIs, we have to move the
flags arguments
   to the last position in the arguments list because the rule
default arguments
   have to come after positional arguments. Changing them will
break the binding
   APIs. so I didn't touch them.

Actually, we should probably use

migrate(self, dconn, flags=0, dname=None, uri=None, bandwidth=0)

with sane defaults for all arguments after the flags.  After all, the C
api states:

  * virDomainMigrate:
  * @domain: a domain object
  * @dconn: destination host (a connection object)
  * @flags: bitwise-OR of virDomainMigrateFlags
  * @dname: (optional) rename domain to this at destination
  * @uri: (optional) dest hostname/URI as seen from the source host
  * @bandwidth: (optional) specify migration bandwidth limit in Mbps

But I'm okay if you change the migrate* functions in a separate patch,
since it will be touching more than just flags.


   okay.





...As I see you write flags=0 for all the automatically generated
APIs here? And is there any risk to have other APIs of which flags
doesn't default to 0? Except the ones you mentioned in commit log.



Yes,  I am not sure if the 0 is appropriatefor every APIs.
I need more advice here.
According to my test, they can accept the 0 value all.

flags == 0 should be sane for all APIs that we add.  In fact, for many
APIs, flags == 0 is the only value that we actually support, when we
haven't yet used any flags.



   Okay, thank you guys for the review.
   I   Pushed.

   Guannan


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


Re: [libvirt] [PATCH] Make virsh support '~' and '$HOME' in interactive mode

2013-03-21 Thread Eric Blake
On 03/21/2013 09:18 PM, Zhang Xiaohe wrote:

 Originally, I think '~' and '$HOME' is most commonly used, so it should
 be acceptable to just expand these.
 But now I'm confused. You said
 if we're going to do this, go all the way

Expanding just '~' and '$HOME' but nothing else is a disservice to the
user.  If we're going to expand anything, then we should be consistent
and allow for the expansion of all variables.

 and
 Interactive virsh does not need to be a full-blown shell.
 I'm not sure but are you suggesting that no need to add this expansion ?

Expanding everything means re-implementing what the shell does.
wordexp() would be ideal for this, except that wordexp() is not portable
enough.  By the time we end up rewriting enough code to do what
wordexp() already could do, we are adding lots of bloat into virsh to
make it mimic what /bin/sh can already do.

Ergo, I think that this patch idea is not worth it.  If a user wants
shell expansions, they should let the shell do it, when building up the
virsh command line.  That is, instead of trying to do expansions in a
virsh interactive session:

$ virsh
virsh# echo $HOME

you should just let the shell do it beforehand:

$ virsh echo $HOME

-- 
Eric Blake   eblake redhat com+1-919-301-3266
Libvirt virtualization library http://libvirt.org



signature.asc
Description: OpenPGP digital signature
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

[libvirt] Build failed in Jenkins: libvirt-syntax-check #759

2013-03-21 Thread Jenkins CI
See http://honk.sigxcpu.org:8001/job/libvirt-syntax-check/759/

--
Started by upstream project libvirt-build build number 856
[workspace] $ /bin/sh -xe /tmp/hudson8330114436432330964.sh
+ make syntax-check
  GENbracket-spacing-check
GFDL_version
0.88 GFDL_version
TAB_in_indentation
0.59 TAB_in_indentation
Wundef_boolean
0.38 Wundef_boolean
avoid_attribute_unused_in_header
0.40 avoid_attribute_unused_in_header
avoid_ctype_macros
0.81 avoid_ctype_macros
avoid_if_before_free
8.18 avoid_if_before_free
avoid_strcase
0.91 avoid_strcase
avoid_write
0.55 avoid_write
bindtextdomain
0.46 bindtextdomain
cast_of_argument_to_free
0.76 cast_of_argument_to_free
cast_of_x_alloc_return_value
0.73 cast_of_x_alloc_return_value
changelog
0.32 changelog
const_long_option
0.52 const_long_option
copyright_address
0.87 copyright_address
copyright_check
1.06 copyright_check
copyright_format
2.39 copyright_format
correct_id_types
1.00 correct_id_types
error_message_period
0.72 error_message_period
error_message_warn_fatal
0.73 error_message_warn_fatal
flags_debug
1.72 flags_debug
flags_usage
1.68 flags_usage
libvirt_unmarked_diagnostics
2.57 libvirt_unmarked_diagnostics
m4_quote_check
0.38 m4_quote_check
makefile_TAB_only_indentation
0.37 makefile_TAB_only_indentation
makefile_at_at_check
0.31 makefile_at_at_check
po_check
19.90 po_check
preprocessor_indentation
maint.mk: skipping test sc_preprocessor_indentation: cppi not installed
0.06 preprocessor_indentation
prohibit_HAVE_MBRTOWC
0.86 prohibit_HAVE_MBRTOWC
prohibit_PATH_MAX
0.87 prohibit_PATH_MAX
prohibit_VIR_ERR_NO_MEMORY
0.83 prohibit_VIR_ERR_NO_MEMORY
prohibit_access_xok
0.88 prohibit_access_xok
prohibit_always-defined_macros
3.47 prohibit_always-defined_macros
prohibit_always_true_header_tests
0.95 prohibit_always_true_header_tests
prohibit_argmatch_without_use
grep: write error
grep: write error
sed: couldn't write 1 item to stdout: Broken pipe
sed: couldn't write 49 items to stdout: Broken pipe
0.58 prohibit_argmatch_without_use
prohibit_asprintf
0.90 prohibit_asprintf
prohibit_assert_without_use
grep: write error
grep: write error
sed: couldn't write 1 item to stdout: Broken pipe
sed: couldn't write 49 items to stdout: Broken pipe
0.61 prohibit_assert_without_use
prohibit_backup_files
0.22 prohibit_backup_files
prohibit_c_ctype_without_use
grep: write error
grep: write error
sed: couldn't write 1 item to stdout: Broken pipe
sed: couldn't write 49 items to stdout: Broken pipe
0.58 prohibit_c_ctype_without_use
prohibit_canonicalize_without_use
grep: write error
grep: write error
sed: couldn't write 1 item to stdout: Broken pipe
sed: couldn't write 49 items to stdout: Broken pipe
0.57 prohibit_canonicalize_without_use
prohibit_cloexec_without_use
grep: write error
grep: write error
sed: couldn't write 1 item to stdout: Broken pipe
sed: couldn't write 49 items to stdout: Broken pipe
0.57 prohibit_cloexec_without_use
prohibit_close
1.70 prohibit_close
prohibit_close_stream_without_use
grep: write error
grep: write error
sed: couldn't write 1 item to stdout: Broken pipe
sed: couldn't write 49 items to stdout: Broken pipe
0.70 prohibit_close_stream_without_use
prohibit_cross_inclusion
9.89 prohibit_cross_inclusion
prohibit_ctype_h
0.87 prohibit_ctype_h
prohibit_cvs_keyword
0.89 prohibit_cvs_keyword
prohibit_defined_have_decl_tests
0.87 prohibit_defined_have_decl_tests
prohibit_diagnostic_without_format
1.95 prohibit_diagnostic_without_format
prohibit_dirent_without_use
grep: write error
grep: write error
sed: couldn't write 1 item to stdout: Broken pipe
sed: couldn't write 49 items to stdout: Broken pipe
0.61 prohibit_dirent_without_use
prohibit_doubled_word
8.83 prohibit_doubled_word
prohibit_empty_lines_at_EOF
0.52 prohibit_empty_lines_at_EOF
prohibit_error_without_use
grep: write error
grep: write error
sed: couldn't write 1 item to stdout: Broken pipe
sed: couldn't write 49 items to stdout: Broken pipe
0.58 prohibit_error_without_use
prohibit_exit_in_tests
0.72 prohibit_exit_in_tests
prohibit_fork_wrappers
0.99 prohibit_fork_wrappers
prohibit_gethostby
0.86 prohibit_gethostby
prohibit_gethostname
0.88 prohibit_gethostname
prohibit_getopt_without_use
grep: write error
grep: write error
sed: couldn't write 1 item to stdout: Broken pipe
sed: couldn't write 49 items to stdout: Broken pipe
0.59 prohibit_getopt_without_use
prohibit_gettext_markup
0.92 prohibit_gettext_markup
prohibit_gettext_noop
0.86 prohibit_gettext_noop
prohibit_hash_pjw_without_use
grep: write error
grep: write error
sed: couldn't write 1 item to stdout: Broken pipe
sed: couldn't write 49 items to stdout: Broken pipe
0.57 prohibit_hash_pjw_without_use
prohibit_have_config_h
0.84 prohibit_have_config_h
prohibit_ignore_value_without_use
grep: write error
grep: write error
sed: couldn't write 1 item to stdout: Broken pipe
sed: couldn't write 49 items to stdout: Broken pipe
0.57 prohibit_ignore_value_without_use
prohibit_internal_functions
0.99 

[libvirt] [PATCH] Link libvirt_util with numa library

2013-03-21 Thread prasadjoshi . linux
From: Prasad Joshi prasadjoshi.li...@gmail.com

When the libvirt is configured with numactl, the virt-aa-helper
compilation fails with following errors

  CCLD   virt-aa-helper
libvirt_util.a(...): In function `virNumaSetupMemoryPolicy':
virnuma.c:109: undefined reference to `numa_available'
virnuma.c:115: undefined reference to `numa_max_node'
libvirt_util.a(libvirt_util_la-virnuma.o): .. `nodemask_zero_compat':
/usr/include/numa.h:80: undefined reference to `numa_bitmask_clearall'
/libvirt_util.a(libvirt_util_la-virnuma.o): `virNumaSetupMemoryPolicy':
virnuma.c:136: undefined reference to `numa_set_bind_policy'
libvirt_util.a(libvirt_util_la-virnuma.o): `numa_set_membind_compat':
/usr/include/numa.h:360: undefined reference to `numa_set_membind'
libvirt_util.a(libvirt_util_la-virnuma.o): `virNumaSetupMemoryPolicy':
virnuma.c:138: undefined reference to `numa_set_bind_policy'
libvirt_util.a(): `numa_set_interleave_mask_compat':
/usr/include/numa.h:330: undefined reference to `numa_set_interleave_mask'
libvirt_util.a(libvirt_util_la-virnuma.o): `virNumaSetupMemoryPolicy':
virnuma.c:155: undefined reference to `numa_set_bind_policy'
virnuma.c:156: undefined reference to `numa_set_preferred'
collect2: error: ld returned 1 exit status
make[3]: *** [virt-aa-helper] Error 1
make[3]: Leaving directory `/home/prasad/KVM/libvirt/src'

The patch fixes this problem by adding numa library to the list of
libraries to be linked with libvirt_util

Signed-off-by: Prasad Joshi prasadjoshi.li...@gmail.com
---
 src/Makefile.am |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/Makefile.am b/src/Makefile.am
index 21f8882..5e8e062 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -772,7 +772,7 @@ libvirt_util_la_CFLAGS = $(CAPNG_CFLAGS) $(YAJL_CFLAGS) 
$(LIBNL_CFLAGS) \
 libvirt_util_la_LIBADD = $(CAPNG_LIBS) $(YAJL_LIBS) $(LIBNL_LIBS) \
$(THREAD_LIBS) $(AUDIT_LIBS) $(DEVMAPPER_LIBS) \
$(LIB_CLOCK_GETTIME) $(DBUS_LIBS) $(MSCOM_LIBS) $(LIBXML_LIBS) \
-   $(SECDRIVER_LIBS)
+   $(SECDRIVER_LIBS) $(NUMACTL_LIBS)
 
 
 noinst_LTLIBRARIES += libvirt_conf.la
-- 
1.7.10.4

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


Re: [libvirt] [PATCH] Link libvirt_util with numa library

2013-03-21 Thread Eric Blake
On 03/21/2013 10:01 PM, prasadjoshi.li...@gmail.com wrote:
 From: Prasad Joshi prasadjoshi.li...@gmail.com
 
 When the libvirt is configured with numactl, the virt-aa-helper
 compilation fails with following errors
 

 
 The patch fixes this problem by adding numa library to the list of
 libraries to be linked with libvirt_util

Thanks; this duplicates commit e053561 already pushed earlier today.
-- 
Eric Blake   eblake redhat com+1-919-301-3266
Libvirt virtualization library http://libvirt.org



signature.asc
Description: OpenPGP digital signature
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

[libvirt] [PATCH] python:remove semicolon in python code

2013-03-21 Thread Guannan Ren
This breaked make syntax-check testing

Pushed under trivial rule
---
 python/generator.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/python/generator.py b/python/generator.py
index fbaf797..0237374 100755
--- a/python/generator.py
+++ b/python/generator.py
@@ -1490,7 +1490,7 @@ def buildWrappers(module):
 classes.write(, %s % arg[0])
 n = n + 1
 if arg[0] == flags:
-classes.write(=0);
+classes.write(=0)
 classes.write():\n)
 writeDoc(module, name, args, '', classes)
 n = 0
-- 
1.7.11.2

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


Re: [libvirt] [PATCH v2 0/6] libvirt support for userspace iSCSI initiator (libiscsi)

2013-03-21 Thread Osier Yang

On 2013年03月21日 22:43, Osier Yang wrote:

On 2013年03月21日 20:46, Daniel P. Berrange wrote:

On Thu, Mar 21, 2013 at 12:53:48PM +0100, Paolo Bonzini wrote:

This series adds support for the libiscsi userspace initiator.
Compared to v1, logical units are now specified with IQN/LUN
syntax in the name attribute.


ACK to all 6

Daniel


Got conflicts when trying to push the patches, run out of time
today, going to push tomorrow if Eric have no time to do it yet.



Pushed with the few small nits fixed.

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

Re: [libvirt] [PATCH] qemu: add support for LSI MegaRAID SAS1078 (aka megasas) SCSI controller

2013-03-21 Thread Osier Yang

On 2013年03月22日 11:29, Osier Yang wrote:

On 2013年03月21日 22:11, Paolo Bonzini wrote:

This does nothing more than adding the new device and capability.
The device is present since QEMU 1.2.0.

Signed-off-by: Paolo Bonzinipbonz...@redhat.com
---
docs/formatdomain.html.in | 6 ++--
docs/schemas/domaincommon.rng | 1 +
src/conf/domain_conf.c | 3 +-
src/conf/domain_conf.h | 1 +
src/qemu/qemu_capabilities.c | 2 ++
src/qemu/qemu_capabilities.h | 1 +
src/qemu/qemu_command.c | 13 -
src/vmx/vmx.c | 3 +-
tests/qemuhelptest.c | 6 ++--
.../qemuxml2argv-disk-scsi-megasas.args | 9 ++
.../qemuxml2argv-disk-scsi-megasas.xml | 32 ++
tests/qemuxml2argvtest.c | 3 ++
tests/qemuxml2xmltest.c | 1 +
13 files changed, 73 insertions(+), 8 deletions(-)
create mode 100644
tests/qemuxml2argvdata/qemuxml2argv-disk-scsi-megasas.args
create mode 100644
tests/qemuxml2argvdata/qemuxml2argv-disk-scsi-megasas.xml


ACK


Pushed.

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

Re: [libvirt] Build failed in Jenkins: libvirt-syntax-check #759

2013-03-21 Thread Osier Yang

On 2013年03月22日 11:54, Jenkins CI wrote:

Seehttp://honk.sigxcpu.org:8001/job/libvirt-syntax-check/759/

--
Started by upstream project libvirt-build build number 856
[workspace] $ /bin/sh -xe /tmp/hudson8330114436432330964.sh
+ make syntax-check
   GENbracket-spacing-check
GFDL_version
0.88 GFDL_version
TAB_in_indentation
0.59 TAB_in_indentation
Wundef_boolean
0.38 Wundef_boolean
avoid_attribute_unused_in_header
0.40 avoid_attribute_unused_in_header
avoid_ctype_macros
0.81 avoid_ctype_macros
avoid_if_before_free
8.18 avoid_if_before_free
avoid_strcase
0.91 avoid_strcase
avoid_write
0.55 avoid_write
bindtextdomain
0.46 bindtextdomain
cast_of_argument_to_free
0.76 cast_of_argument_to_free
cast_of_x_alloc_return_value
0.73 cast_of_x_alloc_return_value
changelog
0.32 changelog
const_long_option
0.52 const_long_option
copyright_address
0.87 copyright_address
copyright_check
1.06 copyright_check
copyright_format
2.39 copyright_format
correct_id_types
1.00 correct_id_types
error_message_period
0.72 error_message_period
error_message_warn_fatal
0.73 error_message_warn_fatal
flags_debug
1.72 flags_debug
flags_usage
1.68 flags_usage
libvirt_unmarked_diagnostics
2.57 libvirt_unmarked_diagnostics
m4_quote_check
0.38 m4_quote_check
makefile_TAB_only_indentation
0.37 makefile_TAB_only_indentation
makefile_at_at_check
0.31 makefile_at_at_check
po_check
19.90 po_check
preprocessor_indentation
maint.mk: skipping test sc_preprocessor_indentation: cppi not installed
0.06 preprocessor_indentation
prohibit_HAVE_MBRTOWC
0.86 prohibit_HAVE_MBRTOWC
prohibit_PATH_MAX
0.87 prohibit_PATH_MAX
prohibit_VIR_ERR_NO_MEMORY
0.83 prohibit_VIR_ERR_NO_MEMORY
prohibit_access_xok
0.88 prohibit_access_xok
prohibit_always-defined_macros
3.47 prohibit_always-defined_macros
prohibit_always_true_header_tests
0.95 prohibit_always_true_header_tests
prohibit_argmatch_without_use
grep: write error
grep: write error
sed: couldn't write 1 item to stdout: Broken pipe
sed: couldn't write 49 items to stdout: Broken pipe
0.58 prohibit_argmatch_without_use
prohibit_asprintf
0.90 prohibit_asprintf
prohibit_assert_without_use
grep: write error
grep: write error
sed: couldn't write 1 item to stdout: Broken pipe
sed: couldn't write 49 items to stdout: Broken pipe
0.61 prohibit_assert_without_use
prohibit_backup_files
0.22 prohibit_backup_files
prohibit_c_ctype_without_use
grep: write error
grep: write error
sed: couldn't write 1 item to stdout: Broken pipe
sed: couldn't write 49 items to stdout: Broken pipe
0.58 prohibit_c_ctype_without_use
prohibit_canonicalize_without_use
grep: write error
grep: write error
sed: couldn't write 1 item to stdout: Broken pipe
sed: couldn't write 49 items to stdout: Broken pipe
0.57 prohibit_canonicalize_without_use
prohibit_cloexec_without_use
grep: write error
grep: write error
sed: couldn't write 1 item to stdout: Broken pipe
sed: couldn't write 49 items to stdout: Broken pipe
0.57 prohibit_cloexec_without_use
prohibit_close
1.70 prohibit_close
prohibit_close_stream_without_use
grep: write error
grep: write error
sed: couldn't write 1 item to stdout: Broken pipe
sed: couldn't write 49 items to stdout: Broken pipe
0.70 prohibit_close_stream_without_use
prohibit_cross_inclusion
9.89 prohibit_cross_inclusion
prohibit_ctype_h
0.87 prohibit_ctype_h
prohibit_cvs_keyword
0.89 prohibit_cvs_keyword
prohibit_defined_have_decl_tests
0.87 prohibit_defined_have_decl_tests
prohibit_diagnostic_without_format
1.95 prohibit_diagnostic_without_format
prohibit_dirent_without_use
grep: write error
grep: write error
sed: couldn't write 1 item to stdout: Broken pipe
sed: couldn't write 49 items to stdout: Broken pipe
0.61 prohibit_dirent_without_use
prohibit_doubled_word
8.83 prohibit_doubled_word
prohibit_empty_lines_at_EOF
0.52 prohibit_empty_lines_at_EOF
prohibit_error_without_use
grep: write error
grep: write error
sed: couldn't write 1 item to stdout: Broken pipe
sed: couldn't write 49 items to stdout: Broken pipe
0.58 prohibit_error_without_use
prohibit_exit_in_tests
0.72 prohibit_exit_in_tests
prohibit_fork_wrappers
0.99 prohibit_fork_wrappers
prohibit_gethostby
0.86 prohibit_gethostby
prohibit_gethostname
0.88 prohibit_gethostname
prohibit_getopt_without_use
grep: write error
grep: write error
sed: couldn't write 1 item to stdout: Broken pipe
sed: couldn't write 49 items to stdout: Broken pipe
0.59 prohibit_getopt_without_use
prohibit_gettext_markup
0.92 prohibit_gettext_markup
prohibit_gettext_noop
0.86 prohibit_gettext_noop
prohibit_hash_pjw_without_use
grep: write error
grep: write error
sed: couldn't write 1 item to stdout: Broken pipe
sed: couldn't write 49 items to stdout: Broken pipe
0.57 prohibit_hash_pjw_without_use
prohibit_have_config_h
0.84 prohibit_have_config_h
prohibit_ignore_value_without_use
grep: write error
grep: write error
sed: couldn't write 1 item to stdout: Broken pipe
sed: couldn't write 49 items to stdout: Broken pipe
0.57 prohibit_ignore_value_without_use

Re: [libvirt] Cannot initialize thread local for current identity

2013-03-21 Thread Osier Yang

On 2013年03月21日 19:48, Gao feng wrote:

When I play with the latest libvirt,my libvirtd force me out of console of 
domain.
I find the problem is introduced by commit 
ebf78be4c277cffae57d99daa199a9b3c1cf9804
Set the current client identity during API call dispatch.

Below is the error message
Error polling connection 'qemu:///system':  Cannot initialize thread local for 
current identity.

I don't know if there are something wrong with my configuration, But when I 
reset to
the commit id before this commit, everything runs well.

If you need some debug information, Please let me know,It's my pleasure.




It's already fixed by commit 6e5ad18992ab.

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

[libvirt] Jenkins build is back to normal : libvirt-syntax-check #760

2013-03-21 Thread Jenkins CI
See http://honk.sigxcpu.org:8001/job/libvirt-syntax-check/760/

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


Re: [libvirt] [PATCH] Make virsh support '~' and '$HOME' in interactive mode

2013-03-21 Thread Zhang Xiaohe

于 2013年03月22日 11:43, Eric Blake 写道:


Expanding everything means re-implementing what the shell does.
wordexp() would be ideal for this, except that wordexp() is not portable
enough.  By the time we end up rewriting enough code to do what
wordexp() already could do, we are adding lots of bloat into virsh to
make it mimic what /bin/sh can already do.

Ergo, I think that this patch idea is not worth it.  If a user wants
shell expansions, they should let the shell do it, when building up the
virsh command line.  That is, instead of trying to do expansions in a
virsh interactive session:

$ virsh
virsh# echo $HOME

you should just let the shell do it beforehand:

$ virsh echo $HOME


Thanks for explanation, I get it.


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

Re: [libvirt] Problems with filesystem type='block'

2013-03-21 Thread Doug Goldstein
On Sun, Mar 3, 2013 at 11:19 PM, Gao feng gaof...@cn.fujitsu.com wrote:
 Hi Doug,

 On 2013/03/04 12:38, Doug Goldstein wrote:
 On Sun, Mar 3, 2013 at 5:24 PM, Doug Goldstein car...@gentoo.org wrote:
 On Fri, Dec 21, 2012 at 10:15 PM, Lars Kellogg-Stedman l...@oddbit.com 
 wrote:
 Using libvirt 1.0.1, I'm trying to start an LXC container using the
 'filesytem type=block' syntax, like this:

 filesystem type=block accessmode=passthrough
   source dev=/dev/vg_files/vm-foobar-root /
   target dir=/ /
 /filesystem

 The specified block device exists:

 # ls -lL /dev/vg_files/vm-foobar-root
 brw-rw 1 root disk 253, 19 Dec 21 22:23 
 /dev/vg_files/vm-foobar-root

 If I start the domain, it appears to start without any errors...

 # virsh start foobar
 Domain foobar started

 ...but it's not actually running.  The log files (with loglevel=2)
 don't seem to be very interesting; this is everything from the
 instance log file:

 2012-12-22 04:10:57.862+: starting up
 PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin 
 LIBVIRT_DEBUG=2 LIBVIRT_LOG_OUTPUTS=2:stderr /usr/lib/libvirt/libvirt_lxc 
 --name foobar --console 22 --security=none --handshake 25 --background 
 --veth veth1
 2012-12-22 04:10:57.967+: 1468: info : libvirt version: 1.0.1
 2012-12-22 04:10:57.967+: 1468: info : lxcCapsInit:151 : No driver, 
 not initializing security driver
 PATH=/bin:/sbin TERM=linux container=lxc-libvirt 
 container_uuid=9041e32e-1df2-00c2-4660-dfa5b41510b7 
 LIBVIRT_LXC_UUID=9041e32e-1df2-00c2-4660-dfa5b41510b7 
 LIBVIRT_LXC_NAME=foobar /sbin/init
 2012-12-22 04:10:58.198+: 1: warning : 
 lxcContainerDropCapabilities:1788 : libcap-ng support not compiled in, 
 unable to clear capabilities
 2012-12-22 04:10:58.198+: 1493: warning : 
 lxcControllerClearCapabilities:679 : libcap-ng support not compiled in, 
 unable to clear capabilities

 Running an strace on the libvirtd process (strace -p libvirtd_pid
 -f ...), it doesn't look like libvirt is ever trying to mount the
 referenced filesystem.

 Is this supposed to work?  It seems like the support for having
 libvirt mount the block device is relatively recent, and I haven't had
 much luck finding examples of other folks using this capability.

 Thanks,

 -- Lars

 Lars,

 I just gave it a whirl. And I'm able to reproduce the same issue you
 are seeing. The issue appears to be that
 lxcContainerMountFsBlockAuto() is never being called. It was added in
 http://www.redhat.com/archives/libvir-list/2011-August/msg00201.html
 Hopefully I'll have more info soon.

 --
 Doug Goldstein

 It appears in the case of filesystem type=block the libvirt_lxc helper
 just gets wedged right away from first execution.

 2013-03-04 04:17:55.443+: 7197: debug : virFileMakePathHelper:1272 : 
 path=/v
 ar/run/libvirt/lxc mode=0777
 2013-03-04 04:17:55.443+: 7197: debug : virFileClose:72 : Closed fd 18
 2013-03-04 04:17:55.443+: 7197: debug : virCommandRunAsync:2200 : About 
 to r
 un 
 PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/bin:/u
 sr/x86_64-pc-linux-gnu/gcc-bin/4.6.3 LIBVIRT_DEBUG=1
 LIBVIRT_LOG_OUTPUTS=1:stderr /usr/libexec/libvirt_lxc --name testdeb
 --console 17 --security=none --handshake 20 --background --veth veth1
 2013-03-04 04:17:55.444+: 7197: debug : virFileClose:72 : Closed fd 21
 2013-03-04 04:17:55.444+: 7197: debug : virCommandRunAsync:2218 :
 Command result 0, with PID 7294
 2013-03-04 04:17:55.444+: 7294: debug : virFileClose:72 : Closed fd 3
 2013-03-04 04:17:55.444+: 7294: debug : virFileClose:72 : Closed fd 4
 2013-03-04 04:17:55.444+: 7294: debug : virFileClose:72 : Closed fd 5
 2013-03-04 04:17:55.444+: 7294: debug : virFileClose:72 : Closed fd 6
 2013-03-04 04:17:55.444+: 7294: debug : virFileClose:72 : Closed fd 7
 2013-03-04 04:17:55.444+: 7294: debug : virFileClose:72 : Closed fd 8
 2013-03-04 04:17:55.444+: 7294: debug : virFileClose:72 : Closed fd 9
 2013-03-04 04:17:55.444+: 7294: debug : virFileClose:72 : Closed fd 10
 2013-03-04 04:17:55.444+: 7294: debug : virFileClose:72 : Closed fd 11
 2013-03-04 04:17:55.444+: 7294: debug : virFileClose:72 : Closed fd 12
 2013-03-04 04:17:55.444+: 7294: debug : virFileClose:72 : Closed fd 13
 2013-03-04 04:17:55.444+: 7294: debug : virFileClose:72 : Closed fd 14
 2013-03-04 04:17:55.444+: 7294: debug : virFileClose:72 : Closed fd 15
 2013-03-04 04:17:55.444+: 7294: debug : virFileClose:72 : Closed fd 16
 2013-03-04 04:17:55.444+: 7294: debug : virFileClose:72 : Closed fd 19

 That's the last time anything with PID 7294 or lxc appears in the log
 file. I'm unfortunately not getting any lxcContainer debug messages in
 the log using LIBVIRT_DEBUG=1 LIBVIRT_LOG_OUTPUT=1:stderr



 Did you check the last version libvirt?
 I can't reproduce this problem with last libvirt.

 Thanks!
 Gao

So still trying to figure out what I'm doing wrong with LXC because I
just 

Re: [libvirt] Cannot initialize thread local for current identity

2013-03-21 Thread Gao feng
On 2013/03/22 12:20, Osier Yang wrote:
 On 2013年03月21日 19:48, Gao feng wrote:
 When I play with the latest libvirt,my libvirtd force me out of console of 
 domain.
 I find the problem is introduced by commit 
 ebf78be4c277cffae57d99daa199a9b3c1cf9804
 Set the current client identity during API call dispatch.

 Below is the error message
 Error polling connection 'qemu:///system':  Cannot initialize thread local 
 for current identity.

 I don't know if there are something wrong with my configuration, But when I 
 reset to
 the commit id before this commit, everything runs well.

 If you need some debug information, Please let me know,It's my pleasure.


 
 It's already fixed by commit 6e5ad18992ab.
 

Yes, It works!

Thanks :)

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

<    1   2