[libvirt] [PATCH v2 0/3] Add support for vCPU and I/O thread scheduler setting

2015-02-10 Thread Martin Kletzander
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1178986 v2: - No dependency on sched.h unless really needed - Docs fixed according to John - RNG schema matches parsing - Possibility to specify one element for whole mask of vcpus/iothreads - leaks fixed (VIR_FREE(nodes);) O:-) - not

[libvirt] [PATCH v2 3/3] qemu: Add support for setting vCPU and I/O thread scheduler setting

2015-02-10 Thread Martin Kletzander
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1178986 Signed-off-by: Martin Kletzander mklet...@redhat.com --- src/qemu/qemu_driver.c | 5 + src/qemu/qemu_process.c | 57 - src/qemu/qemu_process.h | 5 - 3 files changed, 65

[libvirt] [PATCH v2 2/3] docs, schema, conf: Add support for setting scheduler parameters of guest threads

2015-02-10 Thread Martin Kletzander
In order for QEMU vCPU (and other) threads to run with RT scheduler, libvirt needs to take care of that so QEMU doesn't have to run privileged. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1178986 Signed-off-by: Martin Kletzander mklet...@redhat.com --- docs/formatdomain.html.in

[libvirt] [PATCH] domain: include portgroup in interface status xml

2015-02-10 Thread Laine Stump
Prior to commit 7d5bf484747 (first appearing in libvirt 1.2.2), the status XML of a domain's interface was missing a lot of important information; mainly it just output the config of the interface, plus the name of the tap device and qemu device alias. Commit 7d5bf484747 changed the status XML to

Re: [libvirt] [PATCH] storage: rbd: Improve the error when start a pool based on non-exist rados object

2015-02-10 Thread Shanzhi Yu
On 02/06/2015 08:55 PM, Ján Tomko wrote: On Fri, Feb 06, 2015 at 07:45:37PM +0800, Shanzhi Yu wrote: When start/create a pool based on non-exist rados object, the error will be like $virsh pool-start p-c error: Failed to start pool p-c error: failed to create the RBD IoCTX. Does the pool

Re: [libvirt] [PATCH] virsh: fix show the wrong IP address for network type listen address graphic

2015-02-10 Thread lhuang
On 02/11/2015 04:40 AM, Laine Stump wrote: On 02/10/2015 04:35 AM, Luyao Huang wrote: https://bugzilla.redhat.com/show_bug.cgi?id=1191016 We try to get the IP address in /domain/devices/graphics/@listen, howerver for the network type listen address donnot have this parameter, it will show the

Re: [libvirt] [PATCH] virsh: fix show the wrong IP address for network type listen address graphic

2015-02-10 Thread lhuang
On 02/11/2015 04:40 AM, Laine Stump wrote: On 02/10/2015 04:35 AM, Luyao Huang wrote: https://bugzilla.redhat.com/show_bug.cgi?id=1191016 We try to get the IP address in /domain/devices/graphics/@listen, howerver for the network type listen address donnot have this parameter, it will show the

[libvirt] [PATCH v2 0/4] security: Add check for invalid security models and duplicates

2015-02-10 Thread Erik Skultety
Erik Skultety (4): security: Refactor virSecurityManagerGenLabel security: introduce virSecurityManagerCheckAllLabel function conf: forbid seclabel duplicates for domain devices schema: allow multiple seclabel for devices in domaincommon.rng docs/schemas/domaincommon.rng

[libvirt] [PATCH v2 4/4] schema: allow multiple seclabel for devices in domaincommon.rng

2015-02-10 Thread Erik Skultety
In our RNG schema we do allow multiple (different) seclabels per-domain, but don't allow this for devices, yet we neither have a check in our XML parser, nor in a post-parse callback. In that case we should allow multiple (different) seclabels for devices as well. ---

Re: [libvirt] [PATCH] qemu: do upfront check for vcpupids being null when querying pinning

2015-02-10 Thread Serge Hallyn
Quoting Daniel P. Berrange (berra...@redhat.com): The qemuDomainHelperGetVcpus attempted to report an error when the vcpupids info was NULL. Unfortunately earlier code would clamp the value of 'maxinfo' to 0 when nvcpupids was 0, so the error reporting would end up being skipped. This lead

[libvirt] [PATCH v2 1/4] security: Refactor virSecurityManagerGenLabel

2015-02-10 Thread Erik Skultety
Before we generate a security label (security driver with dynamic labeling) for a domain, we first check for domain's security model validity. We should also check devices' security model as well, therefore it might be better to move this chunk of code in a separate function which would check both

[libvirt] [PATCH v2 3/4] conf: forbid seclabel duplicates for domain devices

2015-02-10 Thread Erik Skultety
Parser checks for per-domain seclabel duplicates, so it would be nice if it checked for per-device seclabel duplicates the same way Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1165485 --- src/conf/domain_conf.c | 9 ++

[libvirt] [PATCH v2] qemu: fix setting of VM CPU affinity with TCG

2015-02-10 Thread Daniel P. Berrange
If a previous commit I fixed the incorrect handling of vcpu pids for TCG mode QEMU: commit b07f3d821dfb11a118ee75ea275fd6ab737d9500 Author: Daniel P. Berrange berra...@redhat.com Date: Thu Dec 18 16:34:39 2014 + Don't setup fake CPU pids for old QEMU The code assumes that

Re: [libvirt] virsh vcpuinfo with tcg

2015-02-10 Thread Daniel P. Berrange
On Mon, Feb 09, 2015 at 04:01:55PM +, Daniel P. Berrange wrote: On Mon, Feb 09, 2015 at 03:20:28PM +, Serge Hallyn wrote: Hi, 'virsh vcpuinfo' in 1.2.12 returns an empty line for VMs using tcg. I assume this is due to commit b07f3d821dfb11 which explicitly sets nvcpupids to 0

[libvirt] [PATCH v2 2/4] security: introduce virSecurityManagerCheckAllLabel function

2015-02-10 Thread Erik Skultety
We do have a check for valid per-domain security model, however we still do permit an invalid security model for a domain's device (those which are specified with source element). This patch introduces a new function virSecurityManagerCheckAllLabel which compares user specified security model

[libvirt] [PATCH] qemu: do upfront check for vcpupids being null when querying pinning

2015-02-10 Thread Daniel P. Berrange
The qemuDomainHelperGetVcpus attempted to report an error when the vcpupids info was NULL. Unfortunately earlier code would clamp the value of 'maxinfo' to 0 when nvcpupids was 0, so the error reporting would end up being skipped. This lead to 'virsh vcpuinfo dom' just returning an empty list

[libvirt] [PATCH] qemu: fix setting of VM CPU affinity with TCG

2015-02-10 Thread Daniel P. Berrange
If a previous commit I fixed the incorrect handling of vcpu pids for TCG mode QEMU: commit b07f3d821dfb11a118ee75ea275fd6ab737d9500 Author: Daniel P. Berrange berra...@redhat.com Date: Thu Dec 18 16:34:39 2014 + Don't setup fake CPU pids for old QEMU The code assumes that

Re: [libvirt] [PATCH] conf: disallow invalid values for video attributes

2015-02-10 Thread Ján Tomko
On Tue, Feb 10, 2015 at 09:06:24AM +0100, Martin Kletzander wrote: Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1190956 Signed-off-by: Martin Kletzander mklet...@redhat.com --- src/conf/domain_conf.c| 8

[libvirt] [PATCH] conf: disallow invalid values for video attributes

2015-02-10 Thread Martin Kletzander
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1190956 Signed-off-by: Martin Kletzander mklet...@redhat.com --- src/conf/domain_conf.c| 8 ...v-seclabel-dynamic-none.xml = qemuxml2argv-video-invalid.xml} | 4 +++-

Re: [libvirt] [PATCH 11/12] qemu: Implement random number generator hotplug

2015-02-10 Thread Peter Krempa
On Mon, Feb 09, 2015 at 16:57:17 +0100, Ján Tomko wrote: On Fri, Feb 06, 2015 at 04:32:25PM +0100, Peter Krempa wrote: From: Luyao Huang lhu...@redhat.com Export the required helpers and add backend code to hotplug RNG devices. Signed-off-by: Luyao Huang lhu...@redhat.com

[libvirt] [PATCH] virsh: fix show the wrong IP address for network type listen address graphic

2015-02-10 Thread Luyao Huang
https://bugzilla.redhat.com/show_bug.cgi?id=1191016 We try to get the IP address in /domain/devices/graphics/@listen, howerver for the network type listen address donnot have this parameter, it will show the address in the /domain/devices/graphics/listen/@address, running XML like this:

Re: [libvirt] [PATCH 00/12] Implement random number generator hot/cold (un)plug

2015-02-10 Thread Peter Krempa
On Mon, Feb 09, 2015 at 16:58:07 +0100, Ján Tomko wrote: On Fri, Feb 06, 2015 at 04:32:14PM +0100, Peter Krempa wrote: Extension of Luyao's series with changes that were possible due to the prepare series for memory hotplug. ACK series, see my replies to individual patches for

Re: [libvirt] [PATCH 07/12] qemu: command: Refactor creation of RNG device commandline

2015-02-10 Thread Peter Krempa
On Mon, Feb 09, 2015 at 16:54:00 +0100, Ján Tomko wrote: On Fri, Feb 06, 2015 at 04:32:21PM +0100, Peter Krempa wrote: As the RNG device is using an -object as backend refactor the code to use the JSON to commandline generator so that we can reuse the code later in hotplug. ---

[libvirt] [PATCH v3 5/9] virstoragefile: change backingStore to backingStores.

2015-02-10 Thread Matthias Gatto
The backingStore field was a virStorageSourcePtr. because a quorum can contain more that one backingStore at the same level it's now a 'virStorageSourcePtr *'. This patch rename src-backingStore to src-backingStores, add a static function virStorageSourceExpandBackingStore

[libvirt] [PATCH v3 8/9] qemu: Add quorum support in qemuBuildDriveDevStr

2015-02-10 Thread Matthias Gatto
Allow to libvirt to build the quorum string used by quemu. Add 2 static functions: qemuBuildQuorumStr and qemuBuildAndAppendDriveStrToVirBuffer. qemuBuildQuorumStr is made because a quorum can have another quorum as a child, so we may need to call qemuBuildQuorumStr recursively.

[libvirt] [PATCH v3 6/9] virstoragefile: Add quorum in virstoragefile

2015-02-10 Thread Matthias Gatto
Add VIR_STORAGE_TYPE_QUORUM in virStorageType. Add VIR_STORAGE_FILE_QUORUM in virStorageFileFormat. Add threshold value in _virStorageSource Signed-off-by: Matthias Gatto matthias.ga...@outscale.com --- docs/formatdomain.html.in | 20 +- docs/schemas/domaincommon.rng | 90

[libvirt] [PATCH v3 0/9] qemu: Add quorum support to libvirt

2015-02-10 Thread Matthias Gatto
The purpose of these patches is to introduce quorum for libvirt I've try to follow this proposal: http://www.redhat.com/archives/libvir-list/2014-May/msg00533.html This feature ask for 6 task: 1) Allow a _virStorageSource to contain more than one backing store. Because all the actual libvirt

[libvirt] [PATCH v3 3/9] virstoragefile: Add virStorageSourceSetBackingStore

2015-02-10 Thread Matthias Gatto
As explained for virStorageSourceGetBackingStore, quorum allows multiple backing store, this make the operation to set bs complex because we have to check if the backingStore is used as an array or a pointer, and set it differently in both case. In order to help the manipulation of backing store,

[libvirt] [PATCH v3 7/9] domain_conf: Read and Write quorum config

2015-02-10 Thread Matthias Gatto
Add the capabiltty to libvirt to parse and format the quorum syntax as described here: http://www.redhat.com/archives/libvir-list/2014-May/msg00533.html Signed-off-by: Matthias Gatto matthias.ga...@outscale.com --- src/conf/domain_conf.c | 164 +++-- 1

[libvirt] [PATCH v3 1/9] virstoragefile: Add virStorageSourceGetBackingStore

2015-02-10 Thread Matthias Gatto
Create virStorageSourceGetBackingStore function in preparation for quorum: Actually, if we want to get a backing store inside a virStorageSource we have to do it manually(src-backingStore = backingStore). The problem is that with a quorum, a virStorageSource can contain multiple backing stores,

[libvirt] [PATCH v3 4/9] virstoragefile: Always use virStorageSourceSetBackingStore to set backing store

2015-02-10 Thread Matthias Gatto
Replace the parts of the code where a backing store is set manually with virStorageSourceSetBackingStore Signed-off-by: Matthias Gatto matthias.ga...@outscale.com --- src/conf/domain_conf.c| 3 ++- src/conf/storage_conf.c | 7 +-- src/qemu/qemu_driver.c

[libvirt] [PATCH] Fix qemu job handling in SetSchedulerParameters

2015-02-10 Thread Ján Tomko
Commit c5ee5cf added a job to SetSchedulerParameters, but forgot to change one label in the SCHED_RANGE_CHECK macro. --- Not yet released. src/qemu/qemu_driver.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index

[libvirt] [PATCH v3 2/9] virstoragefile: Always use virStorageSourceGetBackingStore to get backing store

2015-02-10 Thread Matthias Gatto
Uniformize backing store usage by calling virStorageSourceGetBackingStore instead of setting backing store manually. Signed-off-by: Matthias Gatto matthias.ga...@outscale.com --- src/conf/domain_conf.c| 7 --- src/conf/storage_conf.c | 18 ++

Re: [libvirt] [PATCH] Fix qemu job handling in SetSchedulerParameters

2015-02-10 Thread Peter Krempa
On Tue, Feb 10, 2015 at 14:41:49 +0100, Ján Tomko wrote: Commit c5ee5cf added a job to SetSchedulerParameters, but forgot to change one label in the SCHED_RANGE_CHECK macro. --- Not yet released. src/qemu/qemu_driver.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[libvirt] [PATCH v3 9/9] virstoragefile: Add node-name

2015-02-10 Thread Matthias Gatto
Add nodename inside virstoragefile During xml backingStore parsing, look for a nodename attribute in the disk declaration if this one is a quorum, if a nodename is found, add it to the virStorageSource otherwise create a new one with a random name. Take inspiration from this patch to create the

Re: [libvirt] [PATCH] qemu: do upfront check for vcpupids being null when querying pinning

2015-02-10 Thread Serge Hallyn
Quoting Serge Hallyn (serge.hal...@ubuntu.com): Quoting Daniel P. Berrange (berra...@redhat.com): The qemuDomainHelperGetVcpus attempted to report an error when the vcpupids info was NULL. Unfortunately earlier code would clamp the value of 'maxinfo' to 0 when nvcpupids was 0, so the error

Re: [libvirt] [PATCH] qemu: fix setting of VM CPU affinity with TCG

2015-02-10 Thread Serge Hallyn
Quoting Daniel P. Berrange (berra...@redhat.com): If a previous commit I fixed the incorrect handling of vcpu pids for TCG mode QEMU: commit b07f3d821dfb11a118ee75ea275fd6ab737d9500 Author: Daniel P. Berrange berra...@redhat.com Date: Thu Dec 18 16:34:39 2014 + Don't

Re: [libvirt] [PATCH] virsh: fix show the wrong IP address for network type listen address graphic

2015-02-10 Thread Laine Stump
On 02/10/2015 04:35 AM, Luyao Huang wrote: https://bugzilla.redhat.com/show_bug.cgi?id=1191016 We try to get the IP address in /domain/devices/graphics/@listen, howerver for the network type listen address donnot have this parameter, it will show the address in the

[libvirt] [PATCH 1/2] domain: backfill listen address to parent graphics listen attribute

2015-02-10 Thread Laine Stump
Prior to 0.9.4, libvirt only supported a single listen, and it had to be an IP address: graphics listen='1.2.3.4' / Starting with 0.9.4, a graphics element could have a listen subelement (actually the grammar supports multiples, but all of the drivers only support a single listen per

[libvirt] [PATCH 0/2] Two fixes for graphics listen

2015-02-10 Thread Laine Stump
These area a followup to Luyao Huang's patch to fix incorrect reporting from virsh domdisplay: https://www.redhat.com/archives/libvir-list/2015-February/msg00298.html While his patch works when the remote libvirtd is 0.9.4 or greater, it won't work when talking to older libvirt. Also the code

[libvirt] [PATCH 2/2] domain: avoid potential memory leak in virDomainGraphicsListenSet*()

2015-02-10 Thread Laine Stump
virDomainGraphicsListenSetAddress() and virDomainGraphicsListenSetNetwork() both set their respective char* to NULL directly when asked to set it to NULL, which is okay as long as it's already set to NULL. If these functions are ever called to clear a listen object that has a valid string in

[libvirt] [PATCH] qemu: fix crash in migrate when migrateuri do not have a scheme

2015-02-10 Thread Luyao Huang
https://bugzilla.redhat.com/show_bug.cgi?id=1191355 When we migrate a vm with migrateuri option with a uri do not have scheme like this: # virsh migrate test4 --live qemu+ssh://lhuang/system --migrateuri 127.0.0.1 target libvirtd will crashed because uri-scheme is NULL in

Re: [libvirt] [PATCH] qemu: fix crash in migrate when migrateuri do not have a scheme

2015-02-10 Thread Shanzhi Yu
On 02/11/2015 03:41 PM, Luyao Huang wrote: https://bugzilla.redhat.com/show_bug.cgi?id=1191355 When we migrate a vm with migrateuri option with a uri do not have scheme like this: # virsh migrate test4 --live qemu+ssh://lhuang/system --migrateuri 127.0.0.1 target libvirtd will crashed

Re: [libvirt] [PATCH] storage: rbd: Improve the error when start a pool based on non-exist rados object

2015-02-10 Thread Ján Tomko
On Wed, Feb 11, 2015 at 11:02:36AM +0800, Shanzhi Yu wrote: On 02/06/2015 08:55 PM, Ján Tomko wrote: On Fri, Feb 06, 2015 at 07:45:37PM +0800, Shanzhi Yu wrote: When start/create a pool based on non-exist rados object, the error will be like $virsh pool-start p-c error: Failed to

[libvirt] [PATCH v2 1/3] util: Add virProcessSetScheduler() function for scheduler settings

2015-02-10 Thread Martin Kletzander
This function uses sched_setscheduler() function so it works with processes and threads as well (even threads not created by us, which is what we'll need in the future). Signed-off-by: Martin Kletzander mklet...@redhat.com --- configure.ac | 4 +- src/libvirt_private.syms | 1 +

Re: [libvirt] [PATCH 00/12] Implement random number generator hot/cold (un)plug

2015-02-10 Thread Luyao Huang
On 02/10/2015 08:10 PM, Peter Krempa wrote: On Mon, Feb 09, 2015 at 16:58:07 +0100, Ján Tomko wrote: On Fri, Feb 06, 2015 at 04:32:14PM +0100, Peter Krempa wrote: Extension of Luyao's series with changes that were possible due to the prepare series for memory hotplug. ACK series, see my