[libvirt] [PATCH 1/1] numatune: Fix parsing of empty nodeset (0, ^0)

2014-08-11 Thread Erik Skultety
Resolves https://bugzilla.redhat.com/show_bug.cgi?id=1121837 --- src/conf/numatune_conf.c | 18 +++-- ...emuxml2argv-numatune-memory-invalid-nodeset.xml | 31 ++ tests/qemuxml2argvtest.c | 1 + 3 files changed, 48

[libvirt] [PATCH 1/1] qemu: min_guarantee: Parameter 'min_guarantee' not supported

2014-08-11 Thread Erik Skultety
The 'min_guarantee' is used by esx and vmx drivers, with qemu however, libvirt should report error when starting a domain, because this element is not used. Resolves https://bugzilla.redhat.com/show_bug.cgi?id=1122455 --- src/qemu/qemu_process.c | 7 +++ 1 file changed, 7 insertions(+) diff

[libvirt] [PATCHv2] numatune: Fix parsing of empty nodeset (0,^0)

2014-08-11 Thread Erik Skultety
Resolves https://bugzilla.redhat.com/show_bug.cgi?id=1121837 --- Notes: Version 2: - reject empty bitmaps while parsing instead of just rejecting nodesets src/util/virbitmap.c | 3 +++ tests/qemuxml2argvtest.c | 1 + 2 files changed, 4 insertions(+) diff --git

[libvirt] [PATCHv3] numatune: Fix parsing of empty nodeset (0,^0)

2014-08-11 Thread Erik Skultety
Resolves https://bugzilla.redhat.com/show_bug.cgi?id=1121837 --- src/util/virbitmap.c | 3 +++ ...emuxml2argv-numatune-memory-invalid-nodeset.xml | 31 ++ tests/qemuxml2argvtest.c | 1 + 3 files changed, 35

[libvirt] [PATCHv2] qemu: min_guarantee: Parameter 'min_guarantee' not supported

2014-08-13 Thread Erik Skultety
The 'min_guarantee' is used by VMware ESX and OpenVZ drivers, with qemu however, libvirt should report error when starting a domain, because this element is not used. Resolves https://bugzilla.redhat.com/show_bug.cgi?id=1122455 --- docs/formatdomain.html.in | 3 ++- src/qemu/qemu_process.c | 7

[libvirt] [PATCH] qemu: Redundant listen address entry in quest xml

2014-08-14 Thread Erik Skultety
When editing guest's XML (on QEMU), it was possible to add multiple listen elements into graphics parent element. However QEMU does not support listening on multiple addresses. This patch causes qemu post-parse callback to remove any redundant entries, leaving only 1 listening address if provided,

[libvirt] [PATCHv2] qemu: Redundant listen address entry in quest xml

2014-08-14 Thread Erik Skultety
When editing guest's XML (on QEMU), it was possible to add multiple listen elements into graphics parent element. However QEMU does not support listening on multiple addresses. Configuration is tested for multiple 'listen address' and if positive, an error is raised. --- src/qemu/qemu_process.c |

[libvirt] [PATCHv3] qemu: Redundant listen address entry in quest xml

2014-08-15 Thread Erik Skultety
When editing guest's XML (on QEMU), it was possible to add multiple listen elements into graphics parent element. However QEMU does not support listening on multiple addresses. Configuration is tested for multiple 'listen address' and if positive, an error is raised. --- src/qemu/qemu_process.c |

[libvirt] [PATCH] numatune: setting --mode does not work well

2014-08-20 Thread Erik Skultety
When trying to set numatune mode directly using virsh numatune command, correct error is raised, however numatune structure was not deallocated, thus resulting in creating an empty numatune element in the guest XML, if none was present before. Running the same command aftewards results in a

Re: [libvirt] [PATCH] numatune: setting --mode does not work well

2014-08-20 Thread Erik Skultety
'if(create)' clause inside the cleanup phase in PATCHv2. Regards, Erik On 08/20/2014 02:50 PM, Ján Tomko wrote: On 08/20/2014 12:49 PM, Erik Skultety wrote: When trying to set numatune mode directly using virsh numatune command, correct error is raised, however numatune structure

[libvirt] [PATCHv2] numatune: setting --mode does not work well

2014-08-20 Thread Erik Skultety
When trying to set numatune mode directly using virsh numatune command, correct error is raised, however numatune structure was not deallocated, thus resulting in creating an empty numatune element in the guest XML, if none was present before. Running the same command aftewards results in a

[libvirt] [PATCH] iotune: setting an invalid value now reports error

2014-08-21 Thread Erik Skultety
When trying to set an invalid value into iotune element, standard behavior was to not report any error, rather to reset all affected subelements of the iotune element back to 0 which results in ignoring those particular subelements by XML generator. Patch further examines the return code of the

[libvirt] [PATCHv3] numatune: setting --mode does not work well

2014-08-22 Thread Erik Skultety
When trying to set numatune mode directly using virsh numatune command, correct error is raised, however numatune structure was not deallocated, thus resulting in creating an empty numatune element in the guest XML, if none was present before. Running the same command aftewards results in a

[libvirt] [PATCHv2] iotune: setting an invalid value now reports error

2014-08-25 Thread Erik Skultety
When trying to set an invalid value into iotune element, standard behavior was to not report any error, rather to reset all affected subelements of the iotune element back to 0 which results in ignoring those particular subelements by XML generator. Patch further examines the return code of the

Re: [libvirt] [PATCHv2] iotune: setting an invalid value now reports error

2014-08-26 Thread Erik Skultety
Thanks. Erik On 08/25/2014 04:48 PM, Ján Tomko wrote: On 08/25/2014 10:50 AM, Erik Skultety wrote: When trying to set an invalid value into iotune element, standard behavior was to not report any error, rather to reset all affected subelements of the iotune element back to 0 which results

[libvirt] [PATCH] blkdeviotune: check for overflow when parsing XML

2014-08-26 Thread Erik Skultety
According to docs/schemas/domaincommon.rng and _virDomainBlockIoTuneInfo all the iotune values are interpreted as unsigned long long, however according to qemu_monitor_json.c, qemu silently truncates numbers larger than LLONG_MAX. There's really not much of a usage for such large numbers anyway

Re: [libvirt] [PATCH] blkdeviotune: check for overflow when parsing XML

2014-08-26 Thread Erik Skultety
enough to pass/fail the test. On 08/26/2014 11:46 AM, Martin Kletzander wrote: On Tue, Aug 26, 2014 at 10:17:22AM +0200, Erik Skultety wrote: According to docs/schemas/domaincommon.rng and _virDomainBlockIoTuneInfo all the iotune values are interpreted as unsigned long long, however according

[libvirt] [PATCHv2] blkdeviotune: check for overflow when parsing XML

2014-08-26 Thread Erik Skultety
According to docs/schemas/domaincommon.rng and _virDomainBlockIoTuneInfo all the iotune values are interpreted as unsigned long long, however according to qemu_monitor_json.c, qemu silently truncates numbers larger than LLONG_MAX. There's really not much of a usage for such large numbers anyway

[libvirt] [PATCH] virsh: fix keepalive error msg, man page update

2014-08-27 Thread Erik Skultety
resolves https://bugzilla.redhat.com/show_bug.cgi?id=1132305 --- tools/virsh.c | 14 ++ tools/virsh.pod | 6 -- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/tools/virsh.c b/tools/virsh.c index 30a84c1..f9b3991 100644 --- a/tools/virsh.c +++ b/tools/virsh.c @@

[libvirt] [PATCHv2] virsh: fix keepalive error msg, man page update

2014-08-27 Thread Erik Skultety
resolves https://bugzilla.redhat.com/show_bug.cgi?id=1132305 --- tools/virsh.c | 26 -- 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/tools/virsh.c b/tools/virsh.c index 30a84c1..713c9a5 100644 --- a/tools/virsh.c +++ b/tools/virsh.c @@ -3470,18 +3470,32

Re: [libvirt] [PATCHv2] virsh: fix keepalive error msg, man page update

2014-08-28 Thread Erik Skultety
Thank you for review. Sure, you're right, I'll definitely follow your advice next time. Erik On 08/27/2014 05:03 PM, Eric Blake wrote: On 08/27/2014 08:20 AM, Erik Skultety wrote: resolves https://bugzilla.redhat.com/show_bug.cgi?id=1132305 Please include a short summary of the BZ

[libvirt] [PATCH] qemu: numatune/domiftune no support in session mode

2014-09-03 Thread Erik Skultety
Tuning NUMA or network interface parameters require root privileges, thus an attempt to set some of these parameters in session mode should be invalid followed by an error. As an example might be memory tuning which raises an error in such case. This patch provides similar behavior for numatune

Re: [libvirt] [PATCH] qemu: numatune/domiftune no support in session mode

2014-09-04 Thread Erik Skultety
On 09/03/2014 05:00 PM, Erik Skultety wrote: Tuning NUMA or network interface parameters require root privileges, thus an attempt to set some of these parameters in session mode should be invalid followed by an error. As an example might be memory tuning which raises an error in such case

[libvirt] [PATCHv2] qemu: numatune/domiftune no support in session mode

2014-09-05 Thread Erik Skultety
Tuning NUMA or network interface parameters require root privileges to manage cgroups, thus an attempt to set some of these parameters in session mode on a running domain should be invalid followed by an error. As an example might be memory tuning which raises an error in such case. Following

[libvirt] [PATCH] qemu: panic device: check for invalid address type

2014-09-08 Thread Erik Skultety
qemu now checks for invalid address type for a panic device, which is currently implemented only to use ISA address type, thus rejecting any other options, except for leaving XML attributes blank, in that case, defaults are used (this behaviour remains the same from earlier verions). ---

[libvirt] [PATCH] network: check for invalid forward delay time

2014-09-08 Thread Erik Skultety
When spanning tree protocol is allowed in bridge settings, forward delay value is set as well (default is 0 if omitted). Until now, there was no check for delay value validity. Delay makes sense only as a positive numerical value. Note: However, even if you provide positive numerical value,

Re: [libvirt] [PATCH] network: check for invalid forward delay time

2014-09-09 Thread Erik Skultety
Thank you John for your review, however, before I send another patch I'd like to know your (or someone else's) opinion on my notes/thoughts I posted below. Erik On 09/08/2014 10:16 PM, John Ferlan wrote: On 09/08/2014 10:49 AM, Erik Skultety wrote: When spanning tree protocol is allowed

[libvirt] [PATCH] network: check negative values in bridge queues

2014-09-15 Thread Erik Skultety
We already are checking for negative value, reporting an error, but using wrong function, so the check never succeeds. This patch provides just a minor change in call of the right version of function virStrToLong. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1138539 ---

[libvirt] [PATCHv2] network: check for invalid forward delay time

2014-09-15 Thread Erik Skultety
When spanning tree protocol is allowed in bridge settings, forward delay value is set as well (default is 0 if omitted). Until now, there was no check for delay value validity. Delay makes sense only as a positive numerical value. Note: However, even if you provide positive numerical value,

[libvirt] [PATCHv2] network: check negative values in bridge queues

2014-09-16 Thread Erik Skultety
We already are checking for negative value, reporting an error, but using wrong function and the check only succeeds when a value that cannot be converted to number successfully is encountered. This patch provides just a minor change in call of the right version of function virStrToLong.

Re: [libvirt] [PATCH] network: check negative values in bridge queues

2014-09-16 Thread Erik Skultety
Thanks for review. Erik On 09/15/2014 05:51 PM, Martin Kletzander wrote: On Mon, Sep 15, 2014 at 05:41:38PM +0200, Martin Kletzander wrote: On Mon, Sep 15, 2014 at 05:34:36PM +0200, Martin Kletzander wrote: On Mon, Sep 15, 2014 at 10:38:20AM +0200, Erik Skultety wrote: We already

[libvirt] [PATCH] Fix libvirtd crash when removing metadata

2014-09-18 Thread Erik Skultety
When trying to remove nonexistent metadata from XML, libvirt daemon crashes due to dereferencing NULL pointer. Resolves https://bugzilla.redhat.com/show_bug.cgi?id=1143955 --- src/util/virxml.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/util/virxml.c

[libvirt] [PATCH 2/2] qemu: Fix updating balloon period in live XML

2014-09-22 Thread Erik Skultety
Up until now, we set memballoon period in monitor successfully, however we did not update domain definition structure, thus dumpxml was omitting period attribute in memballoon element Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1140960 --- src/qemu/qemu_driver.c | 8 +++- 1 file

[libvirt] [PATCH 0/2] Fix updating domain live XML

2014-09-22 Thread Erik Skultety
Erik Skultety (2): qemu: Fix updating bandwidth limits in live XML qemu: Fix updating balloon period in live XML src/qemu/qemu_driver.c | 20 +++- 1 file changed, 19 insertions(+), 1 deletion(-) -- 1.9.3 -- libvir-list mailing list libvir-list@redhat.com https

[libvirt] [PATCH 1/2] qemu: Fix updating bandwidth limits in live XML

2014-09-22 Thread Erik Skultety
When trying to update bandwidth limits on a running domain, limits get updated in our internal structures, however XML parser reads bandwidth limits from network 'actual' definition. Commiting this patch it is now available to update bandwidth 'actual' definition as well, thus updating domain

[libvirt] [PATCH] storage: Fix logical pool fmt type unknown-auto

2014-09-25 Thread Erik Skultety
According to our documentation logical pool supports formats 'auto' and 'lvm2'. However, in storage_conf.c we prevously defined storage pool formats: unknown, lvm2. Format 'auto' does make more sense than format 'unknown', so we should probably stay consistent with the documentation Resolves:

[libvirt] [PATCHv2] storage: Fix logical pool fmt type

2014-09-25 Thread Erik Skultety
According to our documentation logical pool supports formats 'auto' and 'lvm2'. However, in storage_conf.c we prevously defined storage pool formats: unknown, lvm2. Due to backward compatibility reasons documentation now refers to pool format type 'unknown' instead of 'auto'. Resolves:

[libvirt] [PATCHv3] qemu: NUMA/network tuning shouldn't be supported in session mode

2014-10-01 Thread Erik Skultety
Tuning NUMA or network interface parameters require root privileges to manage cgroups, thus an attempt to set some of these parameters in session mode on a running domain should be invalid followed by an error. As an example might be memory tuning which raises an error in such case. Following

Re: [libvirt] [PATCHv2] storage: Fix logical pool fmt type

2014-10-01 Thread Erik Skultety
Thank you. On 09/29/2014 01:53 PM, John Ferlan wrote: On 09/26/2014 06:56 AM, John Ferlan wrote: On 09/25/2014 10:26 AM, Erik Skultety wrote: According to our documentation logical pool supports formats 'auto' and 'lvm2'. However, in storage_conf.c we prevously defined storage pool s

Re: [libvirt] [PATCH 1/2] qemu: Fix updating bandwidth limits in live XML

2014-10-01 Thread Erik Skultety
On 10/01/2014 01:55 AM, John Ferlan wrote: On 09/22/2014 06:41 AM, Erik Skultety wrote: When trying to update bandwidth limits on a running domain, limits get updated in our internal structures, however XML parser reads bandwidth limits from network 'actual' definition. Commiting this patch

Re: [libvirt] [PATCH 2/2] qemu: Fix updating balloon period in live XML

2014-10-02 Thread Erik Skultety
On 10/01/2014 01:55 AM, John Ferlan wrote: On 09/22/2014 06:41 AM, Erik Skultety wrote: Up until now, we set memballoon period in monitor successfully, however we did not update domain definition structure, thus dumpxml was omitting period attribute in memballoon element Resolves: https

[libvirt] [PATCHv2 0/2] Fix updating domain live XML

2014-10-02 Thread Erik Skultety
Erik Skultety (2): qemu: Fix updating bandwidth limits in live XML qemu: Fix updating balloon period in live XML src/qemu/qemu_driver.c | 19 ++- 1 file changed, 18 insertions(+), 1 deletion(-) -- 1.9.3 -- libvir-list mailing list libvir-list@redhat.com https

[libvirt] [PATCHv2 2/2] qemu: Fix updating balloon period in live XML

2014-10-02 Thread Erik Skultety
Up until now, we set memballoon period in monitor successfully, however we did not update domain definition structure, thus dumpxml was omitting period attribute in memballoon element Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1140960 --- src/qemu/qemu_driver.c | 8 +++- 1 file

Re: [libvirt] [PATCH 1/2] qemu: Fix updating bandwidth limits in live XML

2014-10-02 Thread Erik Skultety
On 10/01/2014 05:39 PM, John Ferlan wrote: On 10/01/2014 11:17 AM, Erik Skultety wrote: On 10/01/2014 01:55 AM, John Ferlan wrote: On 09/22/2014 06:41 AM, Erik Skultety wrote: When trying to update bandwidth limits on a running domain, limits get updated in our internal structures

[libvirt] [PATCHv2 1/2] qemu: Fix updating bandwidth limits in live XML

2014-10-02 Thread Erik Skultety
When trying to update bandwidth limits on a running domain, limits get updated in our internal structures, however XML parser reads bandwidth limits from network 'actual' definition. Committing this patch it is now available to update bandwidth 'actual' definition as well, thus updating domain

Re: [libvirt] [PATCHv3] qemu: NUMA/network tuning shouldn't be supported in session mode

2014-10-23 Thread Erik Skultety
Splendid, thank you John :). Erik On 10/22/2014 09:00 PM, John Ferlan wrote: On 10/01/2014 08:57 AM, Erik Skultety wrote: Tuning NUMA or network interface parameters require root privileges to manage cgroups, thus an attempt to set some of these parameters in session mode on a running domain

[libvirt] [PATCH] lxc: fix setmem effect on a running LXC machine

2014-10-24 Thread Erik Skultety
When user calls setmem on a running LXC machine, we do update its cgroup entry (which is in odds with the original bug report, possibly resolved by later versions), however we neither update domain's runtime XML nor we update our internal structures and this patch fixes it. Resolves:

Re: [libvirt] [PATCH] lxc: fix setmem effect on a running LXC machine

2014-10-29 Thread Erik Skultety
On 10/29/2014 05:26 AM, Michal Privoznik wrote: On 24.10.2014 11:17, Erik Skultety wrote: When user calls setmem on a running LXC machine, we do update its cgroup entry (which is in odds with the original bug report, possibly resolved by later versions), however we neither update domain's

[libvirt] [PATCH 2/2] Iface: disallow network tuning in session mode globally

2014-10-30 Thread Erik Skultety
Patch 43b67f2e disallowed network tuning only with qemu driver, however this patch moved the check for root privileges into virNetDevBandwidthSetInternal wrapper function, so the call should now fail in all possible cases. The reason to create another wrapper is that we do execute a test suite

[libvirt] [PATCH 1/2] qemu: revert patch - bandwidth tuning in session mode

2014-10-30 Thread Erik Skultety
Since there was a valid note to patch 43b67f2e about the best spot to check for bandwidth set call while having libvirt daemon run in session mode, this patch reverts previous changes dealing with bandwith (excluding NUMA!) in qemu_driver.c and qemu_command.c. There will be another patch in the

[libvirt] [PATCH 0/2] network: bandwidth tuning in session mode revert patch

2014-10-30 Thread Erik Skultety
As Laine noted correctly, we should be testing for privileges on a global scale, when trying to set bandwidth parameters. Therefore I moved the check from qemu_driver.c and qemu_command.c into virnetdevbandwidth.c Erik Skultety (2): qemu: revert patch - bandwidth tuning in session mode Iface

[libvirt] [PATCHv2 1/2] qemu: revert patch - bandwidth tuning in session mode

2014-11-05 Thread Erik Skultety
Since there was a valid note to patch 43b67f2e about the best spot to check for bandwidth set call while having libvirt daemon run in session mode, this patch reverts previous changes dealing with bandwith (also reverts adding variable @cfg in qemuDomainGetNumaParameters which does not have any

[libvirt] [PATCHv2 0/2] network: bandwidth tuning in session mode revert patch

2014-11-05 Thread Erik Skultety
Erik Skultety (2): qemu: revert patch - bandwidth tuning in session mode Iface: disallow network tuning in session mode globally src/qemu/qemu_command.c| 11 --- src/qemu/qemu_driver.c | 9 - src/util/virnetdevbandwidth.c | 8 tests/Makefile.am

[libvirt] [PATCHv2 2/2] Iface: disallow network tuning in session mode globally

2014-11-05 Thread Erik Skultety
Patch 43b67f2e disallowed network tuning only with qemu driver, however this patch moved the check for root privileges into virNetDevBandwidthSet function, so the call should now fail in all possible cases. A mock function was created so that the test suite doesn't fail because of unsufficient

[libvirt] [PATCHv3 2/2] Iface: disallow network tuning in session mode globally

2014-11-06 Thread Erik Skultety
. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library. If not, see + * http://www.gnu.org/licenses/. + * + * Author: Erik Skultety eskul...@redhat.com + */ + +#include config.h +#include unistd.h +#include sys/types.h + +uid_t geteuid(void

[libvirt] [PATCHv3 0/2] network: bandwidth tuning in session mode revert patch

2014-11-06 Thread Erik Skultety
Erik Skultety (2): qemu: revert patch - bandwidth tuning in session mode Iface: disallow network tuning in session mode globally src/qemu/qemu_command.c| 11 --- src/qemu/qemu_driver.c | 9 - src/util/virnetdevbandwidth.c | 8 tests/Makefile.am

[libvirt] [PATCHv3 1/2] qemu: revert patch - bandwidth tuning in session mode

2014-11-06 Thread Erik Skultety
Since there was a valid note to patch 43b67f2e about the best spot to check for bandwidth set call while having libvirt daemon run in session mode, this patch reverts previous changes dealing with bandwith (also reverts adding variable @cfg in qemuDomainGetNumaParameters which does not have any

Re: [libvirt] [PATCHv3 0/2] network: bandwidth tuning in session mode revert patch

2014-11-06 Thread Erik Skultety
On 11/06/2014 02:30 PM, Michal Privoznik wrote: On 06.11.2014 12:38, Erik Skultety wrote: Erik Skultety (2): qemu: revert patch - bandwidth tuning in session mode Iface: disallow network tuning in session mode globally src/qemu/qemu_command.c| 11 --- src/qemu

[libvirt] [PATCH] virsh: Fix msg: blockjob is aborted from another client

2014-11-13 Thread Erik Skultety
When a block{pull, copy, commit} is aborted via keyboard interrupt, the job is properly canceled followed by proper error message. However, when the job receives an abort from another client connected to the same domain, the error message incorrectly indicates that a blockjob has been finished

[libvirt] [PATCHv2] virsh: Fix msg: blockjob is aborted from another client

2014-11-19 Thread Erik Skultety
When a block{pull, copy, commit} is aborted via keyboard interrupt, the job is properly canceled followed by proper error message. However, when the job receives an abort from another client connected to the same domain, the error message incorrectly indicates that a blockjob has been finished

[libvirt] [PATCHv3] virsh: Fix msg: blockjob is aborted from another client

2014-11-20 Thread Erik Skultety
When a block{pull, copy, commit} is aborted via keyboard interrupt, the job is properly canceled followed by proper error message. However, when the job receives an abort from another client connected to the same domain, the error message incorrectly indicates that a blockjob has been finished

[libvirt] [PATCH] qemu: fix block{commit,copy} abort handling

2014-11-27 Thread Erik Skultety
When a block{commit,copy} job was aborted on a domain, block job handler did not process it correctly, leaving a phantom job in the background. Any further calls to any blockjob causes block jobtype still active error. This patch fixes the blockjob handler so that it checks not only for

[libvirt] [PATCH] qemu: Fix virsh freeze when blockcopy storage file is removed

2014-12-03 Thread Erik Skultety
If someone removes blockcopy storage file when still in mirroring phase and then requesting blockjob abort using pivot, virsh cmd freezes. This is not an issue with older qemu versions which did not support asynchronous jobs (which we prefer by default). As we have reached the mirroring phase

[libvirt] [PATCH] util: check for an illegal character in a XML namespace prefix

2014-12-04 Thread Erik Skultety
When user tries to insert element metadata providing a namespace declaration as well, currently we insert the element without any validation check for XML prefix (if provided). The next VM start would then fail with parse error. This patch fixes this issue by adding a call to xmlValidateNCName

Re: [libvirt] [PATCH] util: check for an illegal character in a XML namespace prefix

2014-12-10 Thread Erik Skultety
On 12/05/2014 12:57 PM, Michal Privoznik wrote: On 04.12.2014 14:37, Erik Skultety wrote: When user tries to insert element metadata providing a namespace declaration as well, currently we insert the element without any validation check for XML prefix (if provided). The next VM start would

[libvirt] [PATCH] conf: move the check for secondary consoles of targetType serial

2014-12-11 Thread Erik Skultety
For historical reasons, only the first console element might be of targetType serial, but we checked for other consoles of targetType serial in our post-parse callback if and only if we knew the first console was serial, otherwise the check was skipped. This patch moves the check one level up, so

Re: [libvirt] [PATCH] conf: move the check for secondary consoles of targetType serial

2014-12-17 Thread Erik Skultety
Thank you, Michal. On 12/15/2014 10:34 AM, Michal Privoznik wrote: On 12.12.2014 17:17, Michal Privoznik wrote: On 11.12.2014 12:28, Erik Skultety wrote: For historical reasons, only the first console element might be of targetType serial, but we checked for other consoles of targetType

Re: [libvirt] [PATCH] Fix a memory leak in virCgroupGetPercpuStats

2015-01-26 Thread Erik Skultety
On 01/26/2015 10:22 AM, Ján Tomko wrote: --- src/util/vircgroup.c | 6 -- tests/vircgrouptest.c | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/util/vircgroup.c b/src/util/vircgroup.c index e65617a..6957e81 100644 --- a/src/util/vircgroup.c +++

[libvirt] [PATCH 6/6] po: add security_stack.c into POTFILES.in

2015-02-06 Thread Erik Skultety
Previous patches of these series introduced a new check which might endup reporting an error. In that case POTFILES.in had to be updated, so that syntax-check could pass successfully --- po/POTFILES.in | 1 + 1 file changed, 1 insertion(+) diff --git a/po/POTFILES.in b/po/POTFILES.in index

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

2015-02-06 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 + 1 file changed, 9 insertions(+) diff --git

[libvirt] [PATCH 5/6] test: add test to check for device seclabel duplicates

2015-02-06 Thread Erik Skultety
--- .../qemuxml2argv-seclabel-device-multiple.xml | 35 ++ 1 file changed, 35 insertions(+) create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-seclabel-device-multiple.xml diff --git a/tests/qemuxml2argvdata/qemuxml2argv-seclabel-device-multiple.xml

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

2015-02-06 Thread Erik Skultety
In our RNG schema we do allow multiple seclabels per-domain, bu don't allow this for devices, yet we neither have a check in our XML parser, nor in a post-parse callback. As one of my previous patches in this series added that check to the XML parser, let's allow multiple seclabels for devices

[libvirt] [PATCH 1/6] security: Add check for valid security model

2015-02-06 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 disk type device. This patch introduces a new function virSecurityStackCheckDiskLabels which compares user specified security model against currently registered security drivers. That

[libvirt] [PATCH 2/6] conf: fix a minor typo

2015-02-06 Thread Erik Skultety
--- src/conf/domain_conf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 4251b13..a36dace 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -5213,7 +5213,7 @@ virSecurityLabelDefsParseXML(virDomainDefPtr

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

2015-02-06 Thread Erik Skultety
Add a check for invalid security models in per-device configuration as well as a check for seclabel duplicates in per-device configuration Erik Skultety (6): security: Add check for valid security model conf: fix a minor typo conf: forbid seclabel duplicates for domain devices schema

Re: [libvirt] [PATCH 0/6] security: Add check for invalid security models and duplicates

2015-02-09 Thread Erik Skultety
On 02/06/2015 08:04 PM, Eric Blake wrote: On 02/06/2015 11:13 AM, Erik Skultety wrote: Add a check for invalid security models in per-device configuration as well as a check for seclabel duplicates in per-device configuration Erik Skultety (6): security: Add check for valid security

[libvirt] [PATCH 5/5] qemu: reorder PCI slot assignment functions

2015-01-21 Thread Erik Skultety
In previous commit a chunk of code got moved in to a separate static function qemuValidateDevicePCISlotsChipsets. This function then invokes chipset specific functions which are defined as static as well. For these reasons it is necessary to either have a forward declaration or slightly reorder

[libvirt] [PATCH 4/5] qemu: move PCI slot assignment for PIIX3, Q35 into a separate function

2015-01-21 Thread Erik Skultety
In order to be able to test for fully reserved PCI buses, assignment of PCI slots for integrated devices needs to be moved to a separate function. This also might be a good preparation if we decide to add support for other chipsets as well. --- src/qemu/qemu_command.c | 45

[libvirt] [PATCH 0/5] Revert and fix PCI bridge auto-add to extend default bus

2015-01-21 Thread Erik Skultety
Erik Skultety (5): qemu: Remove dead code in qemuDomainAssignPCIAddresses revert patch conf: virDomainDefMaybeAddController tweak return code qemu: Fix auto-adding PCI bridge when all slots are reserved qemu: move PCI slot assignment for PIIX3, Q35 into a separate function qemu: reorder

[libvirt] [PATCH 2/5] conf: virDomainDefMaybeAddController tweak return code

2015-01-21 Thread Erik Skultety
Previously the function returned either -1 in case of an error or 0 on success. However, we should also distinguish between a case we successfully added a controller and a case there wasn't a need to add any controller --- src/conf/domain_conf.c | 2 +- 1 file changed, 1 insertion(+), 1

[libvirt] [PATCH 1/5] qemu: Remove dead code in qemuDomainAssignPCIAddresses revert patch

2015-01-21 Thread Erik Skultety
As it turned out, fix of dead code 419a22 changed the affected condition from never true to always true, so better fix would be to change the return code of virDomainMaybeAddController from 0 to 1 if a new bridge has been added, thus distinguishing case when we didn't need to add any controller

[libvirt] [PATCH 3/5] qemu: Fix auto-adding PCI bridge when all slots are reserved

2015-01-21 Thread Erik Skultety
Commit 93c8ca tried to fix the issue with auto-adding of a PCI bridge controller, it worked well when the slots were reserved by devices with user defined addresses without any other devices with unspecified PCI addresses present in the XML. However, if another device with unspecified PCI

[libvirt] [PATCH 1/3] qemu: Tweak auto adding PCI bridge controller when extending default PCI bus

2015-01-15 Thread Erik Skultety
In case we find out, there are more PCI devices to be connected than there are available slots on the default PCI bus, we automatically add a new bus and a related PCI bridge controller as well. As there are no free slots left on the default PCI bus, PCI bridge controller gets a free slot on a

[libvirt] [PATCH 2/3] Remove dead code in qemuDomainAssignPCIAddresses

2015-01-15 Thread Erik Skultety
We tested for positive return value from virDomainMaybeAddController, but it returns 0 or -1 only resulting in a dead code. --- src/qemu/qemu_command.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 06def5f..1671e11

[libvirt] [PATCH 0/3] Fix adding PCI bridge controller to extend default PCI bus

2015-01-15 Thread Erik Skultety
Erik Skultety (3): qemu: Tweak auto adding PCI bridge controller when extending default PCI bus qemu: qemuDomainAssignPCIAddresses fix dead code qemu: Add XML test for too many PCI devices on default PCI bus src/qemu/qemu_command.c | 26 ++- tests

[libvirt] [PATCH 3/3] Add XML test for too many PCI devices on default PCI bus

2015-01-15 Thread Erik Skultety
--- tests/qemuxml2argvdata/qemuxml2argv-pci-many.args | 63 +++ tests/qemuxml2argvdata/qemuxml2argv-pci-many.xml | 214 ++ tests/qemuxml2argvtest.c | 2 + 3 files changed, 279 insertions(+) create mode 100644

[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. ---

[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 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 v2] qemu: Check for negative port values in network drive configuration

2015-02-20 Thread Erik Skultety
We interpret port values as signed int (convert them from char *), so if anegative value is provided in network disk's configuration, we accept it as valid, however there's an 'unknown cause' error raised later. This error is only accidental because we return the port value in the return code.

[libvirt] [PATCH] qemu: Check for negative port values in network drive configuration

2015-02-19 Thread Erik Skultety
We interpret port values as signed int (convert them from char *), so if a negative value is provided in network disk's configuration, we accept it as valid, however there's an 'unknown cause' error raised later. This error is only accidental because we return the port value in the return code.

Re: [libvirt] [PATCH v2 4/4] qemu: Add check for PCI bridge placement if there are too many PCI devices

2015-01-23 Thread Erik Skultety
On 01/23/2015 02:38 PM, Ján Tomko wrote: diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index a3dedbf..870771f 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -1982,6 +1982,25 @@ qemuDomainAssignPCIAddresses(virDomainDefPtr def, if

Re: [libvirt] [PATCH 3/5] qemu: Fix auto-adding PCI bridge when all slots are reserved

2015-01-23 Thread Erik Skultety
On 01/22/2015 05:00 PM, Ján Tomko wrote: On 01/21/2015 05:50 PM, Erik Skultety wrote: Commit 93c8ca tried to fix the issue with auto-adding of a PCI bridge controller, it worked well when the slots were reserved by devices with user defined addresses without any other devices

[libvirt] [PATCH v2 1/4] qemu: reorder PCI slot assignment functions

2015-01-23 Thread Erik Skultety
In previous commit a chunk of code got moved in to a separate static function qemuValidateDevicePCISlotsChipsets. This function then invokes chipset specific functions which are defined as static as well. For these reasons it is necessary to either have a forward declaration or slightly reorder

[libvirt] [PATCH v2 3/4] qemu: Fix auto-adding PCI bridge when all slots are reserved

2015-01-23 Thread Erik Skultety
Commit 93c8ca tried to fix the issue with auto-adding of a PCI bridge controller, but didn't work properly in all scenarios. This patch provides a better fix of the issue when all slots on a PCI bus are reserved by devices with user specified addresses and no additional bridges need to be

[libvirt] [PATCH v2 4/4] qemu: Add check for PCI bridge placement if there are too many PCI devices

2015-01-23 Thread Erik Skultety
Previous patch of this series fixed the issue with adding a new PCI bridge when all the slots were reserved by devices with user specified addresses. In case there are still some PCI devices waiting to get a slot reserved by qemuAssignDevicePCISlots, this means a new bus needs to be created along

[libvirt] [PATCH v2 0/4] qemu: fix PCI bridge auto-add to extend default bus

2015-01-23 Thread Erik Skultety
Erik Skultety (4): qemu: reorder PCI slot assignment functions qemu: move PCI slot assignment for PIIX3, Q35 into a separate function qemu: Fix auto-adding PCI bridge when all slots are reserved qemu: Add check for PCI bridge placement if there are too many PCI devices src/qemu

[libvirt] [PATCH v2 2/4] qemu: move PCI slot assignment for PIIX3, Q35 into a separate function

2015-01-23 Thread Erik Skultety
In order to be able to test for fully reserved PCI buses, assignment of PCI slots for integrated devices needs to be moved to a separate function. This also might be a good preparation if we decide to add support for other chipsets as well. --- src/qemu/qemu_command.c | 47

  1   2   3   4   5   6   7   8   9   10   >