Re: [libvirt] [PATCH 1/6] conf: create common storage RNG grammar file

2014-04-14 Thread Ján Tomko
On 04/13/2014 04:27 AM, Eric Blake wrote: Having two tiny files with a couple definitions didn't make as much sense as one common file, especially since I plan to add more definitions and use it in more places. * docs/schemas/storageencryption.rng: Merge this... *

Re: [libvirt] [PATCH 0/2] bhyve: implement connectDomainXMLToNative

2014-04-14 Thread Daniel P. Berrange
On Sun, Apr 13, 2014 at 02:22:32PM +0400, Roman Bogorodskiy wrote: One thing I'm wondering about. Bhyve has two step domain startup: 1. bhyveload 2. bhyve This implementation prints out only 'bhyve' command. Should it also print bhyveload command and if yes, how should it look for a

Re: [libvirt] [PATCH] RFC: bhyve: implement PCI address allocation

2014-04-14 Thread Laine Stump
On 04/13/2014 08:53 AM, Roman Bogorodskiy wrote: Hi, This is the first attempt to implement PCI address allocation for the bhyve driver. This patch is by no means a complete version and the idea of this is to understand if I'm moving in a right direction. This code is based on the one from

Re: [libvirt] [PATCH 0/2] bhyve: implement connectDomainXMLToNative

2014-04-14 Thread Roman Bogorodskiy
Daniel P. Berrange wrote: On Sun, Apr 13, 2014 at 02:22:32PM +0400, Roman Bogorodskiy wrote: One thing I'm wondering about. Bhyve has two step domain startup: 1. bhyveload 2. bhyve This implementation prints out only 'bhyve' command. Should it also print bhyveload command and

Re: [libvirt] [PATCH] RFC: bhyve: implement PCI address allocation

2014-04-14 Thread Roman Bogorodskiy
Laine Stump wrote: On 04/13/2014 08:53 AM, Roman Bogorodskiy wrote: Hi, This is the first attempt to implement PCI address allocation for the bhyve driver. This patch is by no means a complete version and the idea of this is to understand if I'm moving in a right direction. This

[libvirt] [PATCH] build: Embed dbus_message_unref in virdbus

2014-04-14 Thread Martin Kletzander
Adding dbus_message_unref() into virDBusMessageDecodeArgs() makes sure that the message gets unref'd, thus making one more pure dbus call not necessary. Even though we are calling a lot of dbus_* functions outside virdbus (which should be fixed in the future IMHO), this patch fixes only this one

Re: [libvirt] [PATCH] build: Embed dbus_message_unref in virdbus

2014-04-14 Thread Daniel P. Berrange
On Mon, Apr 14, 2014 at 01:41:18PM +0200, Martin Kletzander wrote: Adding dbus_message_unref() into virDBusMessageDecodeArgs() makes sure that the message gets unref'd, thus making one more pure dbus call not necessary. Even though we are calling a lot of dbus_* functions outside virdbus

Re: [libvirt] [PATCH] build: Embed dbus_message_unref in virdbus

2014-04-14 Thread Martin Kletzander
On Mon, Apr 14, 2014 at 01:02:02PM +0100, Daniel P. Berrange wrote: On Mon, Apr 14, 2014 at 01:41:18PM +0200, Martin Kletzander wrote: Adding dbus_message_unref() into virDBusMessageDecodeArgs() makes sure that the message gets unref'd, thus making one more pure dbus call not necessary. Even

Re: [libvirt] [java] [PATCH] GetNodeCpuStat binding

2014-04-14 Thread Claudio Bley
At Thu, 10 Apr 2014 17:49:07 +0200, phate...@gmail.com wrote: From: Pasquale Di Rienzo phate...@gmail.com -Added the getNodeCpuStat binding to Libvirt class -Added virNodeCPUStats and CPUStat classes to support this binding -Added the method getCPUStats to Connect class --- AUTHORS

Re: [libvirt] [PATCH] build: Embed dbus_message_unref in virdbus

2014-04-14 Thread Daniel P. Berrange
On Mon, Apr 14, 2014 at 02:20:11PM +0200, Martin Kletzander wrote: On Mon, Apr 14, 2014 at 01:02:02PM +0100, Daniel P. Berrange wrote: On Mon, Apr 14, 2014 at 01:41:18PM +0200, Martin Kletzander wrote: Adding dbus_message_unref() into virDBusMessageDecodeArgs() makes sure that the message gets

Re: [libvirt] [PATCH] qemu: Avoid overflow when setting migration speed

2014-04-14 Thread Jiri Denemark
On Fri, Apr 11, 2014 at 08:31:51 -0600, Eric Blake wrote: On 04/11/2014 04:52 AM, Jiri Denemark wrote: When passing migration bandwidth to QEMU, we multiply it by 1024 * 1024 to convert the speed to B/s and the result still needs to fit in int64_t.

Re: [libvirt] [PATCH] build: Embed dbus_message_unref in virdbus

2014-04-14 Thread Martin Kletzander
On Mon, Apr 14, 2014 at 01:33:21PM +0100, Daniel P. Berrange wrote: On Mon, Apr 14, 2014 at 02:20:11PM +0200, Martin Kletzander wrote: On Mon, Apr 14, 2014 at 01:02:02PM +0100, Daniel P. Berrange wrote: On Mon, Apr 14, 2014 at 01:41:18PM +0200, Martin Kletzander wrote: Adding

Re: [libvirt] [PATCH 1/6] conf: create common storage RNG grammar file

2014-04-14 Thread Eric Blake
On 04/14/2014 01:22 AM, Ján Tomko wrote: On 04/13/2014 04:27 AM, Eric Blake wrote: Having two tiny files with a couple definitions didn't make as much sense as one common file, especially since I plan to add more definitions and use it in more places. There are still some references to

Re: [libvirt] [PATCH] build: Embed dbus_message_unref in virdbus

2014-04-14 Thread Daniel P. Berrange
On Mon, Apr 14, 2014 at 02:51:18PM +0200, Martin Kletzander wrote: On Mon, Apr 14, 2014 at 01:33:21PM +0100, Daniel P. Berrange wrote: On Mon, Apr 14, 2014 at 02:20:11PM +0200, Martin Kletzander wrote: On Mon, Apr 14, 2014 at 01:02:02PM +0100, Daniel P. Berrange wrote: On Mon, Apr 14, 2014 at

Re: [libvirt] [PATCH] build: Embed dbus_message_unref in virdbus

2014-04-14 Thread Martin Kletzander
On Mon, Apr 14, 2014 at 02:29:36PM +0100, Daniel P. Berrange wrote: On Mon, Apr 14, 2014 at 02:51:18PM +0200, Martin Kletzander wrote: On Mon, Apr 14, 2014 at 01:33:21PM +0100, Daniel P. Berrange wrote: On Mon, Apr 14, 2014 at 02:20:11PM +0200, Martin Kletzander wrote: On Mon, Apr 14, 2014 at

[libvirt] [PATCH 0/2] Add support of SASL authentication for QEMU migration

2014-04-14 Thread Sahid Orentino Ferdjaoui
This is a first contribution, I have tried to follow the most as possible rules marked in HACKING. I hope this commit will be conform with the specifications. make check OK make syntax-check OK make -C tests valgrind OK Currently with peer to peer migration provided by

[libvirt] [PATCH 1/2] Add a new example to illustrate domain migration

2014-04-14 Thread Sahid Orentino Ferdjaoui
This commit adds a new example to illustrate peer to peer domain migration with virDomainMigrateToURI. Signed-off-by: Sahid Orentino Ferdjaoui sahid.ferdja...@cloudwatt.com --- .gitignore | 1 + Makefile.am | 2 +- configure.ac |

[libvirt] [PATCH 2/2] Add support for QEMU migration to use SASL authentication

2014-04-14 Thread Sahid Orentino Ferdjaoui
This commit provides the ability to virDomainMigrateToURI to check for SASL credentials when attempts to migrate a domain with the driver QEMU. Signed-off-by: Sahid Orentino Ferdjaoui sahid.ferdja...@cloudwatt.com --- src/qemu/qemu_migration.c | 14 +- 1 file changed, 13

[libvirt] [PATCH] build: Don't use code with dbus_message_unref when built without dbus

2014-04-14 Thread Martin Kletzander
In order to do that, virNodeSuspendSupportsTargetPMUtils() and virSystemdPMSupportTarget() are created even when pm-utils and dbus are compiled out, respectively, but in that case returning -2 meaning unavailable (this return code was already used for unavailability before). Error is reported in

Re: [libvirt] [PATCH] build: Don't use code with dbus_message_unref when built without dbus

2014-04-14 Thread Daniel P. Berrange
On Mon, Apr 14, 2014 at 04:43:09PM +0200, Martin Kletzander wrote: diff --git a/src/util/virnodesuspend.c b/src/util/virnodesuspend.c index 59b84ef..60b86ee 100644 --- a/src/util/virnodesuspend.c +++ b/src/util/virnodesuspend.c @@ -267,7 +268,14 @@ virNodeSuspendSupportsTargetPMUtils(unsigned

Re: [libvirt] [PATCHv2] virsh: Make vshCommandOpt* report error

2014-04-14 Thread Ján Tomko
On 04/04/2014 03:50 PM, Michal Privoznik wrote: Currently, the virsh code is plenty of the following pattern: if (vshCommandOptUInt(..) 0) { vshError(...); goto cleanup; } It doesn't make much sense to repeat the code everywhere. Moreover, some functions from the family

[libvirt] [PATCH v2 0/2] bhyve: implement connectDomainXMLToNative

2014-04-14 Thread Roman Bogorodskiy
Changes from v1: - Return both bhyveload and bhyve commands, not only bhyve. Roman Bogorodskiy (2): bhyve: improve bhyve_command.c testability bhyve: implement connectDomainXMLToNative src/bhyve/bhyve_command.c | 85 +--

[libvirt] [PATCH v2 1/2] bhyve: improve bhyve_command.c testability

2014-04-14 Thread Roman Bogorodskiy
* bhyve_command.c (bhyveBuildNetArgStr, virBhyveProcessBuildBhyveCmd): add dryRun mode which doesn't create any devices when enabled * bhyve_command.c (virBhyveProcessBuildBhyveCmd, virBhyveProcessBuildDestroyCmd, virBhyveProcessBuildLoadCmd): accept virDomainDefPtr instead of

[libvirt] [PATCH v2 2/2] bhyve: implement connectDomainXMLToNative

2014-04-14 Thread Roman Bogorodskiy
The only accepted format for now is 'bhyve-argv' which prints out a bhyve command corresponding to the given domain definition. --- src/bhyve/bhyve_command.h | 2 ++ src/bhyve/bhyve_driver.c | 59 +++ 2 files changed, 61 insertions(+) diff --git

Re: [libvirt] [PATCH] storage: netfs: Handle backend errors

2014-04-14 Thread Ján Tomko
On 04/09/2014 08:42 PM, John Ferlan wrote: Commit id '18642d10' caused a virt-test regression for NFS backend storage error path checks when running the command: 'virsh find-storage-pool-sources-as netfs Unknown ' when the host did not have Gluster installed. Prior to the commit, the

Re: [libvirt] [PATCH 3/6] conf: tighten domainsnapshot schema

2014-04-14 Thread Eric Blake
On 04/12/2014 08:27 PM, Eric Blake wrote: This patch is my first experience playing with nested grammars, as documented in http://relaxng.org/tutorial-20011203.html#IDA3PZR. I plan on doing more overrides in order to make the RelaxNG grammar mirror the C code refactoring into a common

Re: [libvirt] [PATCH] Add test suite for viralloc APIs

2014-04-14 Thread Ján Tomko
On 04/08/2014 04:48 PM, Daniel P. Berrange wrote: In debugging a crash on OOM, I thought that the virInsert APIs might be at fault, but couldn't isolate them as a cause. While the viralloc APIs are used in many test suites, this is as a side-effect, they are not directly tested :-)

[libvirt] [PATCH] Fix virsystemdtest without SYSTEMD_DAEMON

2014-04-14 Thread Ján Tomko
Commit 4897698 fixed the build without dbus by only building the virSystemdPMSupportTarget with SYSTEMD_DAEMON. Introduce a virDBusMessageUnref wrapper for dbus_message_unref to let virsystemd.c build without dbus, while still allowing virsystemdtest to run without SYSTEM_DAEMON. ---

Re: [libvirt] [PATCH] storage: netfs: Handle backend errors

2014-04-14 Thread John Ferlan
On 04/14/2014 12:47 PM, Ján Tomko wrote: On 04/09/2014 08:42 PM, John Ferlan wrote: Commit id '18642d10' caused a virt-test regression for NFS backend storage error path checks when running the command: 'virsh find-storage-pool-sources-as netfs Unknown ' when the host did not have

Re: [libvirt] [PATCH 00/26] Rewrite firewall code to use formal API

2014-04-14 Thread Stefan Berger
On 04/08/2014 11:37 AM, Daniel P. Berrange wrote: Currently we have three places which interact with the firewall - util/virebtables - simple MAC filtering used by QEMU driver - util/viriptables - used by network driver - nwfilter - general purpose guest filtering Oh my, so much

Re: [libvirt] [PATCH 01/26] Move virNWFilterTechDriver struct out of nwfilter_conf.h

2014-04-14 Thread Stefan Berger
On 04/08/2014 11:37 AM, Daniel P. Berrange wrote: The virNWFilterTechDriver struct is nothing todo with the nwfilter XML configuration. It stores data specific to the driver implementation so should be in a header in the driver directory instead. Signed-off-by: Daniel P. Berrange

Re: [libvirt] [PATCH 02/26] Remove virDomainNetType parameter from nwfilter drivers

2014-04-14 Thread Stefan Berger
On 04/08/2014 11:37 AM, Daniel P. Berrange wrote: The 'virDomainNetType' is unused in every impl of the virNWFilterRuleCreateInstance driver method. Remove it from the code to avoid the dependancy on the external enum. Signed-off-by: Daniel P. Berrange berra...@redhat.com I suppose this

Re: [libvirt] [PATCH 01/26] Move virNWFilterTechDriver struct out of nwfilter_conf.h

2014-04-14 Thread Eric Blake
On 04/08/2014 09:37 AM, Daniel P. Berrange wrote: The virNWFilterTechDriver struct is nothing todo with the nwfilter s/todo/to do/ XML configuration. It stores data specific to the driver implementation so should be in a header in the driver directory instead. Signed-off-by: Daniel P.

Re: [libvirt] [PATCH 02/26] Remove virDomainNetType parameter from nwfilter drivers

2014-04-14 Thread Eric Blake
On 04/08/2014 09:37 AM, Daniel P. Berrange wrote: The 'virDomainNetType' is unused in every impl of the virNWFilterRuleCreateInstance driver method. Remove it from the code to avoid the dependancy on the external enum. Signed-off-by: Daniel P. Berrange berra...@redhat.com --- +++

Re: [libvirt] [PATCH 03/26] Remove pointless storage of var names in virNWFilterHashTable

2014-04-14 Thread Stefan Berger
On 04/08/2014 11:37 AM, Daniel P. Berrange wrote: The virNWFilterHashTable struct contains a virHashTable and then a 'char **names' field which keeps a copy of all the hash keys. Presumably this was intended to record the ordering of the hash keys. No code ever uses this and the ordering is

Re: [libvirt] [PATCH 04/26] Remove nwfilter tech driver 'removeRules' callback

2014-04-14 Thread Stefan Berger
On 04/08/2014 11:37 AM, Daniel P. Berrange wrote: The 'removeRules' callback in the nwfilter tech driver is never invoked, so can be deleted. Signed-off-by: Daniel P. Berrange berra...@redhat.com ACK -- libvir-list mailing list libvir-list@redhat.com

Re: [libvirt] [PATCH 05/26] Remove nwfilter tech driver 'displayRuleInstance' callback

2014-04-14 Thread Stefan Berger
On 04/08/2014 11:37 AM, Daniel P. Berrange wrote: The 'displayRuleInstance' callback in the nwfilter tech driver is never invoked, so can be deleted. Signed-off-by: Daniel P. Berrange berra...@redhat.com ACK -- libvir-list mailing list libvir-list@redhat.com

Re: [libvirt] [PATCH 06/26] Add helper methods for determining what protocol layer is used

2014-04-14 Thread Stefan Berger
On 04/08/2014 11:37 AM, Daniel P. Berrange wrote: Add virNWFilterRuleIsProtocol{Ethernet,IPv4,IPv6} helper methods to avoid having to write a giant switch statements with many cases. Signed-off-by: Daniel P. Berrange berra...@redhat.com ACK -- libvir-list mailing list libvir-list@redhat.com

Re: [libvirt] [PATCH 03/26] Remove pointless storage of var names in virNWFilterHashTable

2014-04-14 Thread Eric Blake
On 04/08/2014 09:37 AM, Daniel P. Berrange wrote: The virNWFilterHashTable struct contains a virHashTable and then a 'char **names' field which keeps a copy of all the hash keys. Presumably this was intended to record the ordering of the hash keys. No code ever uses this and the ordering is

Re: [libvirt] [PATCH 07/26] Push virNWFilterRuleInstPtr out of (eb|ip)tablesCreateRuleInstance

2014-04-14 Thread Stefan Berger
On 04/08/2014 11:37 AM, Daniel P. Berrange wrote: Later refactoring will change use of the virNWFilterRuleInstPtr struct. Prepare for this by pushing use of the virNWFilterRuleInstPtr parameter out of the ebtablesCreateRuleInstance and iptablesCreateRuleInstance methods. Instead they simply

Re: [libvirt] [PATCH 10/26] Preserve error when tearing down nwfilter rules

2014-04-14 Thread Stefan Berger
On 04/08/2014 11:38 AM, Daniel P. Berrange wrote: When a VM fails to launch due to error creating nwfilter rules, we must avoid overwriting the original error when tearing down the partially created rules. Signed-off-by: Daniel P. Berrange berra...@redhat.com --- src/qemu/qemu_command.c | 6

[libvirt] Java Bindings ConnectAuthDefault callback never called

2014-04-14 Thread Sergio Rodriguez de Guzman
I'm following the instructions mentioned in the list some years ago about using a subclass of ConnectAuth using ConnectAuthDefault as a sample: You could create your own subclass of ConnectAuth, and override the method: public abstract int callback(Credential[] cred); What I'm doing is just

Re: [libvirt] [PATCH] Fix virsystemdtest without SYSTEMD_DAEMON

2014-04-14 Thread Eric Blake
On 04/14/2014 11:50 AM, Ján Tomko wrote: Commit 4897698 fixed the build without dbus by only building the virSystemdPMSupportTarget with SYSTEMD_DAEMON. Introduce a virDBusMessageUnref wrapper for dbus_message_unref to let virsystemd.c build without dbus, while still allowing virsystemdtest

[libvirt] [PATCHv2 2/9] conf: move storage formats to common RNG file

2014-04-14 Thread Eric Blake
We had incomplete RelaxNG support for storage formats listed in virstoragefile.h: commit 027bf2e added 'vdi' but forgot to update the volume and domain xml lists; the volume list was also missing 'fat' and 'vhd'. Maintaining two lists is a recipe for them getting out of sync, so make the list

[libvirt] [PATCHv2 0/9] RelaxNG improvements for virStorageSource

2014-04-14 Thread Eric Blake
changes since v1: ack'd patch pushed new patches 2-4 are a better rewrite of old patch 3/6 new patches 8 and 9 patch 9 is incomplete - I know where I want to be headed, but changing 400+ tests is taking a while. I tried: $ git grep -l 'driver.*type=' tests/*data/ | \ xargs sed ' /driver

[libvirt] [PATCHv2 3/9] conf: restrict external snapshots to backing store formats

2014-04-14 Thread Eric Blake
Domain snapshots should only permit an external snapshot into a storage format that permits a backing chain, since the new snapshot file necessarily must be backed by the existing file. The C code for the qemu driver is a little bit stricter in currently enforcing only qcow2 or qed, but at the XML

[libvirt] [PATCHv2 4/9] conf: set up for per-grammar overrides in schemas

2014-04-14 Thread Eric Blake
This patch is my first experience playing with nested grammars, as documented in http://relaxng.org/tutorial-20011203.html#IDA3PZR. I plan on doing more overrides in order to make the RelaxNG grammar mirror the C code refactoring into a common virStorageSource, but where different clients of that

[libvirt] [PATCHv2 1/9] conf: better disk interleaving in schema

2014-04-14 Thread Eric Blake
In general, we try to make virt-xml-validate tolerant of input elements in any order when possible. However, as written, the RNG grammar did not permit source unless there was an explicit type= attribute (even though the C code manages just fine by defaulting to type='file'). After making the

[libvirt] [PATCHv2 5/9] conf: split disk schema into more pieces

2014-04-14 Thread Eric Blake
Disk snapshots use a subset of disk sources (no directory or pool support yet, and while domain disks support a startupPolicy, it doesn't make sense for snapshots). This patch lets the two RelaxNG grammars share a bit more code, as well as factoring things into pieces that will be easier to move

[libvirt] [PATCHv2 8/9] conf: fix omission of driver in domain dumpxml

2014-04-14 Thread Eric Blake
I noticed that depending on the driver attributes the user passed in, the output may omit the driver element altogether. For example, the rerror_policy has had this problem since commit 4bb4109 in Oct 2011. But in adding testsuite coverage to expose it, I found another problem: the C code is

[libvirt] [PATCHv2 9/9] RFC: conf: introduce format as synonym of driver type=...

2014-04-14 Thread Eric Blake
Still an RFC, since this claims over 400 tests are impacted: $ git grep 'driver.*type=\(\(.\)[a-zA-Z0-9]*\2\)' tests/*data/ | wc Most uses of driver are per-disk - they affect the way the hypervisor exposes storage to the guest, regardless of how many host resources are involved. But one

[libvirt] [PATCHv2 6/9] conf: move storage source details to common RNG file

2014-04-14 Thread Eric Blake
Start reflecting the C source code by moving RelaxNG grammar for virStorageSource into a common file. There's still more to move, but doing it in pieces makes it easier to validate. * docs/schemas/domaincommon.rng (diskSourceFile, diskSourceBlock) (diskSourceDir, diskSourceNetwork,

[libvirt] [PATCHv2 7/9] conf: move auth and encryption to disk source

2014-04-14 Thread Eric Blake
In a backing chain, each file of the chain can have a different authorization or encryption; therefore, this information should be associated with the common storage source elements. * docs/schemas/domaincommon.rng (diskspec): Drop source-related portions... (disksource): ...and include common

[libvirt] why doesn't libvirt let qemu autostart live-migrated VMs?

2014-04-14 Thread Chris Friesen
Hi, I've been digging through the libvirt code and something that struck me was that it appears that when using qemu libvirt will migrate the instance with autostart disabled, then sit on the source host periodically polling for migration completion, then once the host detects that migration

Re: [libvirt] [PATCH] Fix virsystemdtest without SYSTEMD_DAEMON

2014-04-14 Thread Ján Tomko
On 04/15/2014 12:47 AM, Eric Blake wrote: On 04/14/2014 11:50 AM, Ján Tomko wrote: Commit 4897698 fixed the build without dbus by only building the virSystemdPMSupportTarget with SYSTEMD_DAEMON. Introduce a virDBusMessageUnref wrapper for dbus_message_unref to let virsystemd.c build without