[libvirt] why we should use a mechanical indentation checker

2010-04-15 Thread Jim Meyering
I introduced a bug with this supposedly-safe, no-semantic-change delta: http://libvirt.org/git/?p=libvirt.git;a=commitdiff;h=b6719eab9e95c5daeeea85 See if you can spot it. Here is the loop in question, as it was prior to my erroneous change: for (i = 0; i nruleInstances; i++)

[libvirt] [PATCH] Install nwfilter xml files from source directory.

2010-04-15 Thread Philipp Hahn
During an out-of-tree build, the current working directory is the build directory. Since the FILTERS are static and not modified or auto-generated during the build process, they need to be explicitly fetched from the source directory during install. Prefix the files with $(srcdir), which gets

[libvirt] unable to set security context (NFSv4 problem?)

2010-04-15 Thread Harald Dunkel
Hi folks, Since I have moved the image file of a domain to an NFS partition I get an error message at start time: # virsh start mydomain error: Failed to start domain mydomain error: unable to set security context '110:140' on '/storage/mydomain/vda.img': Invalid argument The /storage

Re: [libvirt] BUG: attaching - detaching network device only works 7 times

2010-04-15 Thread Daniel P. Berrange
On Wed, Apr 14, 2010 at 08:16:22PM -0400, Stefan Berger wrote: With the current tip: While extending a test case I found that attaching and detaching the following network device works only 7 times with the below script: interface type='bridge' source bridge='static'/ mac

[libvirt] [PATCH] Add testing for CDROM media change / eject

2010-04-15 Thread Daniel P. Berrange
This tests the 3 main operations in removeable media - Eject existing media - Insert new media - Change existing media (eject followed by insert) * lib/Sys/Virt/TCK.pm: Allow a specific ostype to be requested when getting a guest config * scripts/domain/207-disk-media-change.t: Test media

[libvirt] [PATCH 2/4] Rename parameter in qemuMonitorDeviceDel

2010-04-15 Thread Daniel P. Berrange
The parameter for the qemuMonitorDeviceDel() is a device alias, not a device config string. Rename the parameter reflect this and avoid confusion to readers. * src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h, src/qemu/qemu_monitor_json.c, src/qemu/qemu_monitor_json.h,

[libvirt] [PATCH 0/4] Misc fixes + enhancements to the QEMU JSON mode monitor

2010-04-15 Thread Daniel P. Berrange
This series is the latest update to the JSON mode monitor code, based on current QEMU state of development. This work is still ongoing, at the very least QEMU is still lacking support for device_del, drive_add netdev_add and delvm/loadvm/savedvm commands that libvirt needs. -- libvir-list mailing

[libvirt] [PATCH 4/4] Fix CDROM media change for QEMU when using -device syntax

2010-04-15 Thread Daniel P. Berrange
Disk devices in QEMU have two parts, the guest device and the host backend driver. Historically these two parts have had the same unique name. With the switch to using -device though, they now have separate names. Thus when changing CDROM media, for guests using -device syntax, we need to prepend

[libvirt] [PATCH 1/4] Remove code from JSON monitor for commands that won't be ported

2010-04-15 Thread Daniel P. Berrange
The QEMU developers have stated that they will not be porting the commands 'pci_add', 'pci_del', 'usb_add', 'usb_del' to the JSON mode monitor, since they're obsoleted by 'device_add' and 'device_del'. libvirt has (untested) code that would have supported those commands in theory, but since we

[libvirt] [PATCH 3/4] Update QEMU device_add command in JSON mode

2010-04-15 Thread Daniel P. Berrange
The device_add command was added in JSON mode in a way I didn't expect. Instead of passing the normal device string to the JSON command: { execute: device_add, arguments: { device: ne2k_pci,id=nic.1,netdev=net.1 } } We need to split up the device string into a full JSON object {

Re: [libvirt] unable to set security context (NFSv4 problem?)

2010-04-15 Thread Harald Dunkel
PS #1: same problem with libvirt 0.8.0 PS #2: there is no Kerberos installed on NFS client or server Regards Harri -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list

[libvirt] [PATCH] Don't ship generated python/libvirt.? files.

2010-04-15 Thread Philipp Hahn
libvirt.c and libvirt.h are auto-generated files. Mentioning their names in *_SOURCES includes them in the distribution. During an out-of-tree build these shipped files are included instead of the auto-generated version, potentially breaking the build (as it happend in 0.8.0, because the shipped

Re: [libvirt] BUG: attaching - detaching network device only works 7 times

2010-04-15 Thread Stefan Berger
Daniel P. Berrange berra...@redhat.com wrote on 04/15/2010 05:22:22 AM: Please respond to Daniel P. Berrange On Wed, Apr 14, 2010 at 08:16:22PM -0400, Stefan Berger wrote: With the current tip: While extending a test case I found that attaching and detaching the following network

Re: [libvirt] BUG: attaching - detaching network device only works 7 times

2010-04-15 Thread Daniel P. Berrange
On Thu, Apr 15, 2010 at 07:34:54AM -0400, Stefan Berger wrote: Daniel P. Berrange berra...@redhat.com wrote on 04/15/2010 05:22:22 AM: Please respond to Daniel P. Berrange On Wed, Apr 14, 2010 at 08:16:22PM -0400, Stefan Berger wrote: With the current tip: While extending a

[libvirt] [RFC] libvirt-TCK scripts to verify spoofing prevention

2010-04-15 Thread Gerhard Stenzel
The following patch mainly adds a set of test case to verify that several spoofing attacks are prevented by the nwfilter subsystem. In order to have a well defined test machine, the patch also includes test scripts to network install a virtual disk from scratch, to boot the virtual test machine

Re: [libvirt] [PATCH 3/7] nwfilter_ebiptables_driver.c: avoid NULL dereference

2010-04-15 Thread Stefan Berger
Jim Meyering j...@meyering.net wrote on 04/15/2010 01:36:21 AM: Daniel P. Berrange, libvir-list Stefan Berger wrote: libvir-list-boun...@redhat.com wrote on 04/14/2010 01:40:17 PM: Please respond to Daniel P. Berrange On Wed, Apr 14, 2010 at 06:02:32PM +0200, Jim Meyering wrote:

Re: [libvirt] [PATCH 3/7] nwfilter_ebiptables_driver.c: avoid NULL dereference

2010-04-15 Thread Jim Meyering
Stefan Berger wrote: If it's not 0, then you must have one of these two envvars set: test -n $CCC_ANALYZER_ANALYSIS$COVERITY_BUILD_COMMAND echo oops got 'oops' here. That is surprising (esp. since your definition of STATIC_ANALYSIS was 0). You get that on the command line? Which of those

Re: [libvirt] [PATCH] nwfilter: fix tear down order and consolidate functions

2010-04-15 Thread Eric Blake
On 04/14/2010 03:10 PM, Stefan Berger wrote: To avoid race-conditions, the tear down of a filter has to happen before the tap interface disappears and another tap interface with the same name can re-appear. This patch tries to fix this. In one place, where communication with the qemu monitor

Re: [libvirt] [RFC] libvirt-TCK scripts to verify spoofing prevention

2010-04-15 Thread Daniel P. Berrange
On Thu, Apr 15, 2010 at 02:35:41PM +0200, Gerhard Stenzel wrote: The following patch mainly adds a set of test case to verify that several spoofing attacks are prevented by the nwfilter subsystem. In order to have a well defined test machine, the patch also includes test scripts to network

Re: [libvirt] [PATCH] esx: Add nwfilter driver stub

2010-04-15 Thread Eric Blake
On 04/14/2010 06:31 PM, Matthias Bolte wrote: +static virDrvOpenStatus +esxNWFilterOpen(virConnectPtr conn, +virConnectAuthPtr auth ATTRIBUTE_UNUSED, +int flags ATTRIBUTE_UNUSED) +{ If Jirka's patch for virCheckFlags goes in first, you need to tweak this line.

Re: [libvirt] [PATCH v2 1/2] Introduce virCheckFlags for consistent flags checking

2010-04-15 Thread Eric Blake
On 04/13/2010 10:25 AM, Jiri Denemark wrote: The idea is that every API implementation in driver which has flags parameter should first call virCheckFlags() macro to check the function was called with supported flags: virCheckFlags(VIR_SUPPORTED_FLAG_1 |

Re: [libvirt] [PATCH v2 2/2] Use virCheckFlags for APIs added in 0.8.0

2010-04-15 Thread Eric Blake
On 04/13/2010 10:25 AM, Jiri Denemark wrote: --- src/esx/esx_driver.c | 43 - src/nwfilter/nwfilter_driver.c |4 ++- src/qemu/qemu_driver.c | 68 +++- src/storage/storage_driver.c |6 +---

Re: [libvirt] [PATCH 3/7] nwfilter_ebiptables_driver.c: avoid NULL dereference

2010-04-15 Thread Stefan Berger
Jim Meyering j...@meyering.net wrote on 04/15/2010 09:47:53 AM: Daniel P. Berrange, libvir-list Stefan Berger wrote: If it's not 0, then you must have one of these two envvars set: test -n $CCC_ANALYZER_ANALYSIS$COVERITY_BUILD_COMMAND echo oops got 'oops' here. That is

Re: [libvirt] [PATCH v2 2/2] Use virCheckFlags for APIs added in 0.8.0

2010-04-15 Thread Daniel Veillard
On Thu, Apr 15, 2010 at 08:41:07AM -0600, Eric Blake wrote: On 04/13/2010 10:25 AM, Jiri Denemark wrote: --- src/esx/esx_driver.c | 43 - src/nwfilter/nwfilter_driver.c |4 ++- src/qemu/qemu_driver.c | 68

Re: [libvirt] [PATCH] Update to latest gnulib to get strtok_r relaxed to LGPLv2+

2010-04-15 Thread Eric Blake
On 04/14/2010 06:32 PM, Matthias Bolte wrote: strtok_r will be used in the ESX driver to replace scanf-based code. MinGW lacks strtok_r, so we need gnulib to provide it, but until now strtok_r was licensed LGPL3. --- .gnulib |2 +- 1 files changed, 1 insertions(+), 1 deletions(-)

Re: [libvirt] [PATCH 1/7] sa_assert: new assert-like macro, enabled only for use with static analyzers

2010-04-15 Thread Daniel Veillard
On Wed, Apr 14, 2010 at 06:02:30PM +0200, Jim Meyering wrote: From: Jim Meyering meyer...@redhat.com Among some here, there is a strong aversion to use of assert, yet some others think it is essential (when applied judiciously) even -- perhaps especially -- at the heart of libraries and core

Re: [libvirt] [PATCH 2/7] build: set STATIC_ANALYSIS when running via clang or coverity

2010-04-15 Thread Daniel Veillard
On Wed, Apr 14, 2010 at 06:02:31PM +0200, Jim Meyering wrote: From: Jim Meyering meyer...@redhat.com * configure.ac (STATIC_ANALYSIS): Define when run via clang's scan-build or coverity-prevent's cov-build. Use the CLANG_CC and COVERITY_BUILD_COMMAND envvars as witnesses. --- configure.ac

Re: [libvirt] [PATCH] nwfilter: fix tear down order and consolidate functions

2010-04-15 Thread Daniel Veillard
On Thu, Apr 15, 2010 at 08:27:07AM -0600, Eric Blake wrote: On 04/14/2010 03:10 PM, Stefan Berger wrote: To avoid race-conditions, the tear down of a filter has to happen before the tap interface disappears and another tap interface with the same name can re-appear. This patch tries to fix

Re: [libvirt] [PATCH] Fix apibuild.py warnings about missing ':'

2010-04-15 Thread Daniel Veillard
On Thu, Apr 15, 2010 at 01:44:24AM +0200, Matthias Bolte wrote: --- I just pushed this trivial fix. src/libvirt.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libvirt.c b/src/libvirt.c index d1b7880..ff36681 100644 --- a/src/libvirt.c +++

[libvirt] Build failure on Ubuntu 9.10

2010-04-15 Thread Chris Lalancette
Hey Jamie, I've starting doing some automated builds of libvirt, and I've run into this build failure on Ubuntu 9.10 (both for i386 and x86_64): Git head revision: cffe619bdf9943282cc9f6a0cf815ad9f0fe7fd7 make all-recursive make[1]: Entering directory `/root/libvirt' Making all in

Re: [libvirt] Build failure on Ubuntu 9.10

2010-04-15 Thread Matthias Bolte
2010/4/15 Chris Lalancette clala...@redhat.com: Hey Jamie,     I've starting doing some automated builds of libvirt, and I've run into this build failure on Ubuntu 9.10 (both for i386 and x86_64): Git head revision: cffe619bdf9943282cc9f6a0cf815ad9f0fe7fd7 make  all-recursive make[1]:

Re: [libvirt] [PATCH] esx: Replace scanf with STRSKIP and strtok_r

2010-04-15 Thread Eric Blake
On 04/14/2010 06:34 PM, Matthias Bolte wrote: This also fixes a portability problem with the %a format modifier. %a is not portable and made esxDomainDumpXML fail at runtime in MinGW builds. Pull in strtok_r from gnulib, because MinGW lacks it. --- bootstrap.conf |1 + See my

Re: [libvirt] [PATCH 1/4] Remove code from JSON monitor for commands that won't be ported

2010-04-15 Thread Daniel Veillard
On Thu, Apr 15, 2010 at 11:43:08AM +0100, Daniel P. Berrange wrote: The QEMU developers have stated that they will not be porting the commands 'pci_add', 'pci_del', 'usb_add', 'usb_del' to the JSON mode monitor, since they're obsoleted by 'device_add' and 'device_del'. libvirt has (untested)

Re: [libvirt] [PATCH 2/4] Rename parameter in qemuMonitorDeviceDel

2010-04-15 Thread Daniel Veillard
On Thu, Apr 15, 2010 at 11:43:09AM +0100, Daniel P. Berrange wrote: The parameter for the qemuMonitorDeviceDel() is a device alias, not a device config string. Rename the parameter reflect this and avoid confusion to readers. * src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h,

[libvirt] [PATCHv2 2/2] remote: react to failures on wakeupFD

2010-04-15 Thread Eric Blake
discussion: https://www.redhat.com/archives/libvir-list/2010-March/msg00443.html * src/remote/remote_driver.c (remoteIO, remoteIOEventLoop): Report failures on pipe used for wakeup. Reported by Chris Lalancette. --- -ignore_value(saferead(priv-wakeupReadFD, ignore, -

Re: [libvirt] [PATCH 3/4] Update QEMU device_add command in JSON mode

2010-04-15 Thread Daniel Veillard
On Thu, Apr 15, 2010 at 11:43:10AM +0100, Daniel P. Berrange wrote: The device_add command was added in JSON mode in a way I didn't expect. Instead of passing the normal device string to the JSON command: { execute: device_add, arguments: { device: ne2k_pci,id=nic.1,netdev=net.1 } }

Re: [libvirt] why we should use a mechanical indentation checker

2010-04-15 Thread Eric Blake
On 04/15/2010 02:16 AM, Jim Meyering wrote: I introduced a bug with this supposedly-safe, no-semantic-change delta: http://libvirt.org/git/?p=libvirt.git;a=commitdiff;h=b6719eab9e95c5daeeea85 See if you can spot it. I am adding something like the following to coreutils' HACKING,

Re: [libvirt] [PATCH 4/4] Fix CDROM media change for QEMU when using -device syntax

2010-04-15 Thread Daniel Veillard
On Thu, Apr 15, 2010 at 11:43:11AM +0100, Daniel P. Berrange wrote: Disk devices in QEMU have two parts, the guest device and the host backend driver. Historically these two parts have had the same unique name. With the switch to using -device though, they now have separate names. Thus when

Re: [libvirt] BUG: attaching - detaching network device only works 7 times

2010-04-15 Thread Stefan Berger
Daniel P. Berrange berra...@redhat.com wrote on 04/15/2010 07:50:51 AM: Even if that wasn't broken though, I don't see how NIC hotplug would work in your scenario. That error message about Too Many NICs is becuase the 'nd_table' in QEMU's net.c has all fields set 'used = 1'. I don't see

Re: [libvirt] BUG: attaching - detaching network device only works 7 times

2010-04-15 Thread Daniel P. Berrange
On Thu, Apr 15, 2010 at 12:19:48PM -0400, Stefan Berger wrote: Daniel P. Berrange berra...@redhat.com wrote on 04/15/2010 07:50:51 AM: Even if that wasn't broken though, I don't see how NIC hotplug would work in your scenario. That error message about Too Many NICs is becuase

Re: [libvirt] BUG: attaching - detaching network device only works 7 times

2010-04-15 Thread Daniel P. Berrange
On Wed, Apr 14, 2010 at 08:16:22PM -0400, Stefan Berger wrote: With the current tip: While extending a test case I found that attaching and detaching the following network device works only 7 times with the below script: interface type='bridge' source bridge='static'/ mac

Re: [libvirt] BUG: attaching - detaching network device only works 7 times

2010-04-15 Thread Stefan Berger
Daniel P. Berrange berra...@redhat.com wrote on 04/15/2010 12:48:59 PM: Please respond to Daniel P. Berrange On Thu, Apr 15, 2010 at 12:19:48PM -0400, Stefan Berger wrote: Daniel P. Berrange berra...@redhat.com wrote on 04/15/2010 07:50:51 AM: Even if that wasn't

Re: [libvirt] BUG: attaching - detaching network device only works 7 times

2010-04-15 Thread Daniel P. Berrange
On Thu, Apr 15, 2010 at 01:00:08PM -0400, Stefan Berger wrote: Daniel P. Berrange berra...@redhat.com wrote on 04/15/2010 12:48:59 PM: Please respond to Daniel P. Berrange On Thu, Apr 15, 2010 at 12:19:48PM -0400, Stefan Berger wrote: Daniel P. Berrange berra...@redhat.com wrote on

[libvirt] [TCK PATCH] maint: remove duplicate file

2010-04-15 Thread Eric Blake
File is a duplicate of 14f3792:lib/Sys/Virt/TCK.pm. Besides, it is already exluded by MANIFEST.SKIP. * lib/Sys/Virt/TCK.pm.orig: Delete. * .gitignore: Sort. Add *.orig. --- .gitignore | 25 +- lib/Sys/Virt/TCK.pm.orig | 766 -- 2

Re: [libvirt] [TCK PATCH] maint: remove duplicate file

2010-04-15 Thread Jim Meyering
Eric Blake wrote: File is a duplicate of 14f3792:lib/Sys/Virt/TCK.pm. Besides, it is already exluded by MANIFEST.SKIP. * lib/Sys/Virt/TCK.pm.orig: Delete. ACK. obviously committed unintentionally. * .gitignore: Sort. Add *.orig. Personally, I don't list names like that in .gitignore

Re: [libvirt] [PATCHv2 2/2] remote: react to failures on wakeupFD

2010-04-15 Thread Jim Meyering
Eric Blake wrote: discussion: https://www.redhat.com/archives/libvir-list/2010-March/msg00443.html * src/remote/remote_driver.c (remoteIO, remoteIOEventLoop): Report failures on pipe used for wakeup. Reported by Chris Lalancette. --- -ignore_value(saferead(priv-wakeupReadFD,

Re: [libvirt] [TCK PATCH] maint: remove duplicate file

2010-04-15 Thread Eric Blake
On 04/15/2010 11:22 AM, Jim Meyering wrote: Eric Blake wrote: File is a duplicate of 14f3792:lib/Sys/Virt/TCK.pm. Besides, it is already exluded by MANIFEST.SKIP. * lib/Sys/Virt/TCK.pm.orig: Delete. ACK. obviously committed unintentionally. * .gitignore: Sort. Add *.orig.

[libvirt] [PATCH] maint: another preprocessor fix

2010-04-15 Thread Eric Blake
Regression introduced in commit 62170b995. * src/util/memory.h: Placate cppi, and fit 80 columns. --- Pushing this as obvious, for 'make syntax-check'. src/util/memory.h |6 -- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/util/memory.h b/src/util/memory.h index

Re: [libvirt] [PATCHv2 2/2] remote: react to failures on wakeupFD

2010-04-15 Thread Eric Blake
On 04/15/2010 11:25 AM, Jim Meyering wrote: This looks fine, but errno ? errno : 0 is equivalent to just errno. Which makes me think you'll want to separate the saferead-fails case (where errno is nonzero) from the saferead-returns-non-negative-=-sizeof-ignore case (in which case

[libvirt] [TCK PATCH] maint: add copyright notices

2010-04-15 Thread Eric Blake
The only non-trivial file (15 lines, and not a simple listing of other file names) that remains without a copyright notice is the README. * Build.PL: Add copyright. * docs/intro.pod: Likewise. * lib/Sys/Virt/TCK.pm: Likewise. * lib/Sys/Virt/TCK/Capabilities.pm: Likewise. *

Re: [libvirt] [PATCH] esx: Add nwfilter driver stub

2010-04-15 Thread Matthias Bolte
2010/4/15 Eric Blake ebl...@redhat.com: On 04/14/2010 06:31 PM, Matthias Bolte wrote: +static virDrvOpenStatus +esxNWFilterOpen(virConnectPtr conn, +                virConnectAuthPtr auth ATTRIBUTE_UNUSED, +                int flags ATTRIBUTE_UNUSED) +{ If Jirka's patch for virCheckFlags

Re: [libvirt] [PATCH] Update to latest gnulib to get strtok_r relaxed to LGPLv2+

2010-04-15 Thread Matthias Bolte
2010/4/15 Eric Blake ebl...@redhat.com: On 04/14/2010 06:32 PM, Matthias Bolte wrote: strtok_r will be used in the ESX driver to replace scanf-based code. MinGW lacks strtok_r, so we need gnulib to provide it, but until now strtok_r was licensed LGPL3. ---  .gnulib |    2 +-  1 files

Re: [libvirt] [PATCH] esx: Replace scanf with STRSKIP and strtok_r

2010-04-15 Thread Matthias Bolte
2010/4/15 Eric Blake ebl...@redhat.com: On 04/14/2010 06:34 PM, Matthias Bolte wrote: This also fixes a portability problem with the %a format modifier. %a is not portable and made esxDomainDumpXML fail at runtime in MinGW builds. Pull in strtok_r from gnulib, because MinGW lacks it. ---  

Re: [libvirt] [TCK PATCH] maint: add copyright notices

2010-04-15 Thread Jim Meyering
Eric Blake wrote: The only non-trivial file (15 lines, and not a simple listing of other file names) that remains without a copyright notice is the README. * Build.PL: Add copyright. * docs/intro.pod: Likewise. * lib/Sys/Virt/TCK.pm: Likewise. * lib/Sys/Virt/TCK/Capabilities.pm: Likewise.

[libvirt] [TCK PATCH] default.cfg: fix typos

2010-04-15 Thread Eric Blake
* conf/default.cfg: Improve spelling. --- Pushing as obvious. conf/default.cfg |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/conf/default.cfg b/conf/default.cfg index 288540f..01f438c 100644 --- a/conf/default.cfg +++ b/conf/default.cfg @@ -13,12 +13,12 @@ #

[libvirt] Execute a command in a Guest Domain using libvirt.

2010-04-15 Thread Kumar L Srikanth-B22348
Hi, I created a Domain using libvirt virsh console. Can I execute a command [like 'ifconfig'] in Guest Domain and get the output using libvirt? Please let me know other ways to do that. Regards, Srikanth. -- libvir-list mailing list libvir-list@redhat.com