[libvirt] clang vs. libvirt

2010-04-14 Thread Jim Meyering
I've been running the clang static analyzer against libvirt regularly, but it's usually been that of F12 or F13. Yesterday I used rawhide's version of clang: scan-build -o clang ./autogen.sh --enable-compile-warnings=error scan-build -o clang make -j6 and it spotted a few new problems.

[libvirt] [PATCH 1/5] vshCommandRun: avoid used-uninitialized timing-related report from clang

2010-04-14 Thread Jim Meyering
From: Jim Meyering meyer...@redhat.com * tools/virsh.c (vshCommandRun): Test only the initial value of ctl-timing, so that static analyzers don't have to consider that it might be changed by cmd-def-handler. --- tools/virsh.c |7 --- 1 files changed, 4 insertions(+), 3 deletions(-) diff

[libvirt] [PATCH 4/5] virStorageBackendFileSystemMount: prefer strdup over virAsprintf

2010-04-14 Thread Jim Meyering
From: Jim Meyering meyer...@redhat.com * src/storage/storage_backend_fs.c (virStorageBackendFileSystemMount): Use virAsprintf only when needed. In this case, strdup works fine. --- src/storage/storage_backend_fs.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git

[libvirt] [PATCH 2/5] openvzGetProcessInfo: address clang-detected low-probability flaw

2010-04-14 Thread Jim Meyering
From: Jim Meyering meyer...@redhat.com * src/openvz/openvz_driver.c (openvzGetProcessInfo): Reorganize so that unexpected /proc/vz/vestat content cannot make us use uninitialized variables. Without this change, an input line with a matching readvps, but fewer than 4 numbers would result in our

[libvirt] [PATCH 3/5] virStorageBackendFileSystemMount: placate clang

2010-04-14 Thread Jim Meyering
From: Jim Meyering meyer...@redhat.com * src/storage/storage_backend_fs.c (virStorageBackendFileSystemMount): Clang was not smart enough, and mistakenly reported that options could be used uninitialized. Initialize it. --- src/storage/storage_backend_fs.c |2 +- 1 files changed, 1

[libvirt] [PATCH 5/5] esxVMX_GatherSCSIControllers: avoid NULL dereference

2010-04-14 Thread Jim Meyering
From: Jim Meyering meyer...@redhat.com * src/esx/esx_vmx.c (esxVMX_GatherSCSIControllers): Do not dereference a NULL disk-driverName. We already detect this condition in another case. Check for it here, too. --- src/esx/esx_vmx.c |5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-)

Re: [libvirt] [PATCH] esx: Extend esx_vi_generator.py to cover methods too

2010-04-14 Thread Daniel Veillard
On Tue, Apr 13, 2010 at 05:33:02PM +0200, Matthias Bolte wrote: Generate almost all SOAP method mapping code. Update the driver code to use the complete paramater list of some methods that had parameters skipped before. Improve the ESX_VI__METHOD marco to do automatic output

Re: [libvirt] hellolibvirt: no hypervisor driver available for xen:///

2010-04-14 Thread Daniel P. Berrange
On Tue, Apr 13, 2010 at 11:37:01PM +0530, Ganesh Pagade wrote: Hi, I downloaded and built the latest libvirt source code 0.8. I installed the library in a custom directory libvirt-0.8.0-install/ keeping all other configurations default. After this I tried to execute the example

Re: [libvirt] [PATCH] Implement forgotten backend of virInterfaceIsActive()

2010-04-14 Thread Matthias Bolte
2010/4/13 Laine Stump la...@laine.org: Somehow the backend of this function was never implemented in libvirt's netcf driver, and nobody noticed until now. (The required netcf function was already in place, so nothing needs to change there.) ---  src/interface/netcf_driver.c |   31

Re: [libvirt] [PATCH] nwfilter: use virFindFileInPath for needed CLI tools

2010-04-14 Thread Daniel Veillard
On Tue, Apr 13, 2010 at 12:40:17PM -0400, Stefan Berger wrote: I am getting rid of determining the path to necessary CLI tools at compile time. Instead, now the firewall driver has an initialization function that uses virFindFileInPath() to determine the path to necessary CLI tools and a

Re: [libvirt] [PATCH 5/5] esxVMX_GatherSCSIControllers: avoid NULL dereference

2010-04-14 Thread Matthias Bolte
2010/4/14 Jim Meyering j...@meyering.net: From: Jim Meyering meyer...@redhat.com * src/esx/esx_vmx.c (esxVMX_GatherSCSIControllers): Do not dereference a NULL disk-driverName.  We already detect this condition in another case.  Check for it here, too. ---  src/esx/esx_vmx.c |    5 +++--  1

Re: [libvirt] [PATCH] 4/10 AppArmor driver updates

2010-04-14 Thread Daniel P. Berrange
On Mon, Apr 05, 2010 at 04:21:16PM -0500, Jamie Strandboge wrote: On Mon, 2010-04-05 at 16:15 -0500, Jamie Strandboge wrote: 4_qemu_driver_stdin_path.patch: adjust args to qemudStartVMDaemon() to also specify path to stdin_fd, so this can be passed to the AppArmor driver via

Re: [libvirt] [PATCH] 0/10AppArmor driver updates

2010-04-14 Thread Daniel P. Berrange
On Tue, Apr 13, 2010 at 10:30:22AM -0500, Jamie Strandboge wrote: Top posting since this is only a reminder... I was wondering if this could be re-reviewed now that 0.8 is out. Sorry for not doing this before - I saw DV had pushed the patches previously, but didn't realize he left out 2 for

Re: [libvirt] [PATCH] 5/10 AppArmor driver updates

2010-04-14 Thread Daniel P. Berrange
On Mon, Apr 05, 2010 at 04:21:46PM -0500, Jamie Strandboge wrote: On Mon, 2010-04-05 at 16:15 -0500, Jamie Strandboge wrote: 5_apparmor-fix-save-restore.patch: refactoring to update AppArmor security driver to adjust profile for save/restore[3] ACK Daniel -- |: Red Hat, Engineering,

Re: [libvirt] [PATCH 5/5] esxVMX_GatherSCSIControllers: avoid NULL dereference

2010-04-14 Thread Jim Meyering
Matthias Bolte wrote: 2010/4/14 Jim Meyering j...@meyering.net: From: Jim Meyering meyer...@redhat.com * src/esx/esx_vmx.c (esxVMX_GatherSCSIControllers): Do not dereference a NULL disk-driverName.  We already detect this condition in another case.  Check for it here, too. ---  

Re: [libvirt] [PATCH] esx: Extend esx_vi_generator.py to cover methods too

2010-04-14 Thread Matthias Bolte
2010/4/14 Daniel Veillard veill...@redhat.com: On Tue, Apr 13, 2010 at 05:33:02PM +0200, Matthias Bolte wrote: Generate almost all SOAP method mapping code. Update the driver code to use the complete paramater list of some methods that had parameters skipped before. Improve the

Re: [libvirt] [PATCH] Implement forgotten backend of virInterfaceIsActive()

2010-04-14 Thread Daniel P. Berrange
On Tue, Apr 13, 2010 at 01:26:00PM -0400, Laine Stump wrote: Somehow the backend of this function was never implemented in libvirt's netcf driver, and nobody noticed until now. (The required netcf function was already in place, so nothing needs to change there.) ---

Re: [libvirt] php bindings

2010-04-14 Thread Daniel P. Berrange
On Tue, Apr 06, 2010 at 09:21:46AM -0400, David W King wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 I know this topic has come up multiple times in the past and every time it does people keep commenting on how it would be a good thing to do but they just don't have the time. So my

Re: [libvirt] [RFC] maint: forbid most files without extension

2010-04-14 Thread Daniel P. Berrange
On Tue, Apr 13, 2010 at 02:11:55PM -0600, Eric Blake wrote: * .gitignore: Add rule that requires . in name, then add exemptions. --- Given Chris' recent accident in committing a binary file, then blasting the list with it, here's a (hack) approach to prevent a relapse in the future. It

[libvirt] [PATCH] Fix off-by-one check in QEMU memory stats

2010-04-14 Thread Daniel P. Berrange
The QEMU memory stats JSON monitor command was too cautious in checking array bounds, dropping the last requested stat * src/qemu/qemu_monitor_json.c: Fix off-by-1 check in memory stats --- src/qemu/qemu_monitor_json.c | 12 ++-- 1 files changed, 6 insertions(+), 6 deletions(-) diff

[libvirt] [PATCH 01/10] Add a QXL graphics card type to domain XML schema

2010-04-14 Thread Daniel P. Berrange
* src/qemu_conf.c: Add dummy entry in enumeration * docs/schemas/domain.rng: Add 'qxl' as a type for the video tag * src/domain_conf.c, src/domain_conf.h: Add QXL to video type enumerations --- docs/schemas/domain.rng |1 + src/conf/domain_conf.c |3 ++- src/conf/domain_conf.h |1

[libvirt] [PATCH 00/10] Add support for SPICE graphics in QEMU

2010-04-14 Thread Daniel P. Berrange
Gerd today posted patches to upstream QEMU which support SPICE graphics. They have not been accepted / merged yet, but I'm optimistic that the command line syntax will not change significantly. http://lists.gnu.org/archive/html/qemu-devel/2010-04/msg00967.html This patch series adds

[libvirt] [PATCH 04/10] Implement QEMU/KVM QXL video card support in QEMU driver

2010-04-14 Thread Daniel P. Berrange
This supports the '-vga qxl' parameter in upstream QEMU/KVM which has SPICE support added. This isn't particularly useful until you get the next patch for -spice support. Also note that while the libvirt XML supports multiple video devices, this patch only supports a single one. A later patch can

[libvirt] [PATCH 07/10] Add SPICE support for QEMU driver configuration file

2010-04-14 Thread Daniel P. Berrange
In common with VNC, the QEMU driver configuration file is used specify the host level TLS certificate location and a default password / listen address * src/qemu/qemu.conf: Add spice_listen, spice_tls, spice_tls_x509_cert_dir spice_password config params * src/qemu/qemu_conf.c,

[libvirt] [PATCH] Run test suite as part of RPM build process

2010-04-14 Thread Daniel P. Berrange
To ensure that patches in the RPM don't break any functionality it is neccessary to run the test suites during build. It currently has 3 tests disabled - daemon-conf: this is totally broken, since it relies on being able to resolve the 'libvirt' group being able to resolve hostnames at

[libvirt] [PATCH 03/10] Fix QEMU command building errors to reflect unsupported configuration

2010-04-14 Thread Daniel P. Berrange
Instead of reporting VIR_ERR_INTERNAL_ERROR use the more specific VIR_ERR_CONFIG_UNSUPPORTED * src/qemu/qemu_conf.c: Report VIR_ERR_CONFIG_UNSUPPORTED for unsupported video adapters --- src/qemu/qemu_conf.c |6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git

[libvirt] [PATCH 02/10] Add a graphics type for SPICE protocol

2010-04-14 Thread Daniel P. Berrange
This adds an element graphics type='spice' port='5903' tlsPort='5904' autoport='yes' listen='127.0.0.1'/ This is the bare minimum that should be exposed in the guest config for SPICE. Other parameters are better handled as per host level configuration tunables * docs/schemas/domain.rng:

[libvirt] [PATCH 05/10] Implement QEMU/KVM support for SPICE graphics

2010-04-14 Thread Daniel P. Berrange
This supports the -spice argument posted for review against the latest upstream QEMU/KVM. This supports the bare minimum config with port, TLS port listen address. The x509 bits are added in a later patch. * src/qemu_conf.c, src/qemu_conf.h: Add SPICE flag. Check for -spice availability.

[libvirt] [PATCH 08/10] Define XML syntax for password expiry

2010-04-14 Thread Daniel P. Berrange
This extends the XML syntax for graphics to allow a password expiry time to be set eg graphics type='vnc' port='5900' autoport='yes' keymap='en-us' passwd='12345' passwdValidTo='2010-04-09T15:51:00'/ The timestamp is in UTC. * src/conf/domain_conf.h: Pull passwd out into separate struct

[libvirt] [PATCH 06/10] Support automatic port number allocation for SPICE

2010-04-14 Thread Daniel P. Berrange
* src/qemu/qemu_driver.c: Allocate the TCP ports for SPICE before starting guest --- src/qemu/qemu_driver.c | 36 1 files changed, 24 insertions(+), 12 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index df1d435..2aa39c1 100644

[libvirt] [PATCH 09/10] Support multiple QXL video cards

2010-04-14 Thread Daniel P. Berrange
QEMU crashes burns if you try multiple Cirrus video cards, but QXL copes fine. Adapt QEMU config code to allow multiple QXL video cards * src/qemu/qemu_conf.c: Support multiple QXL video cards --- src/qemu/qemu_conf.c | 64 +--

Re: [libvirt] [PATCH] Fix off-by-one check in QEMU memory stats

2010-04-14 Thread Daniel P. Berrange
On Wed, Apr 14, 2010 at 11:22:05AM +0100, Daniel P. Berrange wrote: The QEMU memory stats JSON monitor command was too cautious in checking array bounds, dropping the last requested stat * src/qemu/qemu_monitor_json.c: Fix off-by-1 check in memory stats --- src/qemu/qemu_monitor_json.c

[libvirt] [PATCH 10/10] Support SPICE channel security options

2010-04-14 Thread Daniel P. Berrange
This extends the SPICE XML to allow channel security options graphics type='spice' port='5901' tlsPort='-1' autoport='yes' channel name='main' mode='secure'/ channel name='record' mode='insecure'/ /graphics Any non-specified channel uses the default, which allows both secure

[libvirt] [PATCH] schematestutils.sh: improve shell portability: avoid echo -e

2010-04-14 Thread Jim Meyering
echo -e is not portable. This is the sole remaining use in all of libvirt. From a58cf340b5ebbca2157f43c6f23d4d6f56b848c7 Mon Sep 17 00:00:00 2001 From: Jim Meyering meyer...@redhat.com Date: Wed, 14 Apr 2010 13:25:46 +0200 Subject: [PATCH] schematestutils.sh: improve shell portability: avoid echo

Re: [libvirt] [PATCH] Run test suite as part of RPM build process

2010-04-14 Thread Jim Meyering
Daniel P. Berrange wrote: To ensure that patches in the RPM don't break any functionality it is neccessary to run the test suites during build. It currently has 3 tests disabled - daemon-conf: this is totally broken, since it relies on being able to resolve the 'libvirt' group being

Re: [libvirt] [PATCH] schematestutils.sh: improve shell portability: avoid echo -e

2010-04-14 Thread Daniel Veillard
On Wed, Apr 14, 2010 at 01:28:54PM +0200, Jim Meyering wrote: echo -e is not portable. This is the sole remaining use in all of libvirt. From a58cf340b5ebbca2157f43c6f23d4d6f56b848c7 Mon Sep 17 00:00:00 2001 From: Jim Meyering meyer...@redhat.com Date: Wed, 14 Apr 2010 13:25:46 +0200

Re: [libvirt] [PATCH] schematestutils.sh: improve shell portability: avoid echo -e

2010-04-14 Thread Jim Meyering
Daniel Veillard wrote: On Wed, Apr 14, 2010 at 01:28:54PM +0200, Jim Meyering wrote: echo -e is not portable. This is the sole remaining use in all of libvirt. From a58cf340b5ebbca2157f43c6f23d4d6f56b848c7 Mon Sep 17 00:00:00 2001 From: Jim Meyering meyer...@redhat.com Date: Wed, 14 Apr

Re: [libvirt] [RFC] maint: forbid most files without extension

2010-04-14 Thread Chris Lalancette
On 04/14/2010 06:18 AM, Daniel P. Berrange wrote: Chris' patch was actually blocked by mailman, but someone else approved it before I could reject it ! Yeah, sorry about that. I know better, I'll be more careful in the future. -- Chris Lalancette -- libvir-list mailing list

Re: [libvirt] hellolibvirt: no hypervisor driver available for xen:///

2010-04-14 Thread Ganesh Pagade
Thanks Daniel. After installing xen-devel and rebuilding libvirt, the sample program worked. -Ganesh On Wed, Apr 14, 2010 at 2:48 PM, Daniel P. Berrange berra...@redhat.comwrote: On Tue, Apr 13, 2010 at 11:37:01PM +0530, Ganesh Pagade wrote: Hi, I downloaded and built the latest libvirt

[libvirt] [PATCH] Fixup python binding for virDomainSnapshot APIs

2010-04-14 Thread Daniel P. Berrange
The generator code was totally wrong for the virDomainSnapshot APIs, not generating the wrapper class, and giving methods the wrong names * generator.py: Set metadata for virDomainSnapshot type APIs * libvirt-override-api.xml, libvirt-override.c: Hand-code the virDomainSnapshotListNames glue

Re: [libvirt] [PATCH 1/5] vshCommandRun: avoid used-uninitialized timing-related report from clang

2010-04-14 Thread Eric Blake
On 04/14/2010 02:46 AM, Jim Meyering wrote: From: Jim Meyering meyer...@redhat.com * tools/virsh.c (vshCommandRun): Test only the initial value of ctl-timing, so that static analyzers don't have to consider that it might be changed by cmd-def-handler. --- tools/virsh.c |7 --- 1

Re: [libvirt] [PATCH 2/5] openvzGetProcessInfo: address clang-detected low-probability flaw

2010-04-14 Thread Eric Blake
On 04/14/2010 02:46 AM, Jim Meyering wrote: From: Jim Meyering meyer...@redhat.com * src/openvz/openvz_driver.c (openvzGetProcessInfo): Reorganize so that unexpected /proc/vz/vestat content cannot make us use uninitialized variables. Without this change, an input line with a matching

Re: [libvirt] [PATCH 2/5] openvzGetProcessInfo: address clang-detected low-probability flaw

2010-04-14 Thread Jim Meyering
Eric Blake wrote: On 04/14/2010 02:46 AM, Jim Meyering wrote: From: Jim Meyering meyer...@redhat.com * src/openvz/openvz_driver.c (openvzGetProcessInfo): Reorganize so that unexpected /proc/vz/vestat content cannot make us use uninitialized variables. Without this change, an input line with

Re: [libvirt] [PATCH 3/5] virStorageBackendFileSystemMount: placate clang

2010-04-14 Thread Eric Blake
On 04/14/2010 02:46 AM, Jim Meyering wrote: From: Jim Meyering meyer...@redhat.com * src/storage/storage_backend_fs.c (virStorageBackendFileSystemMount): Clang was not smart enough, and mistakenly reported that options could be used uninitialized. Initialize it. I had to convince myself of

Re: [libvirt] [PATCH 4/5] virStorageBackendFileSystemMount: prefer strdup over virAsprintf

2010-04-14 Thread Eric Blake
On 04/14/2010 02:46 AM, Jim Meyering wrote: From: Jim Meyering meyer...@redhat.com * src/storage/storage_backend_fs.c (virStorageBackendFileSystemMount): Use virAsprintf only when needed. In this case, strdup works fine. --- src/storage/storage_backend_fs.c |2 +- 1 files changed, 1

Re: [libvirt] [PATCH] Fixup python binding for virDomainSnapshot APIs

2010-04-14 Thread Chris Lalancette
On 04/14/2010 10:03 AM, Daniel P. Berrange wrote: The generator code was totally wrong for the virDomainSnapshot APIs, not generating the wrapper class, and giving methods the wrong names * generator.py: Set metadata for virDomainSnapshot type APIs * libvirt-override-api.xml,

Re: [libvirt] [PATCH] schematestutils.sh: improve shell portability: avoid echo -e

2010-04-14 Thread Eric Blake
On 04/14/2010 05:28 AM, Jim Meyering wrote: echo -e is not portable. This is the sole remaining use in all of libvirt. ACK. How'd you find it? I know we've talked about adding a maint.mk check to help automate some of this (was it over on the bug-grep list?), but I still haven't thought of a

Re: [libvirt] [PATCH] Implement forgotten backend of virInterfaceIsActive()

2010-04-14 Thread Laine Stump
On 04/14/2010 06:12 AM, Daniel P. Berrange wrote: This causes it to return a success code in the event of either of the cleanup paths being taken. It needs to be a tri-state return value of -1 (error), 0 (inactive), 1 (active) Ah, yes. I see now that all the vir*Iswhatever() functions

Re: [libvirt] [PATCH 03/10] Fix QEMU command building errors to reflect unsupported configuration

2010-04-14 Thread Daniel Veillard
On Wed, Apr 14, 2010 at 11:33:21AM +0100, Daniel P. Berrange wrote: Instead of reporting VIR_ERR_INTERNAL_ERROR use the more specific VIR_ERR_CONFIG_UNSUPPORTED * src/qemu/qemu_conf.c: Report VIR_ERR_CONFIG_UNSUPPORTED for unsupported video adapters ACK on that one, not dependant on spice

Re: [libvirt] [PATCH 00/10] Add support for SPICE graphics in QEMU

2010-04-14 Thread Daniel Veillard
On Wed, Apr 14, 2010 at 11:33:18AM +0100, Daniel P. Berrange wrote: Gerd today posted patches to upstream QEMU which support SPICE graphics. They have not been accepted / merged yet, but I'm optimistic that the command line syntax will not change significantly.

Re: [libvirt] [PATCH 3/5] virStorageBackendFileSystemMount: placate clang

2010-04-14 Thread Jim Meyering
Eric Blake wrote: On 04/14/2010 02:46 AM, Jim Meyering wrote: From: Jim Meyering meyer...@redhat.com * src/storage/storage_backend_fs.c (virStorageBackendFileSystemMount): Clang was not smart enough, and mistakenly reported that options could be used uninitialized. Initialize it. I had to

Re: [libvirt] [PATCH] schematestutils.sh: improve shell portability: avoid echo -e

2010-04-14 Thread Jim Meyering
Eric Blake wrote: On 04/14/2010 05:28 AM, Jim Meyering wrote: echo -e is not portable. This is the sole remaining use in all of libvirt. ACK. Thanks. Pushed. How'd you find it? I know we've talked about adding a maint.mk check to I simply used git grep 'echo -e' Maybe that's good

[libvirt] [PATCH 1/2] libvirtd.init: improve portability

2010-04-14 Thread Eric Blake
This patch kills translation of the daemon messages, but being a daemon, the messages probably didn't need translation in the first place. Other alternatives would be to make the script require * daemon/libvirtd.init.in (start, stop, reload): Drop bash-ism of $. Use printf instead of echo -n.

[libvirt] [PATCH 2/2] virt-aa-helper-test: avoid non-portable echo -n

2010-04-14 Thread Eric Blake
* tests/virt-aa-helper-test (testme): Use printf instead. --- tests/virt-aa-helper-test |8 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/virt-aa-helper-test b/tests/virt-aa-helper-test index 3a2e74b..910c438 100755 --- a/tests/virt-aa-helper-test +++

[libvirt] [PATCH 7/7] qemudDomainAttachSCSIDisk: avoid FP NULL-ptr-deref from clang

2010-04-14 Thread Jim Meyering
From: Jim Meyering meyer...@redhat.com * src/util/conf.c (virConfParseValue): Add an sa_assert. --- src/util/conf.c |9 - 1 files changed, 8 insertions(+), 1 deletions(-) diff --git a/src/util/conf.c b/src/util/conf.c index ae0459e..38eb163 100644 --- a/src/util/conf.c +++

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

2010-04-14 Thread Jim Meyering
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 hypervisor- related code. Here is a compromise that lets us make

Re: [libvirt] [PATCH 1/2] libvirtd.init: improve portability

2010-04-14 Thread Daniel P. Berrange
On Wed, Apr 14, 2010 at 09:53:30AM -0600, Eric Blake wrote: This patch kills translation of the daemon messages, but being a daemon, the messages probably didn't need translation in the first place. Other alternatives would be to make the script require NACK, this current style, with

[libvirt] with these, clang vs. libvirt reports no errors

2010-04-14 Thread Jim Meyering
I've been running clang regularly, and there have been a few pesky false-positives that just won't go away. It's not productive to reexamine them each time, so I've wanted a way to educate clang without polluting the code with work-arounds that we'll be stuck maintaining and asking questions about

[libvirt] [PATCH 4/7] virGetHostnameLocalhost: avoid FP NULL-ptr-deref from clang

2010-04-14 Thread Jim Meyering
From: Jim Meyering meyer...@redhat.com * src/util/util.c (virGetHostnameLocalhost): Add an sa_assert to tell clang it's ok to dereference info after a non-failing getaddrinfo call. --- src/util/util.c |3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/src/util/util.c

[libvirt] [PATCH 5/7] qemudDomainAttachSCSIDisk: avoid FP NULL-ptr-deref from clang

2010-04-14 Thread Jim Meyering
From: Jim Meyering meyer...@redhat.com * src/qemu/qemu_driver.c (qemudDomainAttachSCSIDisk): Initialize cont to NULL, so clang knows it's set. Add an sa_assert so it knows it's non-NULL when dereferenced. --- src/qemu/qemu_driver.c |7 ++- 1 files changed, 6 insertions(+), 1 deletions(-)

[libvirt] [PATCH 6/7] xend_internal.c: assure clang that we do not dereference NULL

2010-04-14 Thread Jim Meyering
From: Jim Meyering meyer...@redhat.com * src/xen/xend_internal.c (xend_parse_sexp_desc_char): Add three uses of sa_assert, each preceding a strchr(value,... to assure clang that value is non-NULL. --- src/xen/xend_internal.c |3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff

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

2010-04-14 Thread Jim Meyering
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 |6 ++ 1 files changed, 6 insertions(+), 0 deletions(-)

Re: [libvirt] [PATCH 2/2] virt-aa-helper-test: avoid non-portable echo -n

2010-04-14 Thread Jim Meyering
Eric Blake wrote: * tests/virt-aa-helper-test (testme): Use printf instead. --- tests/virt-aa-helper-test |8 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/virt-aa-helper-test b/tests/virt-aa-helper-test index 3a2e74b..910c438 100755 ---

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

2010-04-14 Thread Eric Blake
On 04/14/2010 10:02 AM, 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 hypervisor-

Re: [libvirt] [PATCH 1/2] libvirtd.init: improve portability

2010-04-14 Thread Jim Meyering
Eric Blake wrote: This patch kills translation of the daemon messages, but being a daemon, the messages probably didn't need translation in the first place. Other alternatives would be to make the script require * daemon/libvirtd.init.in (start, stop, reload): Drop bash-ism of $. Use

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

2010-04-14 Thread Eric Blake
On 04/14/2010 10:02 AM, 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 |6 ++ 1

Re: [libvirt] [PATCH 1/2] libvirtd.init: improve portability

2010-04-14 Thread Eric Blake
On 04/14/2010 10:24 AM, Jim Meyering wrote: Eric Blake wrote: This patch kills translation of the daemon messages, but being a daemon, the messages probably didn't need translation in the first place. Other alternatives would be to make the script require * daemon/libvirtd.init.in (start,

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

2010-04-14 Thread Eric Blake
On 04/14/2010 10:02 AM, Jim Meyering wrote: From: Jim Meyering meyer...@redhat.com * src/nwfilter/nwfilter_ebiptables_driver.c (ebiptablesApplyNewRules): Don't dereference a NULL or uninitialized pointer when given an empty list of rules. Add an sa_assert(inst) in each loop to tell clang

Re: [libvirt] [PATCH 4/7] virGetHostnameLocalhost: avoid FP NULL-ptr-deref from clang

2010-04-14 Thread Eric Blake
On 04/14/2010 10:02 AM, Jim Meyering wrote: From: Jim Meyering meyer...@redhat.com * src/util/util.c (virGetHostnameLocalhost): Add an sa_assert to tell clang it's ok to dereference info after a non-failing getaddrinfo call. --- src/util/util.c |3 +++ 1 files changed, 3

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

2010-04-14 Thread Jim Meyering
Eric Blake wrote: On 04/14/2010 10:02 AM, 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. ---

Re: [libvirt] [PATCH 6/7] xend_internal.c: assure clang that we do not dereference NULL

2010-04-14 Thread Eric Blake
On 04/14/2010 10:02 AM, Jim Meyering wrote: From: Jim Meyering meyer...@redhat.com * src/xen/xend_internal.c (xend_parse_sexp_desc_char): Add three uses of sa_assert, each preceding a strchr(value,... to assure clang that value is non-NULL. --- src/xen/xend_internal.c |3 +++ 1 files

Re: [libvirt] [RFC] maint: forbid most files without extension

2010-04-14 Thread Daniel Veillard
On Wed, Apr 14, 2010 at 11:18:47AM +0100, Daniel P. Berrange wrote: On Tue, Apr 13, 2010 at 02:11:55PM -0600, Eric Blake wrote: * .gitignore: Add rule that requires . in name, then add exemptions. --- Given Chris' recent accident in committing a binary file, then blasting the list with

Re: [libvirt] [PATCH 7/7] qemudDomainAttachSCSIDisk: avoid FP NULL-ptr-deref from clang

2010-04-14 Thread Eric Blake
On 04/14/2010 10:02 AM, Jim Meyering wrote: From: Jim Meyering meyer...@redhat.com * src/util/conf.c (virConfParseValue): Add an sa_assert. --- src/util/conf.c |9 - 1 files changed, 8 insertions(+), 1 deletions(-) A little more context makes this obvious: if

Re: [libvirt] [RFC PATCH 0/5] Qemu Monitor Passthrough

2010-04-14 Thread Daniel P. Berrange
On Tue, Apr 13, 2010 at 02:36:45PM -0400, Chris Lalancette wrote: Hello, As we discussed on the list, here are RFC patches that allow both qemu monitor passthrough and the ability to specify extra arguments to be passed on the qemu command-line. I've specifically not done the more

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

2010-04-14 Thread Eric Blake
* src/remote/remote_driver.c (remoteIO, remoteIOEventLoop): Report failures on pipe used for wakeup. Reported by Chris Lalancette. --- src/remote/remote_driver.c | 26 ++ 1 files changed, 22 insertions(+), 4 deletions(-) diff --git a/src/remote/remote_driver.c

[libvirt] [PATCH 1/2] util: ensure safe{read, write, zero} return is checked

2010-04-14 Thread Eric Blake
Based on a warning from coverity. The safe* functions guarantee complete transactions on success, but don't guarantee freedom from failure. * src/util/util.h (saferead, safewrite, safezero): Add ATTRIBUTE_RETURN_CHECK. * src/remote/remote_driver.c (remoteIO, remoteIOEventLoop): Ignore some

Re: [libvirt] [PATCH 2/2] virt-aa-helper-test: avoid non-portable echo -n

2010-04-14 Thread Eric Blake
On 04/14/2010 10:14 AM, Jim Meyering wrote: Eric Blake wrote: * tests/virt-aa-helper-test (testme): Use printf instead. --- -echo -n $outstr: $output -echo -n '$extra_args $args $output +printf $outstr: $output +printf '$extra_args $args $output These are fine if

[libvirt] [PATCH] build: fix recent 'make syntax-check' failure

2010-04-14 Thread Eric Blake
* src/esx/esx_vi_methods.h: Placate cppi. --- Pushing under the rule for obvious build fixes. src/esx/esx_vi_methods.h |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/esx/esx_vi_methods.h b/src/esx/esx_vi_methods.h index 7b6be4e..c78c649 100644 ---

Re: [libvirt] [PATCH 6/7] xend_internal.c: assure clang that we do not dereference NULL

2010-04-14 Thread Jim Meyering
Eric Blake wrote: On 04/14/2010 10:02 AM, Jim Meyering wrote: From: Jim Meyering meyer...@redhat.com * src/xen/xend_internal.c (xend_parse_sexp_desc_char): Add three uses of sa_assert, each preceding a strchr(value,... to assure clang that value is non-NULL. --- src/xen/xend_internal.c |

Re: [libvirt] [RFC PATCH 4/5] Qemu implementation of qemuMonitorCommand.

2010-04-14 Thread Daniel P. Berrange
It'd be good if you could split this patch in two parts - one doing the monitor command stuff, and one doing the XML extensions - since they're functionally independent of each other. On Tue, Apr 13, 2010 at 02:36:49PM -0400, Chris Lalancette wrote: @@ -4593,6 +4596,31 @@ int

Re: [libvirt] [PATCH 1/1] Implement variable length structure allocator

2010-04-14 Thread Dave Allan
On Wed, Apr 07, 2010 at 12:49:46PM -0400, Dave Allan wrote: On 04/07/2010 10:17 AM, Eric Blake wrote: On 04/06/2010 06:59 AM, Dave Allan wrote: Then again, fixing the type for your new method would imply fixing the typing of virAlloc and friends as well. Daniel's arguments are convincing;

Re: [libvirt] [PATCH 7/7] qemudDomainAttachSCSIDisk: avoid FP NULL-ptr-deref from clang

2010-04-14 Thread Jim Meyering
Eric Blake wrote: On 04/14/2010 10:02 AM, Jim Meyering wrote: From: Jim Meyering meyer...@redhat.com * src/util/conf.c (virConfParseValue): Add an sa_assert. --- src/util/conf.c |9 - 1 files changed, 8 insertions(+), 1 deletions(-) A little more context makes this obvious:

Re: [libvirt] [PATCH 1/1] Implement variable length structure allocator

2010-04-14 Thread Daniel P. Berrange
On Wed, Apr 14, 2010 at 01:31:15PM -0400, Dave Allan wrote: On Wed, Apr 07, 2010 at 12:49:46PM -0400, Dave Allan wrote: On 04/07/2010 10:17 AM, Eric Blake wrote: On 04/06/2010 06:59 AM, Dave Allan wrote: Then again, fixing the type for your new method would imply fixing the typing of

Re: [libvirt] with these, clang vs. libvirt reports no errors

2010-04-14 Thread Daniel P. Berrange
On Wed, Apr 14, 2010 at 06:02:29PM +0200, Jim Meyering wrote: I've been running clang regularly, and there have been a few pesky false-positives that just won't go away. It's not productive to reexamine them each time, so I've wanted a way to educate clang without polluting the code with

Re: [libvirt] [PATCH 6/7] xend_internal.c: assure clang that we do not dereference NULL

2010-04-14 Thread Eric Blake
On 04/14/2010 11:29 AM, Jim Meyering wrote: } else if (STREQ(type, tcp)) { +sa_assert (value); const char *offset = strchr(value, ':'); This introduces an expression before a declaration, even when sa_assert is empty. I know that we already rely on several other C99

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

2010-04-14 Thread Daniel P. Berrange
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-14 Thread Daniel P. Berrange
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 3/7] nwfilter_ebiptables_driver.c: avoid NULL dereference

2010-04-14 Thread Daniel P. Berrange
On Wed, Apr 14, 2010 at 06:02:32PM +0200, Jim Meyering wrote: From: Jim Meyering meyer...@redhat.com * src/nwfilter/nwfilter_ebiptables_driver.c (ebiptablesApplyNewRules): Don't dereference a NULL or uninitialized pointer when given an empty list of rules. Add an sa_assert(inst) in each

Re: [libvirt] [PATCH 5/7] qemudDomainAttachSCSIDisk: avoid FP NULL-ptr-deref from clang

2010-04-14 Thread Daniel P. Berrange
On Wed, Apr 14, 2010 at 06:02:34PM +0200, Jim Meyering wrote: From: Jim Meyering meyer...@redhat.com * src/qemu/qemu_driver.c (qemudDomainAttachSCSIDisk): Initialize cont to NULL, so clang knows it's set. Add an sa_assert so it knows it's non-NULL when dereferenced. ---

Re: [libvirt] [PATCH 4/7] virGetHostnameLocalhost: avoid FP NULL-ptr-deref from clang

2010-04-14 Thread Daniel P. Berrange
On Wed, Apr 14, 2010 at 06:02:33PM +0200, Jim Meyering wrote: From: Jim Meyering meyer...@redhat.com * src/util/util.c (virGetHostnameLocalhost): Add an sa_assert to tell clang it's ok to dereference info after a non-failing getaddrinfo call. --- src/util/util.c |3 +++ 1 files

Re: [libvirt] [PATCH 7/7] qemudDomainAttachSCSIDisk: avoid FP NULL-ptr-deref from clang

2010-04-14 Thread Daniel P. Berrange
On Wed, Apr 14, 2010 at 06:02:36PM +0200, Jim Meyering wrote: From: Jim Meyering meyer...@redhat.com * src/util/conf.c (virConfParseValue): Add an sa_assert. --- src/util/conf.c |9 - 1 files changed, 8 insertions(+), 1 deletions(-) diff --git a/src/util/conf.c

Re: [libvirt] [PATCH 6/7] xend_internal.c: assure clang that we do not dereference NULL

2010-04-14 Thread Daniel P. Berrange
On Wed, Apr 14, 2010 at 06:02:35PM +0200, Jim Meyering wrote: From: Jim Meyering meyer...@redhat.com * src/xen/xend_internal.c (xend_parse_sexp_desc_char): Add three uses of sa_assert, each preceding a strchr(value,... to assure clang that value is non-NULL. --- src/xen/xend_internal.c |

Re: [libvirt] [PATCH 6/7] xend_internal.c: assure clang that we do not dereference NULL

2010-04-14 Thread Jim Meyering
Eric Blake wrote: On 04/14/2010 11:29 AM, Jim Meyering wrote: } else if (STREQ(type, tcp)) { +sa_assert (value); const char *offset = strchr(value, ':'); This introduces an expression before a declaration, even when sa_assert is empty. I know that we already rely on

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

2010-04-14 Thread Jim Meyering
Eric Blake wrote: * src/remote/remote_driver.c (remoteIO, remoteIOEventLoop): Report failures on pipe used for wakeup. Reported by Chris Lalancette. --- src/remote/remote_driver.c | 26 ++ 1 files changed, 22 insertions(+), 4 deletions(-) diff --git

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

2010-04-14 Thread Stefan Berger
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 may fail, I am only tearing the filters down after

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

2010-04-14 Thread Matthias Bolte
--- 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 +++ b/src/libvirt.c @@ -12616,7 +12616,7 @@ error: } /** - *

[libvirt] [PATCH] Fix close_used_without_including_unistd_h error

2010-04-14 Thread Matthias Bolte
Triggered by gnulib when compiling with MinGW. --- I just pushed this trivial compile fix too. src/conf/nwfilter_conf.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/src/conf/nwfilter_conf.c b/src/conf/nwfilter_conf.c index f4af126..336ea3b 100644 ---

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

2010-04-14 Thread Stefan Berger
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: From: Jim Meyering meyer...@redhat.com * src/nwfilter/nwfilter_ebiptables_driver.c (ebiptablesApplyNewRules): Don't

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

2010-04-14 Thread Stefan Berger
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 address='52:54:00:4d:a2:58'/ target dev='attach0'/ /interface

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

2010-04-14 Thread Matthias Bolte
This stops libvirt trying to connect to a non-existing libvirtd on the ESX server. --- src/Makefile.am |1 + src/esx/esx_driver.c |4 +- src/esx/esx_nwfilter_driver.c | 86 + src/esx/esx_nwfilter_driver.h | 29

  1   2   >