Re: [libvirt] [PATCH 4/9] Add newDomain parameter to qemuDomainAssignAddresses

2015-08-13 Thread John Ferlan
On 08/12/2015 10:52 AM, Ján Tomko wrote: > To differentiate a new domain from an existing one. > --- > src/qemu/qemu_command.c | 5 - > src/qemu/qemu_command.h | 3 ++- > src/qemu/qemu_driver.c | 22 +++--- > src/qemu/qemu_process.c | 6 +++--- > tests/qemuhotplugtest

Re: [libvirt] Entering freeze for libvirt-1.2.17

2015-08-13 Thread Guido Günther
On Fri, Jul 10, 2015 at 11:05:42AM +0800, Daniel Veillard wrote: > On Thu, Jul 09, 2015 at 02:00:10PM -0700, Peter Kieser wrote: [..snip..] > > > > > >Daniel > > > > > http://libvirt.org/git/?p=libvirt.git;a=commit;h=1310b1358cdf9c8acba6e0e85feb869241e59faa > > > > I had to revert this commit to g

Re: [libvirt] [PATCH 1/2] Check if qemu-bridge-helper exists and is executable

2015-08-13 Thread Guido Günther
On Thu, Aug 13, 2015 at 03:59:53PM +0200, Martin Kletzander wrote: > On Thu, Aug 13, 2015 at 02:42:44PM +0200, Guido Günther wrote: > >Otherwise the error is just > > > > error: Failed to create domain from test1.xml > > error: failed to retrieve file descriptor for interface: Transport > > en

Re: [libvirt] [PATCH 3/9] Store USB port path as an array of integers

2015-08-13 Thread John Ferlan
On 08/12/2015 10:52 AM, Ján Tomko wrote: > In preparation to tracking which USB addresses are occupied. > Introduce two helper functions for printing the port path > as a string and appending it to a virBuffer. > --- > src/conf/domain_addr.c | 25 + > src/conf/domain_ad

Re: [libvirt] [PATCH 2/9] Remove unused virDomainVirtioSerialAddrSetRemoveController

2015-08-13 Thread John Ferlan
On 08/12/2015 10:52 AM, Ján Tomko wrote: > This function was never used. > I think that portion could have been removed in 1/9 since that's when you removed the unreachable 'external' call to it. > Also mark virDomainVirtioSerialAddrSetAddController as static. And this just becomes 2/9 > --

Re: [libvirt] [PATCH 1/9] Remove dead code from qemuDomainAttachControllerDevice

2015-08-13 Thread John Ferlan
On 08/12/2015 10:52 AM, Ján Tomko wrote: > We only support hotplugging SCSI controllers, > USB and virtio-serial related code is useless here. > --- > src/qemu/qemu_hotplug.c | 18 -- > 1 file changed, 18 deletions(-) > It's true that we only call this from two places currently

Re: [libvirt] [PATCH libvirt master] interface type: add udp socket support

2015-08-13 Thread Laine Stump
On 08/11/2015 12:45 PM, Jonathan Toppins wrote: > On 8/10/15 1:28 AM, Laine Stump wrote: >> On 08/07/2015 06:14 PM, Jonathan > Toppins wrote: >>> Adds a new interface type using UDP sockets, this seems only >>> applicable to QEMU but have edited tree-wide to support the new >>> interface type. >>>

Re: [libvirt] [PATCH libvirt master] interface type: add udp socket support

2015-08-13 Thread Jonathan Toppins
On 8/12/15 12:29 PM, Ján Tomko wrote: On Tue, Aug 11, 2015 at 12:30:03PM -0400, Jonathan Toppins wrote: On 8/10/15 11:06 AM, Ján Tomko wrote: Signed-off-by: Jonathan Toppins --- docs/formatdomain.html.in| 17 src/conf/domain_conf.c | 56 +++

Re: [libvirt] [PATCH 4/7] security: Label parent directories of character devices

2015-08-13 Thread Daniel P. Berrange
On Thu, Aug 13, 2015 at 05:47:42PM +0200, Martin Kletzander wrote: > We are currently unable to label parent directories for some paths. > However, we will need to have per-domain directories that we would like > to have labelled, but we can't label all of them. So let's add a > boolean variable t

[libvirt] [PATCH 3/7] security: Expose SetChardevLabel function in security drivers

2015-08-13 Thread Martin Kletzander
Functions labelling character devices can be used in the future for labelling additional character devices that are not present in the definition itself. Signed-off-by: Martin Kletzander --- src/libvirt_private.syms| 1 + src/security/security_dac.c | 2 ++ src/security/security_dr

[libvirt] [PATCH 4/7] security: Label parent directories of character devices

2015-08-13 Thread Martin Kletzander
We are currently unable to label parent directories for some paths. However, we will need to have per-domain directories that we would like to have labelled, but we can't label all of them. So let's add a boolean variable that will determine whether parent directory for such chardev should be labe

[libvirt] [PATCH 6/7] tests: Use qemuProcessPrepareMonitorChr in qemuxmlnstest

2015-08-13 Thread Martin Kletzander
The output of that function was not tested until now. In order to keep the paths in /tmp, the test driver config is "fixed" as well. Signed-off-by: Martin Kletzander --- .../qemuxmlns-qemu-ns-commandline-ns0.args| 2 +- .../qemuxmlns-qemu-ns-commandline-ns1.args| 2 +-

[libvirt] [PATCH 1/7] security_selinux: Use proper structure to access socket data

2015-08-13 Thread Martin Kletzander
In virSecuritySELinuxSetSecurityChardevLabel() we are labelling unix socket path, but accessing another structure of the union. This does not pose a problem currently as both paths are at the same offset, but this should be fixed for the future. Signed-off-by: Martin Kletzander --- src/security

[libvirt] [PATCH 2/7] security_dac: Label non-listening sockets

2015-08-13 Thread Martin Kletzander
SELinux security driver already does that, but DAC driver somehow missed the memo. Let's fix it so it works the same way. Signed-off-by: Martin Kletzander --- src/security/security_dac.c | 10 +- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/security/security_dac.c b/

[libvirt] [PATCH 0/7] qemu: Make it possible to run domains with dirrefent seclabels

2015-08-13 Thread Martin Kletzander
We offer setting seclabel for the whole domain, but we never fixed the fact that the domain will not be able to even create its monitor socket because the directory is owned by the default preconfigured user and group. Moreover the selinux context can be off as well. So this patch series fixes fe

[libvirt] [PATCH 5/7] qemu: Fix access to auto-generated socket paths

2015-08-13 Thread Martin Kletzander
We are automatically generating some socket paths for domains, but all those paths end up in a directory that's the same for multiple domains. The problem is that multiple domains can each run with different seclabels (users, selinux contexts, etc.). The idea here is to create a per-domain directo

[libvirt] [PATCH 3/3] qemu: Add check for invalid iothread_id in qemuDomainChgIOThread

2015-08-13 Thread John Ferlan
https://bugzilla.redhat.com/show_bug.cgi?id=1251886 Since iothread_id == 0 is an invalid value for QEMU let's point that out specifically. For the IOThreadDel code, the failure would have ended up being a failure to find the IOThread ID; however, for the IOThreadAdd code - an IOThread 0 was added

[libvirt] [PATCH 1/3] api: Remove check on iothread_id arg in virDomainPinIOThread

2015-08-13 Thread John Ferlan
Allow 0 as an iothread_id and force the hypervisor to handle. The qemuDomainPinIOThread API will look up the iothread_id of 0 and not find it and message that anyway. Signed-off-by: John Ferlan --- src/libvirt-domain.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/libvirt-domain.c b/src

[libvirt] [PATCH 0/3] Some minor IOThread API adjustments/checks

2015-08-13 Thread John Ferlan
As a result of the review of a related issue for virDomainAddIOThread it was noted that it's only our implementation for qemu that doesn't want an iothread_id == 0, see: http://www.redhat.com/archives/libvir-list/2015-August/msg00310.html Continued IRC chats with the submittor of that patch d

[libvirt] [PATCH 2/3] api: Adjust comment for virDomainAddIOThread

2015-08-13 Thread John Ferlan
The comment for the function indicated that iothread_id had to be a positive non-zero value; however, that wasn't checked - that is a value of 0 is/was allowed by the API and was left up to the hypervisor to reject the value. More than likely this nuance was missed during the many "adjustments" to

Re: [libvirt] [PATCHv2] nodedev: Fix gfeature size to be according to running kernel

2015-08-13 Thread John Ferlan
On 08/13/2015 06:23 AM, Moshe Levi wrote: > This patch add virNetDevGetGFeaturesSize to get the supported > gfeature size from the kernel > --- > src/util/virnetdev.c | 79 - > 1 files changed, 71 insertions(+), 8 deletions(-) > > diff --git a/s

[libvirt] [PATCHv2 1/2] qemu: fix the audit log is not correct after hot-plug memory success

2015-08-13 Thread Luyao Huang
https://bugzilla.redhat.com/show_bug.cgi?id=1226234#c3 After hot-plug a memory device success, the audit log show that memory update failed: type=VIRT_RESOURCE ... old-mem=1024000 new-mem=1548288 \ exe="/usr/sbin/libvirtd" hostname=? addr=? terminal=pts/2 res=failed This is because the ret is st

[libvirt] [PATCHv2 0/2] qemu: fix the audit log is not correct for memory device

2015-08-13 Thread Luyao Huang
First review: http://www.redhat.com/archives/libvir-list/2015-July/msg00982.html Change in v2: - split it to two patches - fix some small mistake in hot-unplug part I change the code in qemuDomainAttachMemory like what we do in other attach deivce functions. And I have removed the jump in qemuDo

[libvirt] [PATCHv2 2/2] qemu: fix the audit log is not correct after hot-unplug memory device

2015-08-13 Thread Luyao Huang
https://bugzilla.redhat.com/show_bug.cgi?id=1226234#c3 We use virDomainDefGetMemoryActual to get the newmem , but when we failed to remove the memory device, the virDomainDefGetMemoryActual will still output the oldmem size, so the audit log will not right in that case. Signed-off-by: Luyao Huang

Re: [libvirt] [PATCH 1/2] Check if qemu-bridge-helper exists and is executable

2015-08-13 Thread Martin Kletzander
On Thu, Aug 13, 2015 at 02:42:44PM +0200, Guido Günther wrote: Otherwise the error is just error: Failed to create domain from test1.xml error: failed to retrieve file descriptor for interface: Transport endpoint is not connected since we don't get a sensible error after the fork. --- sr

Re: [libvirt] [PATCH v3 3/4] qemu: Keep numad hint after reboot

2015-08-13 Thread Ján Tomko
On Thu, Aug 13, 2015 at 03:01:39PM +0200, Martin Kletzander wrote: > On Thu, Aug 13, 2015 at 02:49:34PM +0200, Ján Tomko wrote: > >s/reboot/daemon restart/ ? > > > > Yes, exactly! > > >On Thu, Aug 13, 2015 at 10:18:33AM +0200, Martin Kletzander wrote: > >> The numad hint stored in priv->autoNodes

Re: [libvirt] [PATCH v3 1/4] qemu: Fix segfault when parsing private domain data

2015-08-13 Thread Martin Kletzander
On Thu, Aug 13, 2015 at 09:04:52AM -0400, John Ferlan wrote: On 08/13/2015 04:18 AM, Martin Kletzander wrote: When parsing private domain data, there are two paths that are flawed. They are both error paths, just from different parts of the function. One of them can call free() on an uninitial

Re: [libvirt] [PATCH v3 1/4] qemu: Fix segfault when parsing private domain data

2015-08-13 Thread John Ferlan
On 08/13/2015 04:18 AM, Martin Kletzander wrote: > When parsing private domain data, there are two paths that are flawed. > They are both error paths, just from different parts of the function. > One of them can call free() on an uninitialized pointer. Initialization > to NULL is enough here. T

Re: [libvirt] [PATCH v3 3/4] qemu: Keep numad hint after reboot

2015-08-13 Thread Martin Kletzander
On Thu, Aug 13, 2015 at 02:49:34PM +0200, Ján Tomko wrote: s/reboot/daemon restart/ ? Yes, exactly! On Thu, Aug 13, 2015 at 10:18:33AM +0200, Martin Kletzander wrote: The numad hint stored in priv->autoNodeset is information that gets lost during daemon restart. And because we would like t

Re: [libvirt] [PATCH v3 3/4] qemu: Keep numad hint after reboot

2015-08-13 Thread Ján Tomko
s/reboot/daemon restart/ ? On Thu, Aug 13, 2015 at 10:18:33AM +0200, Martin Kletzander wrote: > The numad hint stored in priv->autoNodeset is information that gets lost > during daemon restart. And because we would like to use that > information in the future, we also need to save it in the statu

Re: [libvirt] [PATCH v3 0/4] qemu: Return true pinning info

2015-08-13 Thread Ján Tomko
On Thu, Aug 13, 2015 at 10:18:30AM +0200, Martin Kletzander wrote: > v3: > - Added test for the hint keeping patch > - Fixed pre-existing crasher found thanks to the test (PATCH 1/4) > - Fixed problem in the parsing function found by the test added: >- Use nnumaCel_max instead of nnumaCells

[libvirt] [PATCH 1/2] Check if qemu-bridge-helper exists and is executable

2015-08-13 Thread Guido Günther
Otherwise the error is just error: Failed to create domain from test1.xml error: failed to retrieve file descriptor for interface: Transport endpoint is not connected since we don't get a sensible error after the fork. --- src/qemu/qemu_command.c | 6 ++ 1 file changed, 6 insertions

[libvirt] [PATCH 2/2] Detect location of qemu-bridge-helper

2015-08-13 Thread Guido Günther
RedHat and Debian based distros use different locations Reference: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=790935 --- configure.ac | 3 +++ src/qemu/qemu_conf.c | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 46c80ce..96585

[libvirt] [PATCH v3 1/3] virt-shell: Resolve conflicts and some forgotten substitution from v2

2015-08-13 Thread Erik Skultety
Recent refactor series (commits below) created a conflict with this virsh split series. This patch also renames virshCommandOptTimeoutToMs to vshCommandOptTimeoutToMs and moves it to vsh.c Commits causing conflict: 6da3b694 - faa14391 --- tools/virsh-domain.c | 150 ++

[libvirt] [PATCH v3 3/3] virt-shell: Move generic commands implementation to vsh.c

2015-08-13 Thread Erik Skultety
Generic commands like 'help', 'cd', 'pwd',etc. can be reused by any client, so the clients should profit from this implementation rather than providing their own similar implementation (if it's not intensional and there's a reason for this) --- tools/virsh.c | 343 +++--

[libvirt] [PATCH v3 0/3] virt-shell: v3 diff series

2015-08-13 Thread Erik Skultety
v3: - renamed virshCommandOptTimeoutToMs - resolved conflicts caused by virsh block job handling refactor - generic commands implementation moved to vsh.c As usual, for testing purposes, everything is available on my remote branch https://github.com/eskultety/libvirt/tree/virt-shell Erik Skultet

[libvirt] [PATCH v3 2/3] virt-shell: Support command history for individual clients

2015-08-13 Thread Erik Skultety
By splitting generic parts from virsh we will need to preserve each client's history, yet we use hardcoded names and paths. This patch fixes this problem. --- src/libvirt_private.syms | 1 + src/util/virstring.c | 32 + src/util/virstring.h | 1 + tools/virsh.

[libvirt] [PATCHv2] nodedev: Fix gfeature size to be according to running kernel

2015-08-13 Thread Moshe Levi
This patch add virNetDevGetGFeaturesSize to get the supported gfeature size from the kernel --- src/util/virnetdev.c | 79 - 1 files changed, 71 insertions(+), 8 deletions(-) diff --git a/src/util/virnetdev.c b/src/util/virnetdev.c index 2f3690e..

Re: [libvirt] [patch] Add support for OVMF in virt-aa-helper [Was: [apparmor] virt-aa-helper: does not support OVMF?]

2015-08-13 Thread intrigeri
Hi, Martin Kletzander wrote (13 Aug 2015 07:55:54 GMT) : > Good catch, this makes sense, but to be strictly precise about this, I > would say this makes the directory accessible for R/W, but readonly > would be enough, wouldn't it? Yes. > There could be a small code adjustment, > I'd even dare c

[libvirt] [PATCH v4 1/5] Introduce virDomainRename API

2015-08-13 Thread Tomas Meszaros
Also, among with this new API new ACL that restricts rename capability is invented too. Signed-off-by: Tomas Meszaros --- include/libvirt/libvirt-domain.h | 4 src/driver-hypervisor.h | 6 ++ src/libvirt-domain.c | 35 +++ src/libvi

[libvirt] [PATCH v4 5/5] qemu: Implement virDomainRename

2015-08-13 Thread Tomas Meszaros
Currently supports only renaming inactive domains without snapshots. Signed-off-by: Tomas Meszaros --- src/qemu/qemu_driver.c | 147 + 1 file changed, 147 insertions(+) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 2e44500..39

[libvirt] [PATCH v4 4/5] Introduce new VIR_DOMAIN_EVENT_DEFINED_RENAMED event

2015-08-13 Thread Tomas Meszaros
This should be emitted whenever a domain is renamed. Signed-off-by: Tomas Meszaros --- examples/object-events/event-test.c | 4 include/libvirt/libvirt-domain.h| 2 ++ tools/virsh-domain.c| 6 -- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/example

[libvirt] [PATCH v4 3/5] domain_conf: Introducde virDomainObjListRenameAddNew() & virDomainObjListRenameRemove()

2015-08-13 Thread Tomas Meszaros
We just need to update the entry in the second hash table. Since commit 8728a56 we have two hash tables for the domain list so that we can do O(1) lookup regardless of looking up by UUID or name. Since with renaming a domain UUID does not change, we only need to update the second hash table, where

[libvirt] [PATCH v4 2/5] virsh: Implement "domrename" command

2015-08-13 Thread Tomas Meszaros
This patch implements new virsh command, domrename. Using domrename, it will be possible to rename domain from the virsh shell by calling virRenameDomain API. It takes two arguments, current domain name and new domain name. Example: virsh # list --all IdName State

[libvirt] [PATCH v4 0/5] domainRename API implementation

2015-08-13 Thread Tomas Meszaros
This is an effort to implement domain rename API. Presented patch series consists of the following: virDomainRename API implementation for qemu, implementation of the virsh command domrename and the additional support code. The idea behind this endeavor is to provide convenient and safe way to ren

[libvirt] [PATCH v3 0/4] qemu: Return true pinning info

2015-08-13 Thread Martin Kletzander
v3: - Added test for the hint keeping patch - Fixed pre-existing crasher found thanks to the test (PATCH 1/4) - Fixed problem in the parsing function found by the test added: - Use nnumaCel_max instead of nnumaCells - Fill in nnumaCell_max in test capabilities v2: - Added more info to co

[libvirt] [PATCH v3 3/4] qemu: Keep numad hint after reboot

2015-08-13 Thread Martin Kletzander
The numad hint stored in priv->autoNodeset is information that gets lost during daemon restart. And because we would like to use that information in the future, we also need to save it in the status XML. For the sake of tests, we need to initialize nnumaCell_max to some value, so that the restorat

[libvirt] [PATCH v3 4/4] qemu: Use numad information when getting pin information

2015-08-13 Thread Martin Kletzander
Pinning information returned for emulatorpin and vcpupin calls is being returned from our data without querying cgroups for some time. However, not all the data were utilized. When automatic placement is used the information is not returned for the calls mentioned above. Since the numad hint in

[libvirt] [PATCH v3 2/4] conf: Pass private data to Parse function of XML options

2015-08-13 Thread Martin Kletzander
This needs a reorder of XML option definitions. It might come in handy one day. Signed-off-by: Martin Kletzander --- src/conf/domain_conf.c | 2 +- src/conf/domain_conf.h | 17 + src/libxl/libxl_domain.c | 3 ++- src/lxc/lxc_domain.c | 3 ++- src/qemu/qemu_domain.c

[libvirt] [PATCH v3 1/4] qemu: Fix segfault when parsing private domain data

2015-08-13 Thread Martin Kletzander
When parsing private domain data, there are two paths that are flawed. They are both error paths, just from different parts of the function. One of them can call free() on an uninitialized pointer. Initialization to NULL is enough here. The other one is a bit trickier to explain, but as easy as t

Re: [libvirt] [PATCH v2 0/3] qemu: Return true pinning info

2015-08-13 Thread Martin Kletzander
On Tue, Aug 11, 2015 at 02:24:35PM +0200, Martin Kletzander wrote: First two patches just prepare the ground for the third one that explains what needs to be fixed and ho it's done. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1162947 v2: - Added more info to commit message of patch 2/

Re: [libvirt] [patch] Add support for OVMF in virt-aa-helper [Was: [apparmor] virt-aa-helper: does not support OVMF?]

2015-08-13 Thread Martin Kletzander
On Wed, Aug 12, 2015 at 11:19:54AM -0500, Jamie Strandboge wrote: On 08/12/2015 10:59 AM, intrig...@debian.org wrote: Hi, [please Cc me any reply, I'm not subscribed to libvir-list.] it was reported [1] to Ubuntu that virt-aa-helper blocks access to the OVMF files needed to boot UEFI virtual m