[libvirt] [PATCH] storage_backend_fs: avoid NULL dereference on opendir failure

2009-09-02 Thread Jim Meyering
I've just begun using clang's static analyzer, http://clang-analyzer.llvm.org/ It has uncovered a few problems in libvirt. Here are the first few fixes. I'll send more details later today. From b6bb9d82effa56733fbee9013e66fed384d9ff63 Mon Sep 17 00:00:00 2001 From: Jim Meyering

Re: [libvirt] [PATCH] storage_backend_fs: avoid NULL dereference on opendir failure

2009-09-02 Thread Daniel Veillard
On Wed, Sep 02, 2009 at 10:05:03AM +0200, Jim Meyering wrote: I've just begun using clang's static analyzer, http://clang-analyzer.llvm.org/ It has uncovered a few problems in libvirt. Here are the first few fixes. I'll send more details later today. All patches look fine, it's

Re: [libvirt] [PATCH 1/6] Add helper module for dealing with USB host devices

2009-09-02 Thread Daniel Veillard
On Tue, Sep 01, 2009 at 04:28:54PM +0100, Daniel P. Berrange wrote: * src/Makefile.am: Add usb.h and usb.h to libvirt_util.la * src/libvirt_private.syms: Export symbols * src/usb.c, src/usb.h: Helper APIs for USB host devices --- src/Makefile.am |1 + src/hostusb.c|

Re: [libvirt] [PATCH 2/6] Add helper APIs for iterating over PCI device resource files

2009-09-02 Thread Daniel Veillard
On Tue, Sep 01, 2009 at 04:28:55PM +0100, Daniel P. Berrange wrote: [...] @@ -1022,3 +1022,55 @@ pciDeviceListFind(pciDeviceList *list, pciDevice *dev) return list-devs[i]; return NULL; } + + +int pciDeviceFileIterate(virConnectPtr conn, +

Re: [libvirt] [PATCH 3/6] Port QEMU driver to use USB/PCI device helpers

2009-09-02 Thread Daniel Veillard
On Tue, Sep 01, 2009 at 04:28:56PM +0100, Daniel P. Berrange wrote: * src/qemu_driver.c: Remove usbfs/sysfs iterator code and call into generic helper APIs instead when setting device permissions Yup, nice cleanup, ACK, just one thing, it would be good in 1/6 and 2/6 to detail as a

[libvirt] [PATCH] remote_internal.c: don't dereference a NULL conn

2009-09-02 Thread Jim Meyering
Here's the test just before the else-if in the patch below: if (conn conn-driver STREQ (conn-driver-name, remote)) { So, in the else-branch, conn is guaranteed to be NULL. And dereferenced. This may be only a theoretical risk, but if so, the test of conn above should be

Re: [libvirt] [PATCH 4/6] Support relabelling of USB and PCI devices

2009-09-02 Thread Daniel Veillard
On Tue, Sep 01, 2009 at 04:28:57PM +0100, Daniel P. Berrange wrote: * src/security.h: Driver API for relabelling host devices * src/security_selinux.c: Implement relabelling of PCI and USB devices * src/qemu_driver.c: Relabel USB/PCI devices before hotplug --- src/qemu_driver.c |

Re: [libvirt] [PATCH] remote_internal.c: don't dereference a NULL conn

2009-09-02 Thread Daniel Veillard
On Wed, Sep 02, 2009 at 11:58:07AM +0200, Jim Meyering wrote: Here's the test just before the else-if in the patch below: if (conn conn-driver STREQ (conn-driver-name, remote)) { So, in the else-branch, conn is guaranteed to be NULL. And dereferenced. This may be

[libvirt] [RFC] Support for CPUID masking

2009-09-02 Thread Jiri Denemark
Hi, We need to provide support for CPU ID masking. Xen and VMware ESX are examples of current hypervisors which support such masking. My proposal is to define new 'cpuid' feature advertised in guest capabilities: guest ... features cpuid/ /feature

Re: [libvirt] [PATCH] remote_internal.c: don't dereference a NULL conn

2009-09-02 Thread Jim Meyering
Daniel Veillard wrote: On Wed, Sep 02, 2009 at 11:58:07AM +0200, Jim Meyering wrote: Here's the test just before the else-if in the patch below: if (conn conn-driver STREQ (conn-driver-name, remote)) { So, in the else-branch, conn is guaranteed to be NULL. And

Re: [libvirt] [PATCH] remote_internal.c: don't dereference a NULL conn

2009-09-02 Thread Jim Meyering
Jim Meyering wrote: Daniel Veillard wrote: On Wed, Sep 02, 2009 at 11:58:07AM +0200, Jim Meyering wrote: Here's the test just before the else-if in the patch below: if (conn conn-driver STREQ (conn-driver-name, remote)) { So, in the else-branch, conn is guaranteed to

Re: [libvirt] [PATCH] remote_internal.c: don't dereference a NULL conn

2009-09-02 Thread Daniel P. Berrange
On Wed, Sep 02, 2009 at 12:26:43PM +0200, Jim Meyering wrote: Daniel Veillard wrote: On Wed, Sep 02, 2009 at 11:58:07AM +0200, Jim Meyering wrote: Here's the test just before the else-if in the patch below: if (conn conn-driver STREQ (conn-driver-name, remote)) {

Re: [libvirt] [PATCH] storage_backend_fs: avoid NULL dereference on opendir failure

2009-09-02 Thread Daniel P. Berrange
On Wed, Sep 02, 2009 at 10:05:03AM +0200, Jim Meyering wrote: From 7f453c68bc709d542e4c40a388c92c7969ad0a3a Mon Sep 17 00:00:00 2001 From: Jim Meyering meyer...@redhat.com Date: Wed, 2 Sep 2009 09:58:50 +0200 Subject: [PATCH 3/4] lxc: avoid NULL dereference when we find no mount point *

Re: [libvirt] [PATCH] storage_backend_fs: avoid NULL dereference on opendir failure

2009-09-02 Thread Jim Meyering
Daniel P. Berrange wrote: On Wed, Sep 02, 2009 at 10:05:03AM +0200, Jim Meyering wrote: From 7f453c68bc709d542e4c40a388c92c7969ad0a3a Mon Sep 17 00:00:00 2001 From: Jim Meyering meyer...@redhat.com Date: Wed, 2 Sep 2009 09:58:50 +0200 Subject: [PATCH 3/4] lxc: avoid NULL dereference when we

Re: [libvirt] PATCH: Don't blindly reorder disk drives

2009-09-02 Thread Daniel Veillard
On Mon, Aug 17, 2009 at 03:34:38PM +0100, Daniel P. Berrange wrote: Calling qsort() on the disks array causes disk to be unneccessarily re-ordered, potentially breaking the ability to boot if the boot disk gets moved later in the list. The new algorithm will insert a new disk as far to the

Re: [libvirt] [RFC] Support for CPUID masking

2009-09-02 Thread Matthias Bolte
2009/9/2 Jiri Denemark jdene...@redhat.com: Hi, We need to provide support for CPU ID masking. Xen and VMware ESX are examples of current hypervisors which support such masking. [...] domain type='xen' id='42'    ...    features        pae/        acpi/        apic/        cpuid      

Re: [libvirt] Re: OpenVZ : The restriction of domain name should be addressed

2009-09-02 Thread Daniel Veillard
On Fri, Aug 21, 2009 at 11:08:05AM +0900, Yuji NISHIDA wrote: 2009/7/24 Daniel P. Berrange berra...@redhat.com We should make use of this --name parameter then - I guess it didn't exist when we first wrote the driver. It is useful to users to have separate ID vs Name parameters - and in fact

Re: [libvirt] UML driver struct refers to public API functions

2009-09-02 Thread Daniel Veillard
On Mon, Aug 24, 2009 at 02:13:07PM +0100, Daniel P. Berrange wrote: On Sat, Aug 22, 2009 at 10:04:30PM +0200, Matthias Bolte wrote: Hi, The commit Generic shared impls of all NUMA apis (b0b968efd56f6c66bfa23eebbecd491ea993f99b) changed the UML driver struct to use the shared NUMA API.

Re: [libvirt] UML driver struct refers to public API functions

2009-09-02 Thread Matthias Bolte
2009/9/2 Daniel Veillard veill...@redhat.com: On Mon, Aug 24, 2009 at 02:13:07PM +0100, Daniel P. Berrange wrote: On Sat, Aug 22, 2009 at 10:04:30PM +0200, Matthias Bolte wrote: Hi, The commit Generic shared impls of all NUMA apis (b0b968efd56f6c66bfa23eebbecd491ea993f99b) changed the

Re: [libvirt] [PATCH 2/2] RPM spec file updated with glusterfs dependency

2009-09-02 Thread Daniel Veillard
On Tue, Sep 01, 2009 at 11:51:22AM +0100, Daniel P. Berrange wrote: On Sat, Aug 29, 2009 at 12:20:11AM +0200, Gerrit Slomma wrote: On Tue, Jul 07, 2009 at 05:47:56AM -0700, Harshavardhana wrote: Add new dependency for glusterfs rpm. [...] +# For glusterfs +Requires: glusterfs-client

Re: [libvirt] [PATCH] Support for getting/setting number of cpus in VirtualBox

2009-09-02 Thread Daniel Veillard
On Fri, Aug 07, 2009 at 04:08:13PM +0200, Pritesh Kothari wrote: Hi All, I have just added support for getting/setting number of cpus in VirtualBox. The patch for the same is include below. Okay, applied and commited, thanks ! Daniel -- Daniel Veillard | libxml Gnome XML XSLT

Re: [libvirt] VMware ESX: Allow ethernet address type 'vpx'

2009-09-02 Thread Daniel Veillard
On Sat, Aug 08, 2009 at 11:56:10PM +0200, Matthias Bolte wrote: The VMX entry ethernet0.addressType may be set to 'vpx' beside 'static' and 'generated'. 'vpx' indicates that the MAC address was generated by a vCenter. The attached patch adds 'vpx' to the valid values for

Re: [libvirt] VMware ESX: Don't warn if a known query parameter should be ignored

2009-09-02 Thread Daniel Veillard
On Sat, Aug 08, 2009 at 11:57:25PM +0200, Matthias Bolte wrote: esxUtil_ParseQuery() warns if a known query parameter should be ignored due to the corresponding char/int pointer being NULL, instead of silently ignoring it. The attached patch changes the if/else structure to fix this.

[libvirt] rebased multipath patch

2009-09-02 Thread Dave Allan
Here's the multipath patch, rebased against the current head. Dave From 52cb0ff30dd5a52c5a246f3a2022f933cd2a0eab Mon Sep 17 00:00:00 2001 From: David Allan dal...@redhat.com Date: Tue, 21 Jul 2009 12:43:01 -0400 Subject: [PATCH] Add a simple pool type for multipath devices This pool type

Re: [libvirt] [RFC] Support for CPUID masking

2009-09-02 Thread Jim Paris
Jiri Denemark wrote: Hi, We need to provide support for CPU ID masking. Xen and VMware ESX are examples of current hypervisors which support such masking. My proposal is to define new 'cpuid' feature advertised in guest capabilities: ... domain type='xen' id='42' ... features

Re: [libvirt] [RFC] Support for CPUID masking

2009-09-02 Thread Daniel P. Berrange
On Wed, Sep 02, 2009 at 11:59:39AM -0400, Jim Paris wrote: Jiri Denemark wrote: Hi, We need to provide support for CPU ID masking. Xen and VMware ESX are examples of current hypervisors which support such masking. My proposal is to define new 'cpuid' feature advertised in guest

[libvirt] virsh vcpuinfo always returns CPU=0

2009-09-02 Thread Shi Jin
Hi there, I wonder what does the CPU entry stands for in the output of vcpuinfo. I guess it is the CPU utilization rate, right? For both Ubuntu 9.04 (virsh version 0.6.1) and RHEL 5.4 (version 0.6.3), I always get the returned CPU value to be 0, no matter how busy the CPU can be and how many

Re: [libvirt] virsh vcpuinfo always returns CPU=0

2009-09-02 Thread Daniel P. Berrange
On Wed, Sep 02, 2009 at 09:37:15AM -0700, Shi Jin wrote: Hi there, I wonder what does the CPU entry stands for in the output of vcpuinfo. I guess it is the CPU utilization rate, right? It is the most recent physical CPU in which the vCPU ran. For both Ubuntu 9.04 (virsh version 0.6.1) and

Re: [libvirt] [PATCH] Fix several memory leaks

2009-09-02 Thread Ryota Ozaki
Hi Chris, On Tue, Sep 1, 2009 at 4:45 AM, Chris Lalancetteclala...@redhat.com wrote: Ryota Ozaki wrote: diff --git a/qemud/qemud.c b/qemud/qemud.c index df275e6..17ba44a 100644 --- a/qemud/qemud.c +++ b/qemud/qemud.c @@ -1733,7 +1733,7 @@ readmore:          /* Possibly need to create

Re: [libvirt] [PATCH] remote_internal.c: don't dereference a NULL conn

2009-09-02 Thread Paolo Bonzini
Does __attribute__((__nonnull__())) really cover the case we're concerned about here? No, not at all. Good catch. Paolo -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [PATCH] Support configuration of huge pages in guests

2009-09-02 Thread john cooper
Daniel P. Berrange wrote: * configure.in: Add check for mntent.h * qemud/libvirtd_qemu.aug, qemud/test_libvirtd_qemu.aug, src/qemu.conf Add 'hugetlbfs_mount' config parameter * src/qemu_conf.c, src/qemu_conf.h: Check for -mem-path flag in QEMU, and pass it when hugepages are requested.