Re: [libvirt] RFC: Coding style: require alphabetical header file sorting

2012-12-04 Thread Michal Privoznik
On 03.12.2012 17:45, Daniel P. Berrange wrote: > Thus far we only have one rule about header files, #include > must be first in all .c files. I'm wondering if it is time to introduce > some new rules > > - All system headers must be grouped to preceed all local headers > - All system headers m

Re: [libvirt] RFC: Coding style: require alphabetical header file sorting

2012-12-04 Thread Daniel P. Berrange
On Tue, Dec 04, 2012 at 09:59:54AM +0100, Michal Privoznik wrote: > On 03.12.2012 17:45, Daniel P. Berrange wrote: > > Thus far we only have one rule about header files, #include > > must be first in all .c files. I'm wondering if it is time to introduce > > some new rules > > > > - All system

[libvirt] [PATCH V2] implement managedsave in libvirt xen legacy driver

2012-12-04 Thread Bamvor Jian Zhang
Implement the domainManagedSave, domainHasManagedSaveImage, and domainManagedSaveRemove functions in the libvirt legacy xen driver. domainHasManagedSaveImage check the managedsave image from filesystem everytime. This is different from qemu and libxl driver. In qemu or libxl driver, there is a has

[libvirt] [PATCH] qemu: Fix error code when attaching existing device

2012-12-04 Thread Jiri Denemark
An attempt to attach device that is already attached to a domain results in the following error: virsh # attach-device rhel6 pci2 --persistent error: Failed to attach device from pci2 error: invalid argument: device is already in the domain configuration The "invalid argument" error code looks wr

Re: [libvirt] RFC: Coding style: require alphabetical header file sorting

2012-12-04 Thread Viktor Mihajlovski
On 12/03/2012 05:45 PM, Daniel P. Berrange wrote: Thus far we only have one rule about header files, #include must be first in all .c files. I'm wondering if it is time to introduce some new rules - All system headers must be grouped to preceed all local headers why not enforce the current

[libvirt] [PATCH 1/4] qemu: Don't free PCI device if adding it to activePciHostdevs fails

2012-12-04 Thread Jiri Denemark
The device is still referenced from pcidevs and freeing it would leave an invalid pointer there. --- src/qemu/qemu_hostdev.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/qemu/qemu_hostdev.c b/src/qemu/qemu_hostdev.c index ab0f173..b79319e 100644 --- a/src/qemu/qemu_ho

[libvirt] [PATCH 0/4] qemu: Fix leaks in handling PCI devices

2012-12-04 Thread Jiri Denemark
https://bugzilla.redhat.com/show_bug.cgi?id=877095 Patch 1/4 fixes a possible double free on error path and the other patches deal with memory and file descriptor leaks in PCI device attachment code. Jiri Denemark (4): qemu: Don't free PCI device if adding it to activePciHostdevs fails util:

[libvirt] [PATCH 2/4] util: Slightly refactor PCI list functions

2012-12-04 Thread Jiri Denemark
In order to be able to steal PCI device by its index in the list. --- src/libvirt_private.syms | 2 ++ src/util/pci.c | 60 +--- src/util/pci.h | 4 3 files changed, 42 insertions(+), 24 deletions(-) diff --git a/src/libvirt_p

[libvirt] [PATCH 3/4] qemu: Fix memory (and FD) leak on PCI device detach

2012-12-04 Thread Jiri Denemark
Unmanaged PCI devices were only leaked if pciDeviceListAdd failed but managed devices were always leaked. And leaking PCI device is likely to leave PCI config file descriptor open. This patch fixes qemuReattachPciDevice to either free the PCI device or add it to the inactivePciHostdevs list. --- s

[libvirt] [PATCH 4/4] qemu: Do not keep PCI device config file open

2012-12-04 Thread Jiri Denemark
We only need to access the PCI device config file when attaching/detaching the device to a domain. Keeping it open all the time the device is attached to a domain is useless. --- src/libvirt_private.syms | 1 + src/qemu/qemu_hostdev.c | 6 -- src/util/pci.c | 6 +++--- src/util/pci.

Re: [libvirt] ivshmem server

2012-12-04 Thread Andrew Jones
Cam, ping Please let us know your opinion on integrating ivshmem-server into libvirt. Also, please confirm the licensing would allow it. Thanks, Drew - Original Message - > > > - Original Message - > > On Tue, Nov 20, 2012 at 01:16:56PM -0500, Andrew Jones wrote: > > > > > >

Re: [libvirt] RFC: Coding style: require alphabetical header file sorting

2012-12-04 Thread Daniel P. Berrange
On Mon, Dec 03, 2012 at 04:45:26PM +, Daniel P. Berrange wrote: > Thus far we only have one rule about header files, #include > must be first in all .c files. I'm wondering if it is time to introduce > some new rules > > - All system headers must be grouped to preceed all local headers > -

[libvirt] [PATCH] Fix memory leak in QEMU QMP capabilities initialization

2012-12-04 Thread Daniel P. Berrange
From: "Daniel P. Berrange" The qemuCapsInitQMP method never frees the QEMU 'package' version string. --- src/qemu/qemu_capabilities.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 6e34cdf..a0ed4f1 100644 --

[libvirt] [PATCH 00/10 v4] Unprivileged SG_IO support

2012-12-04 Thread Osier Yang
Hi, As a result of RFC [1], this implements the unprivleged SG_IO support. Testing is not that enough, but I'd like see the reviewing earlier, and meanwhile I'm not going to give up the further testing. v2 - v3: * Change the XML tag name to "cdbfilter" * Maintain an internal list of shared di

[libvirt] [PATCH 06/10] conf: Parse and format the new XML tag cdbfilter

2012-12-04 Thread Osier Yang
Setting "cdbfilter" to "no" to enable the unprivleged SG_IO, I.e. Disable the kernel CDB filtering. And "yes" to enable it. "yes" is the kernel default behaviour. Later patch will do the actual setting. --- src/conf/domain_conf.c | 58 +++- src/conf/d

[libvirt] [PATCH 02/10] qemu: Init/Free the list with the driver's lifecyle

2012-12-04 Thread Osier Yang
Lifecyle here only means starting and shutdown. --- src/qemu/qemu_driver.c |6 ++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 8e838cd..6ee8abb 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -805,6

[libvirt] [PATCH 07/10] util: Prepare helpers for unpriv_sgio setting

2012-12-04 Thread Osier Yang
"virGetDevice{Major,Minor}" could be used across the sources, but it doesn't relate with this series, and could be done later. * src/util/util.h: (Declare virGetDevice{Major,Minor}, and vir{Get,Set}DeviceUnprivSGIO) * src/util/util.c: (Implement virGetDevice{Major,Minor} and

[libvirt] [PATCH 08/10] qemu: Manage disk's cdbfilter in domain's lifecycle

2012-12-04 Thread Osier Yang
Here lifecyle only means staring and shutdown. To record the original "unpriv_sgio" value, this introduces "old_cdbfilter" for disk def. When the domain is starting, the disk's "unpriv_sgio" is set with regards to the config in domain XML. And when the domain is being destroyed, it's restored to t

[libvirt] [PATCH 09/10] qemu: Do not restore the sysfs unpriv_sgio if the disk is being shared

2012-12-04 Thread Osier Yang
This prevents restoring the unpriv_sgio if the disk is shared, and is being used by other active domain. Because we don't want to fall into the corruption situation. --- src/qemu/qemu_process.c | 11 +++ 1 files changed, 11 insertions(+), 0 deletions(-) diff --git a/src/qemu/qemu_proces

[libvirt] [PATCH 10/10] qemu: Error out when domain starting if the cdbfilter setting conflicts

2012-12-04 Thread Osier Yang
This prevents the domain starting if the shared disk's setting conflicts with other active domain(s), E.g. A domain with "cdbfilter" set as "yes", however, another active domain is using it set as "no". * src/conf/domain_conf.h: (Declare helper virDomainDiskFindByPath) * src/conf/domain_conf.c: (I

[libvirt] [PATCH 04/10] qemu: Add/Remove the entry of sharedDisks when live attaching/detaching

2012-12-04 Thread Osier Yang
This adds one entry to the list qemud_driver->sharedDisks when attaching a shared disk. And removing the entry from the list when detaching. --- src/qemu/qemu_driver.c | 22 ++ 1 files changed, 22 insertions(+), 0 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/q

[libvirt] [PATCH 03/10] qemu: Add/remove the shared disk entry during domain's lifecyle

2012-12-04 Thread Osier Yang
Lifecyle here only means starting and shutdown. --- src/qemu/qemu_process.c | 20 1 files changed, 20 insertions(+), 0 deletions(-) diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index d4dad1f..2a60741 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu

[libvirt] [PATCH 05/10] docs: Add docs and rng schema for new XML cdbfilter

2012-12-04 Thread Osier Yang
Since "rawio" and "cdbfilter" are only valid for "lun", this groups them together; And since both of them intend to allow the unprivledged user to use the SG_IO commands, they must be exclusive. --- docs/formatdomain.html.in | 13 +- docs/schemas/domaincommon.rng | 52 +

[libvirt] [PATCH 01/10] qemu: Introduce a list to maintain the shared disks between domains

2012-12-04 Thread Osier Yang
A single entry of the list is constructed by the _disk path_ and a sub-list of domain names which are using the disk. * src/qemu/qemu_conf.h (New struct qemuSharedDisk, qemuSharedDiskList; New type qemuSharedDiskPtr, qemuSharedDiskListPtr; Declare th

[libvirt] fail to patch rpmbuild -bb libvirt.spec

2012-12-04 Thread Frost Rains
Hi Mr/Mrs, At my install I fail in: make[3]: *** [libvirt_driver_libxl_la-libxl_conf.lo] Error 1 make[3]: *** Waiting for unfinished jobs make[3]: Leaving directory `/root/rpmbuild/BUILD/libvirt-0.9.10/src' make[2]: *** [all] Error 2 make[2]: Leaving directory `/root/rpmbuild/BUILD/libvirt-0.9.

Re: [libvirt] fail to patch rpmbuild -bb libvirt.spec

2012-12-04 Thread Daniel P. Berrange
On Sat, Dec 01, 2012 at 01:02:48PM +0700, Frost Rains wrote: > Hi Mr/Mrs, > At my install I fail in: > make[3]: *** [libvirt_driver_libxl_la-libxl_conf.lo] Error 1 > make[3]: *** Waiting for unfinished jobs > make[3]: Leaving directory `/root/rpmbuild/BUILD/libvirt-0.9.10/src' > make[2]: *** [a

[libvirt] [PATCH v4 00/13] parallels: implement operations with hard disks

2012-12-04 Thread Dmitry Guryanov
This patch series adds ability to list existing disk images, create a new ones and add or remove hard disk devices to the VM. Changes in v2: rebased to current sources Changes in v3: fixed errors in make syntax-check Changes in v4: fixed rebase errors Dmitry Guryanov (13

[libvirt] [PATCH v4 08/13] parallels: fill volumes capacity parameter

2012-12-04 Thread Dmitry Guryanov
Read disk images size from xml description and fill virStorageVolDef.capacity and allocation (let's consider that allocation is the same as capacity, calculating real allcoation will be implemented later). Signed-off-by: Dmitry Guryanov --- src/parallels/parallels_storage.c | 54 ++

[libvirt] [PATCH v4 10/13] parallels: add function parallelsGetDiskBusName

2012-12-04 Thread Dmitry Guryanov
Add function for convertion bus from libvirt's numeric constant to a name, used in a parallels command-line tools. Signed-off-by: Dmitry Guryanov --- src/parallels/parallels_driver.c | 28 ++-- 1 files changed, 18 insertions(+), 10 deletions(-) diff --git a/src/paralle

[libvirt] [PATCH v4 07/13] parallels: add info about volumes

2012-12-04 Thread Dmitry Guryanov
Disk images in Parallels Cloud Server stored in directories. Each one has files with data and xml description of an image stored in file DiskDescriptior.xml. Since we have to support 'detached' images, which are not used by any VM, the better way to collect info about volumes is searching for dire

[libvirt] [PATCH v4 02/13] parallels: handle disk devices in parallelsDomainDefineXML

2012-12-04 Thread Dmitry Guryanov
Allow changing some parameters of the hard disks: bus, image and drive address. Creating new disk devices and removing existing ones require changes in the storage driver, so it will be implemented later. Signed-off-by: Dmitry Guryanov --- src/parallels/parallels_driver.c | 73 +++

[libvirt] [PATCH v4 05/13] parallels: create storage pools by VM list

2012-12-04 Thread Dmitry Guryanov
There are no storage pools in Parallels Cloud Server - All VM data stored in a single directory: config, snapshots, memory dump together with disk images. Let's look through list of VMs and create a storage pool for each directory, containing VMs. So if you have 3 vms: /var/parallels/vm-1.pvm, /v

[libvirt] [PATCH v4 11/13] parallels: add support of disks creation

2012-12-04 Thread Dmitry Guryanov
Implement creation of new disks - if a new disk found in configuration, find a volume by disk path and actually create a disk image by issuing prlctl command. If it's successfully finished - remove the file with volume definition. Signed-off-by: Dmitry Guryanov --- src/parallels/parallels_driver

[libvirt] [PATCH v4 04/13] parallels: remove unused code from storage driver

2012-12-04 Thread Dmitry Guryanov
We don't support unprivileged users anymore, so remove code, which selects configuration directory depending on user. Signed-off-by: Dmitry Guryanov --- src/parallels/parallels_storage.c | 22 +++--- 1 files changed, 3 insertions(+), 19 deletions(-) diff --git a/src/parallels/

[libvirt] [PATCH v4 03/13] parallels: split parallelsStorageOpen function

2012-12-04 Thread Dmitry Guryanov
Move code for loading inforation about pools to a separate function - parallelsLoadPools. Signed-off-by: Dmitry Guryanov --- src/parallels/parallels_storage.c | 66 ++--- 1 files changed, 39 insertions(+), 27 deletions(-) diff --git a/src/parallels/parallels_st

Re: [libvirt] [PATCH] Fix memory leak in QEMU QMP capabilities initialization

2012-12-04 Thread Peter Krempa
On 12/04/12 14:16, Daniel P. Berrange wrote: From: "Daniel P. Berrange" The qemuCapsInitQMP method never frees the QEMU 'package' version string. --- src/qemu/qemu_capabilities.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) ACK Peter -- libvir-list mailing list libvir-list@re

[libvirt] [PATCH v4 06/13] parallels: fix leaks in parallelsFindVolumes

2012-12-04 Thread Dmitry Guryanov
We always have to close opened dir and free 'path'. Signed-off-by: Dmitry Guryanov --- src/parallels/parallels_storage.c | 20 1 files changed, 12 insertions(+), 8 deletions(-) diff --git a/src/parallels/parallels_storage.c b/src/parallels/parallels_storage.c index 148d8

[libvirt] [PATCH v4 12/13] parallels: apply config after VM creation

2012-12-04 Thread Dmitry Guryanov
New VM will have default values for all parameters, like cpu number, we have to change its configuration as provided by xml definition, given to parallelsDomainDefineXML. Signed-off-by: Dmitry Guryanov --- src/parallels/parallels_driver.c | 33 + 1 files changed

[libvirt] [PATCH v4 13/13] parallels: add support of removing disks

2012-12-04 Thread Dmitry Guryanov
If some hard disk is not found in new domain configuration, it should be removed. Signed-off-by: Dmitry Guryanov --- src/parallels/parallels_driver.c | 28 1 files changed, 24 insertions(+), 4 deletions(-) diff --git a/src/parallels/parallels_driver.c b/src/parall

[libvirt] [PATCH v4 09/13] parallels: split parallelsStorageVolumeDelete function

2012-12-04 Thread Dmitry Guryanov
Move part, which deletes existing volume, to a new function parallelsStorageVolumeDefRemove so that we can use it later in parallels_driver.c Signed-off-by: Dmitry Guryanov --- src/parallels/parallels_storage.c | 83 +--- src/parallels/parallels_utils.h |2

[libvirt] [PATCH v4 01/13] parallels: add info about hard disk devices

2012-12-04 Thread Dmitry Guryanov
Parse information about hard disks and fill disks array in virDomainDef structure. Signed-off-by: Dmitry Guryanov --- src/parallels/parallels_driver.c | 118 ++ 1 files changed, 118 insertions(+), 0 deletions(-) diff --git a/src/parallels/parallels_driver.c

Re: [libvirt] [PATCH] qemu: Fix error code when attaching existing device

2012-12-04 Thread Peter Krempa
On 12/04/12 11:19, Jiri Denemark wrote: An attempt to attach device that is already attached to a domain results in the following error: virsh # attach-device rhel6 pci2 --persistent error: Failed to attach device from pci2 error: invalid argument: device is already in the domain configuration

Re: [libvirt] [PATCH 1/4] qemu: Don't free PCI device if adding it to activePciHostdevs fails

2012-12-04 Thread Osier Yang
On 2012年12月04日 18:38, Jiri Denemark wrote: The device is still referenced from pcidevs and freeing it would leave an invalid pointer there. --- src/qemu/qemu_hostdev.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/qemu/qemu_hostdev.c b/src/qemu/qemu_hostdev.c index

Re: [libvirt] [PATCHv3 0/3] IPv6 enhancements; put dnsmasq parameters in conf-file

2012-12-04 Thread Gene Czarcinski
On 12/03/2012 11:13 AM, Gene Czarcinski wrote: docs/formatnetwork.html.in | 136 - BTW, for documentation changes I used "Since 1.0.1". If something else should be used, please tell me. Gene -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/

Re: [libvirt] [PATCH 2/4] util: Slightly refactor PCI list functions

2012-12-04 Thread Osier Yang
On 2012年12月04日 18:38, Jiri Denemark wrote: In order to be able to steal PCI device by its index in the list. --- src/libvirt_private.syms | 2 ++ src/util/pci.c | 60 +--- src/util/pci.h | 4 3 files changed, 42 insertion

Re: [libvirt] [PATCH 3/4] qemu: Fix memory (and FD) leak on PCI device detach

2012-12-04 Thread Osier Yang
On 2012年12月04日 18:38, Jiri Denemark wrote: Unmanaged PCI devices were only leaked if pciDeviceListAdd failed but managed devices were always leaked. And leaking PCI device is likely to leave PCI config file descriptor open. This patch fixes qemuReattachPciDevice to either free the PCI device or a

Re: [libvirt] [PATCH 2/4] util: Slightly refactor PCI list functions

2012-12-04 Thread Osier Yang
On 2012年12月04日 18:38, Jiri Denemark wrote: In order to be able to steal PCI device by its index in the list. --- src/libvirt_private.syms | 2 ++ src/util/pci.c | 60 +--- src/util/pci.h | 4 3 files changed, 42 insertion

Re: [libvirt] [PATCH 4/4] qemu: Do not keep PCI device config file open

2012-12-04 Thread Osier Yang
On 2012年12月04日 18:38, Jiri Denemark wrote: We only need to access the PCI device config file when attaching/detaching the device to a domain. Keeping it open all the time the device is attached to a domain is useless. --- src/libvirt_private.syms | 1 + src/qemu/qemu_hostdev.c | 6 -- sr

Re: [libvirt] [PATCH] qemu: nicer error message if live disk snapshot unsupported

2012-12-04 Thread Osier Yang
On 2012年12月04日 05:33, Eric Blake wrote: Without this patch, attempts to create a disk snapshot when qemu is too old results in a cryptic message: virsh # snapshot-create 23 --disk-only error: operation failed: Failed to take snapshot: unknown command: 'snapshot_blkdev' Now it reports: virsh #

[libvirt] [PATCH] Do not export symbol virStateActive anymore

2012-12-04 Thread Osier Yang
Commit 79b8a56995 removes virStateActive, however it forgot to remove the symbol together. Pushed under build-breaker rule. --- src/libvirt_daemon.syms |1 - 1 files changed, 0 insertions(+), 1 deletions(-) diff --git a/src/libvirt_daemon.syms b/src/libvirt_daemon.syms index dde77a6..e184ded

Re: [libvirt] [PATCH] qemu: nicer error message if live disk snapshot unsupported

2012-12-04 Thread Osier Yang
On 2012年12月04日 05:33, Eric Blake wrote: Without this patch, attempts to create a disk snapshot when qemu is too old results in a cryptic message: virsh # snapshot-create 23 --disk-only error: operation failed: Failed to take snapshot: unknown command: 'snapshot_blkdev' Now it reports: virsh #

[libvirt] [PATCH] Fix the indention

2012-12-04 Thread Osier Yang
Introduced by commit 1465876a, pushed under build-breaker && trivial rule. --- python/libvirt-override.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/python/libvirt-override.c b/python/libvirt-override.c index 573c032..eda8a11 100644 --- a/python/libvirt-override.c +++

Re: [libvirt] libvirtd crash upon virsh destroy

2012-12-04 Thread Daniel P. Berrange
On Tue, Dec 04, 2012 at 10:38:07AM -0500, Scott Sullivan wrote: > Running libvirt v1.0.0, with > f0e72b2f5c675f927d04545dc5095f9e5998f171 applied. The problem (which > I cannot reproduce reliably), is that libvirtd crashes sometimes on > a destroy (sequence of events and crash log below). > > I wa

Re: [libvirt] libvirtd crash upon virsh destroy

2012-12-04 Thread Osier Yang
On 2012年12月04日 23:46, Daniel P. Berrange wrote: /me ought to see if we can get the automatic libvirt crash log to include a stack trace, since the log messages are pretty useless on their own. +1, that will be really nice. -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.

Re: [libvirt] [PATCH V2] implement managedsave in libvirt xen legacy driver

2012-12-04 Thread Jim Fehlig
Bamvor Jian Zhang wrote: > Implement the domainManagedSave, domainHasManagedSaveImage, and > domainManagedSaveRemove functions in the libvirt legacy xen driver. > > domainHasManagedSaveImage check the managedsave image from filesystem > everytime. This is different from qemu and libxl driver. In qe

Re: [libvirt] [PATCH 10/10] qemu: Error out when domain starting if the cdbfilter setting conflicts

2012-12-04 Thread Osier Yang
On 2012年12月04日 21:17, Osier Yang wrote: This prevents the domain starting if the shared disk's setting conflicts with other active domain(s), E.g. A domain with "cdbfilter" set as "yes", however, another active domain is using it set as "no". * src/conf/domain_conf.h: (Declare helper virDomainDi

[libvirt] [PATCH] qemu: Simplify the codes

2012-12-04 Thread Osier Yang
"disk" is initialized to "dev->data.disk" in the beginning of the function. --- src/qemu/qemu_driver.c |5 ++--- 1 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 2c36935..a7ef4a2 100644 --- a/src/qemu/qemu_driver.c +++ b/src/q

Re: [libvirt] [PATCH 00/10 v4] Unprivileged SG_IO support

2012-12-04 Thread Osier Yang
On 2012年12月04日 21:17, Osier Yang wrote: Hi, As a result of RFC [1], this implements the unprivleged SG_IO support. Testing is not that enough, but I'd like see the reviewing earlier, and meanwhile I'm not going to give up the further testing. v2 - v3: * Change the XML tag name to "cdbfilter"

[libvirt] [PATCH] Fix memory leak introduced by commit 501bfad1

2012-12-04 Thread Jim Fehlig
501bfad1 missed freeing priv->saveDir when opening the Xen unified driver failed. --- src/xen/xen_driver.c |1 + 1 file changed, 1 insertion(+) diff --git a/src/xen/xen_driver.c b/src/xen/xen_driver.c index 3786176..d2de141 100644 --- a/src/xen/xen_driver.c +++ b/src/xen/xen_driver.c @@ -432,

Re: [libvirt] [PATCH 3/4] qemu: Fix memory (and FD) leak on PCI device detach

2012-12-04 Thread Jiri Denemark
On Tue, Dec 04, 2012 at 22:29:23 +0800, Osier Yang wrote: > On 2012年12月04日 18:38, Jiri Denemark wrote: > > Unmanaged PCI devices were only leaked if pciDeviceListAdd failed but > > managed devices were always leaked. And leaking PCI device is likely to > > leave PCI config file descriptor open. Thi

Re: [libvirt] [PATCH] Fix memory leak introduced by commit 501bfad1

2012-12-04 Thread Daniel P. Berrange
On Tue, Dec 04, 2012 at 10:42:43AM -0700, Jim Fehlig wrote: > 501bfad1 missed freeing priv->saveDir when opening the Xen unified > driver failed. > --- > src/xen/xen_driver.c |1 + > 1 file changed, 1 insertion(+) > > diff --git a/src/xen/xen_driver.c b/src/xen/xen_driver.c > index 3786176..d

[libvirt] [PATCH 0/2] CPU Probing Revisited

2012-12-04 Thread Viktor Mihajlovski
I have not yet given up on the CPU probing. Since the orginal patch was not well received w.r.t error checking I have effectively undone the cpu model checking part. Next, I have enabled the QMP query-cpu-definitions command in a minimalistic fashion, return host as the only supported CPU model. T

[libvirt] [PATCH 1/2] S390: Undo the cpu model checking.

2012-12-04 Thread Viktor Mihajlovski
As the host model checking prompted some controversies we will abstain until a comprehensive CPU model handling has been established. Signed-off-by: Viktor Mihajlovski --- hw/s390-virtio.c |5 - 1 files changed, 0 insertions(+), 5 deletions(-) diff --git a/hw/s390-virtio.c b/hw/s390-vir

[libvirt] [PATCH 2/2] S390: Enable the QMP query-cpu-definitions command

2012-12-04 Thread Viktor Mihajlovski
Since libvirt is using QMP for cpu definition probing, it is beneficial to have a minimum implementation for that. This covers only cpu model = host and needs to be reworked into a full-fledged version later on. Signed-off-by: Viktor Mihajlovski --- target-s390x/cpu.c | 15 +++ 1 f

Re: [libvirt] [PATCH 4/4] qemu: Do not keep PCI device config file open

2012-12-04 Thread Daniel P. Berrange
On Tue, Dec 04, 2012 at 11:38:22AM +0100, Jiri Denemark wrote: > We only need to access the PCI device config file when > attaching/detaching the device to a domain. Keeping it open all the time > the device is attached to a domain is useless. IMHO this is really just papering over a really terrib

Re: [libvirt] [PATCH 3/4] qemu: Fix memory (and FD) leak on PCI device detach

2012-12-04 Thread Osier Yang
On 2012年12月05日 01:48, Jiri Denemark wrote: On Tue, Dec 04, 2012 at 22:29:23 +0800, Osier Yang wrote: On 2012年12月04日 18:38, Jiri Denemark wrote: Unmanaged PCI devices were only leaked if pciDeviceListAdd failed but managed devices were always leaked. And leaking PCI device is likely to leave PCI

Re: [libvirt] [PATCH 0/2] CPU Probing Revisited

2012-12-04 Thread Daniel P. Berrange
On Tue, Dec 04, 2012 at 06:54:29PM +0100, Viktor Mihajlovski wrote: > I have not yet given up on the CPU probing. Since the orginal patch > was not well received w.r.t error checking I have effectively undone > the cpu model checking part. > Next, I have enabled the QMP query-cpu-definitions comman

Re: [libvirt] [PATCH 2/4] util: Slightly refactor PCI list functions

2012-12-04 Thread jd >> Jiri Denemark
On Tue, Dec 04, 2012 at 22:32:35 +0800, Osier Yang wrote: > On 2012年12月04日 18:38, Jiri Denemark wrote: > > In order to be able to steal PCI device by its index in the list. > > --- > > src/libvirt_private.syms | 2 ++ > > src/util/pci.c | 60 > > +-

Re: [libvirt] [PATCH 4/4] qemu: Do not keep PCI device config file open

2012-12-04 Thread Jiri Denemark
On Tue, Dec 04, 2012 at 17:55:33 +, Daniel P. Berrange wrote: > On Tue, Dec 04, 2012 at 11:38:22AM +0100, Jiri Denemark wrote: > > We only need to access the PCI device config file when > > attaching/detaching the device to a domain. Keeping it open all the time > > the device is attached to a

Re: [libvirt] [PATCH] Fix memory leak introduced by commit 501bfad1

2012-12-04 Thread Jim Fehlig
Daniel P. Berrange wrote: > On Tue, Dec 04, 2012 at 10:42:43AM -0700, Jim Fehlig wrote: > >> 501bfad1 missed freeing priv->saveDir when opening the Xen unified >> driver failed. >> --- >> src/xen/xen_driver.c |1 + >> 1 file changed, 1 insertion(+) >> >> diff --git a/src/xen/xen_driver.c b/

[libvirt] [PATCH v2 0/8] Allow minimal bandwidth guarantee

2012-12-04 Thread Michal Privoznik
This is a rework of my one year old patchset [1]. If you are brave enough and start reviewing it, you may want to read the last patch first. The whole magic hidden behind the scene is documented there. For now, the only supported combination where this works is virtual interface connected to virtu

[libvirt] [PATCH v2 6/8] bandwidth: Create network bandwidth (un)plug functions

2012-12-04 Thread Michal Privoznik
Network should be notified if we plug in or unplug an interface, so it can perform some action, e.g. set/unset network part of QoS. However, we are doing this in very early stage, so iface->ifname isn't filled in yet. So whenever we want to report an error, we must use a different identifier, e.g.

[libvirt] [PATCH v2 1/8] bandwidth: Attach sfq to leaf node

2012-12-04 Thread Michal Privoznik
SFQ is qdisc which doesn't really shape any traffic but 'just' re-arrange packets in sending buffer so no stream starve. The goal is to ensure fairness. There is basically only one configuration parameter (perturb) which is set to advised value of 10. --- src/util/virnetdevbandwidth.c |9

[libvirt] [PATCH v2 4/8] bandwidth: Create (un)plug functions

2012-12-04 Thread Michal Privoznik
These set bridge part of QoS when bringing domain's interface up. Long story short, if there's a 'floor' set, a new QoS class is created. ClassID MUST be unique within the bridge and should be kept for unplug phase. --- po/POTFILES.in|1 + src/util/virnetdevbandwidth.c | 188 +

[libvirt] [PATCH v2 3/8] bandwidth: Create hierarchical shaping classes

2012-12-04 Thread Michal Privoznik
These classes can borrow unused bandwidth. Basically, only egress qdsics can have classes, therefore we can do this kind of traffic shaping only on host's outgoing, that is domain's incoming traffic. --- src/lxc/lxc_process.c |3 +- src/network/bridge_driver.c |3 +- src/qemu/qem

[libvirt] [PATCH v2 8/8] domain: Keep assigned class_id in domstatus XML

2012-12-04 Thread Michal Privoznik
Interfaces keeps a class_id, which is an ID from which bridge part of QoS settings is derived. We need to store class_id in domain status file, so we can later pass it to virNetDevBandwidthUnplug. --- src/conf/domain_conf.c | 13 + 1 files changed, 13 insertions(+), 0 deletions(-) d

[libvirt] [PATCH v2 5/8] bandwidth: Create rate update function

2012-12-04 Thread Michal Privoznik
This will be used whenever a NIC with guaranteed throughput is to be plugged into a bridge. It will adjust the average throughput of non guaranteed NICs (classid 1:2) to meet new requirements. --- src/util/virnetdevbandwidth.c | 49 + src/util/virnetdevban

[libvirt] [PATCH v2 7/8] network: Create real network status files

2012-12-04 Thread Michal Privoznik
Currently, we are only keeping a inactive XML configuration in status dir. This is no longer enough as we need to keep this class_id attribute so we don't overwrite old entries when the daemon restarts. However, since there has already been release which has just as root element, and we want to ke

[libvirt] [PATCH v2 2/8] bandwidth: add new 'floor' attribute

2012-12-04 Thread Michal Privoznik
This is however supported only on domain interfaces with type='network'. Moreover, target network needs to have at least inbound QoS set. This is required by hierarchical traffic shaping. >From now on, the required attribute for is either 'average' (old) or 'floor' (new). This new attribute can b

Re: [libvirt] [PATCH] qemu: nicer error message if live disk snapshot unsupported

2012-12-04 Thread Jiri Denemark
On Tue, Dec 04, 2012 at 23:10:18 +0800, Osier Yang wrote: > On 2012年12月04日 05:33, Eric Blake wrote: ... > > diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c > > index 8e838cd..fbacd8b 100644 > > --- a/src/qemu/qemu_driver.c > > +++ b/src/qemu/qemu_driver.c > > @@ -11230,6 +11230,11 @@

Re: [libvirt] [PATCH] qemu: nicer error message if live disk snapshot unsupported

2012-12-04 Thread Eric Blake
On 12/04/2012 08:43 AM, Osier Yang wrote: > On 2012年12月04日 05:33, Eric Blake wrote: >> Without this patch, attempts to create a disk snapshot when qemu >> is too old results in a cryptic message: >> >> virsh # snapshot-create 23 --disk-only >> error: operation failed: Failed to take snapshot: unkno

[libvirt] [PATCH] qemu: improve error for failed JSON commands

2012-12-04 Thread Eric Blake
Only one error in qemu_monitor was already using the relatively new OPERATION_UNSUPPORTED error, even though it is a better fit for all of the messages related to options that are unsupported due to the version of qemu in use rather than due to a user's XML or .conf file choice. Suggested by Osier

Re: [libvirt] [PATCH] qemu: improve error for failed JSON commands

2012-12-04 Thread Peter Krempa
On 12/04/12 21:26, Eric Blake wrote: Only one error in qemu_monitor was already using the relatively new OPERATION_UNSUPPORTED error, even though it is a better fit for all of the messages related to options that are unsupported due to the version of qemu in use rather than due to a user's XML or

[libvirt] [PATCH] net: support set public ip for forward mode nat

2012-12-04 Thread Natanael Copa
Support setting which public ip to use for NAT via attribute publicaddr. This will construct an iptables line using '-j SNAT --to-source ' instead of '-j MASQUERADE'. Signed-off-by: Natanael Copa --- This depends on previous sent iptables refactor patch. http://www.mail-archive.com/libvir-list@re

[libvirt] [PATCH v2 4/4] util: Do not keep PCI device config file open

2012-12-04 Thread Jiri Denemark
Directly open and close PCI config file in the APIs that need it rather than keeping the file open for the whole life of PCI device structure. --- src/util/pci.c | 265 + 1 file changed, 156 insertions(+), 109 deletions(-) diff --git a/src/u

[libvirt] [PATCH] rpc: fix build failure with older dbus

2012-12-04 Thread Eric Blake
RHEL 6.3 uses dbus-devel-1.2.24, which lacked support for the DBUS_TYPE_UNIX_FD define (contrast with Fedora 18 using 1.6.8). But since it is an older dbus, it also lacks support for shutdown inhibitions as provided by newer systemd. Compilation failure introduced in commit 31330926. * src/rpc/vi

Re: [libvirt] [PATCH] qemu: improve error for failed JSON commands

2012-12-04 Thread Eric Blake
On 12/04/2012 01:46 PM, Peter Krempa wrote: > On 12/04/12 21:26, Eric Blake wrote: >> Only one error in qemu_monitor was already using the relatively >> new OPERATION_UNSUPPORTED error, even though it is a better fit >> for all of the messages related to options that are unsupported >> due to the v

Re: [libvirt] [PATCH v15] support offline migration

2012-12-04 Thread li guang
Hi, Jirka Please ... Thanks! 在 2012-11-27二的 09:22 +0100,Jiri Denemark写道: > On Tue, Nov 27, 2012 at 08:45:24 +0800, li guang wrote: > > Hi, Jirka > > > > waiting for your comment ... > > Hi, > > Don't worry, I returned from vacation yesterday and I'll get to your patch > sometime this week. >

[libvirt] [jenk...@libvirt.sigxcpu.org: Build failed in Jenkins: libvirt-tck-debian-wheezy-qemu-session #227]

2012-12-04 Thread Guido Günther
Hi, this commit ae2163f852448fafce3bfcb2814e823d18e394ea Only let VM drivers block libvirtd timed shutdown broke the libvirt-tck integration build with qemu:///session: http://honk.sigxcpu.org:8001/job/libvirt-tck-debian-wheezy-qemu-session/227/console I won't have a chance to look into this

Re: [libvirt] [PATCH v2 4/4] util: Do not keep PCI device config file open

2012-12-04 Thread li guang
在 2012-12-04二的 23:23 +0100,Jiri Denemark写道: > Directly open and close PCI config file in the APIs that need it rather > than keeping the file open for the whole life of PCI device structure. > --- > src/util/pci.c | 265 > + > 1 file changed

Re: [libvirt] ivshmem server

2012-12-04 Thread Cam Macdonell
On Tue, Dec 4, 2012 at 3:57 AM, Andrew Jones wrote: > Cam, > > ping > > Please let us know your opinion on integrating ivshmem-server > into libvirt. Also, please confirm the licensing would allow it. > > Thanks, > Drew Hi, Apologies for missing this until now, I'll make sure to keep an eye here

[libvirt] [PATCH 0/2] require dbus on Fedora-based systems

2012-12-04 Thread Eric Blake
https://bugzilla.redhat.com/show_bug.cgi?id=830201 Ultimately, I want to figure out if it is possible to configure --without-dbus, and still get libvirtd to boot. However, that is less urgent than fixing things so that on Fedora and RHEL, the dbus package is installed up front, since we have the

[libvirt] [PATCH 1/2] systemd: require dbus service

2012-12-04 Thread Eric Blake
https://bugzilla.redhat.com/show_bug.cgi?id=830201 The initscript and upstart services depend on dbus starting before libvirtd. When we first wrote the systemd script, we tried to do the same, but we depended on dbus.target (which does not exist) in comparison to network.target (which does exist)

[libvirt] [PATCH 2/2] spec: require dbus-daemon when using libvirtd in Fedora

2012-12-04 Thread Eric Blake
https://bugzilla.redhat.com/show_bug.cgi?id=830201 In older Fedora, the spec file for libivrt depended on avahi, which included avahi-daemon, which in turn depended on dbus. But now that avahi libs and avahi-daemon are (correctly) in separate pacakges, and since we REALLY don't want a mandatory d

Re: [libvirt] [PATCH 1/2] systemd: require dbus service

2012-12-04 Thread Eric Blake
On 12/04/2012 08:34 PM, Eric Blake wrote: > https://bugzilla.redhat.com/show_bug.cgi?id=830201 > > The initscript and upstart services depend on dbus starting > before libvirtd. When we first wrote the systemd script, we > tried to do the same, but we depended on dbus.target (which > does not exi

[libvirt] [PATCHv2 2/2] spec: require dbus-daemon when using libvirtd in Fedora

2012-12-04 Thread Eric Blake
https://bugzilla.redhat.com/show_bug.cgi?id=830201 In older Fedora, the spec file for libivrt depended on avahi, which included avahi-daemon, which in turn depended on dbus. But now that avahi libs and avahi-daemon are (correctly) in separate pacakges, and since we REALLY don't want a mandatory d

[libvirt] [PATCHv2 1/2] systemd: require dbus service

2012-12-04 Thread Eric Blake
https://bugzilla.redhat.com/show_bug.cgi?id=830201 The initscript and upstart services depend on dbus starting before libvirtd. When we first wrote the systemd script, we tried to do the same, but we depended on dbus.target (which does not exist) in comparison to network.target (which does exist)

Re: [libvirt] [PATCH] qemu: Simplify the codes

2012-12-04 Thread Eric Blake
On 12/04/2012 10:29 AM, Osier Yang wrote: s/codes/code/ in the subject > "disk" is initialized to "dev->data.disk" in the beginning of the > function. > --- > src/qemu/qemu_driver.c |5 ++--- > 1 files changed, 2 insertions(+), 3 deletions(-) ACK. > > diff --git a/src/qemu/qemu_driver.c b

[libvirt] [PATCH] storage: Remove the redundant white lines

2012-12-04 Thread Osier Yang
Pushed under trivial rule. --- src/storage/storage_backend.c |2 -- 1 files changed, 0 insertions(+), 2 deletions(-) diff --git a/src/storage/storage_backend.c b/src/storage/storage_backend.c index 41a19a1..83c4755 100644 --- a/src/storage/storage_backend.c +++ b/src/storage/storage_backend.c

Re: [libvirt] [PATCHv2 1/2] systemd: require dbus service

2012-12-04 Thread Guannan Ren
On 12/05/2012 11:43 AM, Eric Blake wrote: https://bugzilla.redhat.com/show_bug.cgi?id=830201 The initscript and upstart services depend on dbus starting before libvirtd. When we first wrote the systemd script, we tried to do the same, but we depended on dbus.target (which does not exist) in com

  1   2   >