[libvirt] libvirt-php --with-php-config=/path/to/php is broken.

2017-02-10 Thread Shaun Reitan
When running the following command I ended up getting errors that phpize was missing. Trying to dig into this further i found that configure.ac was just trying to run php-config without providing a path. The following patch corrects the issue by using the $PHPCONFIG variable instead.

Re: [libvirt] [PATCH] util: Fix indentation for virnetdevmacvlan

2017-02-10 Thread John Ferlan
On 02/10/2017 09:35 AM, Nitesh Konkar wrote: > Signed-off-by: Nitesh Konkar > --- > src/util/virnetdevmacvlan.c | 30 +++--- > src/util/virnetdevmacvlan.h | 20 ++-- > 2 files changed, 25 insertions(+), 25 deletions(-) >

Re: [libvirt] [RFC] Substitute poll by epoll in virEventPollRunOnce

2017-02-10 Thread Daniel P. Berrange
On Fri, Feb 10, 2017 at 04:29:27PM +0300, Derbyshev Dmitriy wrote: > From: Derbyshev Dmitry > > This makes it possible to avoid allocations in > virEventPollMakePollFDs, as well as generally reduces time spent in > kernel if handles remain the same, which should

[libvirt] [PATCH 5/5] news: Mention specific vCPU hotplug API

2017-02-10 Thread Peter Krempa
--- docs/news.xml | 10 ++ 1 file changed, 10 insertions(+) diff --git a/docs/news.xml b/docs/news.xml index a214b3316..3a540deba 100644 --- a/docs/news.xml +++ b/docs/news.xml @@ -44,6 +44,16 @@ openvswitch calls in the libvirtd configuration file. + +

[libvirt] [PATCH 4/5] test: qemuhotplugtest: Add testing of individual vcpu hotplug

2017-02-10 Thread Peter Krempa
Test that the vcpu entity selection code works properly --- tests/qemuhotplugtest.c| 63 .../ppc64-modern-individual-domain.xml | 20 ++ .../ppc64-modern-individual-monitor.json | 318 +

[libvirt] [PATCH 1/5] lib: Add API for specific vCPU hot(un)plug

2017-02-10 Thread Peter Krempa
Similarly to domainSetGuestVcpus this commit adds API which allows to modify state of individual vcpus rather than just setting the count. This allows to enable CPUs in specific guest NUMA nodes to achieve any necessary configuration. --- include/libvirt/libvirt-domain.h | 5 +

[libvirt] [PATCH 2/5] virsh: Implement command for virDomainSetVcpu called setvcpu

2017-02-10 Thread Peter Krempa
Add a simple virsh command handler which makes use of the new API. --- tools/virsh-domain.c | 88 tools/virsh.pod | 19 2 files changed, 107 insertions(+) diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c index

[libvirt] [PATCH 0/5] Add API for individual/specific vCPU hotplug

2017-02-10 Thread Peter Krempa
The new API allows selecting specific vCPUs to be added/removed from the VM. The existing APIs allowed only adding/removing from the end which did not play well with NUMA. Peter Krempa (5): lib: Add API for specific vCPU hot(un)plug virsh: Implement command for virDomainSetVcpu called setvcpu

[libvirt] [PATCH 3/5] qemu: Implement individual vcpu hotplug API

2017-02-10 Thread Peter Krempa
Add code that validates user's selection of cores and then uses the existing code to plug in the vCPU. --- src/qemu/qemu_driver.c | 74 +++ src/qemu/qemu_hotplug.c | 153 src/qemu/qemu_hotplug.h | 7 +++ 3 files changed, 234

Re: [libvirt] [PATCH v4] bhyve: add e1000 nic support

2017-02-10 Thread Roman Bogorodskiy
Laine Stump wrote: > On 02/01/2017 11:28 AM, Roman Bogorodskiy wrote: > > Recently e1000 NIC support was added to bhyve; implement that in > > the bhyve driver: > > > > - Add capability check by analyzing output of the 'bhyve -s 0,e1000' > > command > > - Modify bhyveBuildNetArgStr() to

[libvirt] [PATCH v2 1/3] nodedev: Add driver callback mechanism to add/remove devices

2017-02-10 Thread John Ferlan
Add a callback mechanism as a side door of sorts to the event mgmt functions that are triggered when a node_device object is added or removed. This includes a mechanism to enumerate already added devices for those stateInitialize functions called after the initial nodedevRegister is called. If

[libvirt] [PATCH v2 3/3] qemu: Add configuration variable to control nodedev enumeration

2017-02-10 Thread John Ferlan
Add an 'enumerate_nodedev' qemu configuration variable to control whether the node device enumeration and add/remove event notification mechanism is enabled. This ensures only those environments that desire to utilize a domain vHBA need to have the (slight) overhead of adding the device hash table

[libvirt] [PATCH v2 0/3] Add callback mech for qemu and nodedev

2017-02-10 Thread John Ferlan
v1: http://www.redhat.com/archives/libvir-list/2017-February/msg00354.html Changes since v1: - Rather than calling the enumeration API from node_device_conf, return the address of the enumeration API to the calling driver and let it make the callback. - If the enumeration callback

[libvirt] [PATCH v2 2/3] qemu: Use nodedev callback mechanism to to get a nodedev data

2017-02-10 Thread John Ferlan
Using the nodedev driver callback mechanism - allow qemu to be notified whenever a nodedev is added/removed. Keep track of the node devices in a hash table rather than requiring a connection in order to get specific information about a node device that qemu would eventually like to keep track of.

Re: [libvirt] [PATCH] remote generator: Increase upper limit on lists of node devices

2017-02-10 Thread Boris Fiuczynski
On 02/10/2017 04:13 PM, Michal Privoznik wrote: On 02/10/2017 02:56 PM, Boris Fiuczynski wrote: On a system with 697 SCSI disks each configured with 8 paths the command virsh nodedev-list fails with error: Failed to list node devices error: internal error: Too many node_devices '16816' for

[libvirt] [PATCH v2] node_device: Check return value for udev_new()

2017-02-10 Thread Marc Hartmayer
The comment was actually wrong as https://www.freedesktop.org/software/systemd/man/udev_new.html# mentions that on failure NULL is returned. Signed-off-by: Marc Hartmayer --- src/node_device/node_device_udev.c | 11 +-- 1 file changed, 5 insertions(+), 6

Re: [libvirt] [PATCH 4/4] rpc: Fix potentially segfaults

2017-02-10 Thread Marc Hartmayer
On Thu, Feb 09, 2017 at 08:17 PM +0100, Laine Stump wrote: > On 02/09/2017 09:21 AM, Marc Hartmayer wrote: >> On Thu, Feb 09, 2017 at 03:13 PM +0100, Marc Hartmayer >> wrote: >>> We have to allocate first and if, and only if, it was successful we

Re: [libvirt] [PATCH 2/3] util: Introduce virFileComparePaths

2017-02-10 Thread Erik Skultety
> > + * Returns 0 if the paths are equal, 1 if they're not or -1 in case of an > > + * error. > > + */ > > +int > > +virFileComparePaths(const char *p1, const char *p2) > > I think this be "virFileCompareResolvedPaths" - change all the places... > Better representation than just ComparePaths >

Re: [libvirt] [PATCH 3/3] storage: Fix checking whether source filesystem is mounted

2017-02-10 Thread Erik Skultety
On Thu, Feb 09, 2017 at 06:05:41PM -0500, John Ferlan wrote: > > > On 02/07/2017 09:16 AM, Erik Skultety wrote: > > Right now, we use simple string comparison both on the source paths > > (mount's output vs pool's source) and the target (mount's mnt_dir vs > > pool's target). The problem are

Re: [libvirt] [PATCH] remote generator: handle remoteDomainCreateWithFlags()

2017-02-10 Thread Marc Hartmayer
On Thu, Feb 09, 2017 at 11:39 PM +0100, John Ferlan wrote: > On 01/19/2017 03:17 PM, Marc Hartmayer wrote: >> This commit removes the handcrafted code for >> remoteDomainCreateWithFlags() and lets it auto generate. >> >> A little bit of history repeating... >> Commit

Re: [libvirt] [PATCH 06/11] storage: backend: Refactor registration of the backend drivers

2017-02-10 Thread John Ferlan
On 02/08/2017 11:27 AM, Peter Krempa wrote: > Add APIs that allow to dynamically register driver backends so that the > list of available drivers does not need to be known during compile time. > > This will allow us to modularize the storage driver on runtime. > --- >

Re: [libvirt] [PATCH 07/11] storage: Turn driver backends into (static) modules

2017-02-10 Thread John Ferlan
On 02/08/2017 11:27 AM, Peter Krempa wrote: > Compile the storage driver into modules rather than by compiling all > files together. All modules are still linked together statically. > --- > src/Makefile.am | 114 > > 1 file changed, 98

Re: [libvirt] [PATCH 08/11] storage: Turn storage backends into dynamic modules

2017-02-10 Thread John Ferlan
On 02/08/2017 11:27 AM, Peter Krempa wrote: > If driver modules are enabled turn storage driver backends into > dynamically loadable objects. This will allow greater modularity for > binary distributions, where heavyweight dependencies as rbd and gluster > can be avoided by selecting only a

Re: [libvirt] [PATCH] tests: Link virusbmock with probes

2017-02-10 Thread Boris Fiuczynski
On 02/10/2017 02:04 PM, John Ferlan wrote: Seeing similar error to commit id '997be5c27' with the inability to find the libvirt_event_poll_purge_timeout_semaphore symbol causing a virusbtest failure. Signed-off-by: John Ferlan --- This is a really strange one... I applied

Re: [libvirt] [PATCH 09/11] tests: drivermodule: Make sure that all compiled storage backends can be loaded

2017-02-10 Thread John Ferlan
On 02/08/2017 11:27 AM, Peter Krempa wrote: > Add a new storage driver registration function that will force the > backend code to fail if any of the storage backend modules can't be > loaded. This will make sure that they work and are present. > --- > src/storage/storage_backend.c | 16

Re: [libvirt] [PATCH 08/11] storage: Turn storage backends into dynamic modules

2017-02-10 Thread Peter Krempa
On Fri, Feb 10, 2017 at 08:34:11 -0500, John Ferlan wrote: > > > On 02/08/2017 11:27 AM, Peter Krempa wrote: > > If driver modules are enabled turn storage driver backends into > > dynamically loadable objects. This will allow greater modularity for > > binary distributions, where heavyweight

[libvirt] [RFC] Substitute poll by epoll in virEventPollRunOnce

2017-02-10 Thread Derbyshev Dmitriy
From: Derbyshev Dmitry This makes it possible to avoid allocations in virEventPollMakePollFDs, as well as generally reduces time spent in kernel if handles remain the same, which should generally be true. __ Questions: 1) What

[libvirt] [PATCH] tests: Link virusbmock with probes

2017-02-10 Thread John Ferlan
Seeing similar error to commit id '997be5c27' with the inability to find the libvirt_event_poll_purge_timeout_semaphore symbol causing a virusbtest failure. Signed-off-by: John Ferlan --- This is a really strange one... I applied Michal's patches, the error occurred. I

[libvirt] [PATCH] libxl: Resolve possible resource leak in dom0 maximum memory setting

2017-02-10 Thread John Ferlan
If either the "if (STRPREFIX(mem_tokens[j], "max:"))" is never entered or the "if (virStrToLong_ull(mem_tokens[j] + 4, , 10, maxmem) < 0)" break is hit, control goes back to the outer loop processing 'cmd_tokens' and it's possible that the 'mem_tokens' would be overwritten. Found by Coverity

Re: [libvirt] [PATCH 10/11] spec: Modularize the storage driver

2017-02-10 Thread John Ferlan
On 02/08/2017 11:27 AM, Peter Krempa wrote: > Create a new set of sub-packages containing the new storage driver > modules so that certain heavy-weight backends (gluster, rbd) can be > installed separately only if required. > > To keep backward compatibility the 'libvirt-driver-storage' package

[libvirt] [PATCH] remote generator: Increase upper limit on lists of node devices

2017-02-10 Thread Boris Fiuczynski
On a system with 697 SCSI disks each configured with 8 paths the command virsh nodedev-list fails with error: Failed to list node devices error: internal error: Too many node_devices '16816' for limit '16384' Increasing the upper limit on lists of node devices from 16K to 64K. Signed-off-by:

Re: [libvirt] [PATCH 11/11] news: Mention storage driver split

2017-02-10 Thread John Ferlan
On 02/08/2017 11:27 AM, Peter Krempa wrote: > --- > docs/news.xml | 10 ++ > 1 file changed, 10 insertions(+) > > diff --git a/docs/news.xml b/docs/news.xml > index 69ed6a75e..041515253 100644 > --- a/docs/news.xml > +++ b/docs/news.xml > @@ -43,6 +43,16 @@ >and network. >

Re: [libvirt] [PATCH] qemu: Forbid slashes in shmem name

2017-02-10 Thread Daniel P. Berrange
On Fri, Feb 10, 2017 at 09:07:36AM -0500, John Ferlan wrote: > > > On 02/02/2017 08:14 AM, Martin Kletzander wrote: > > With that users could access files outside /dev/shm. That itself > > isn't a security problem, but might cause some errors we want to > > avoid. So let's forbid slashes as we

Re: [libvirt] [PATCH] Mention the min duration for nodesuspend explicitly

2017-02-10 Thread John Ferlan
On 02/07/2017 07:53 AM, Nitesh Konkar wrote: > Although currently this is documented in virsh man page > and virsh help, the expicit mention in the error message > is helful for tools using the API directly. > > Signed-off-by: Nitesh Konkar > --- >

[libvirt] [PATCH 1/7] qemu_cgroup: Kill qemuSetupHostUSBDeviceCgroup

2017-02-10 Thread Michal Privoznik
There's no need for this function. Currently it is passed as a callback to virUSBDeviceFileIterate(). However, USB devices have just one file path. Therefore we can mimic approach used in qemuDomainGetHostdevPath() to get path and call virCgroupAllowDevicePath() directly. Signed-off-by: Michal

[libvirt] [PATCH 6/7] qemuDomainGetHostdevPath: Report /dev/vfio/vfio less frequently

2017-02-10 Thread Michal Privoznik
So far, qemuDomainGetHostdevPath has no knowledge of the reasong it is called and thus reports /dev/vfio/vfio for every VFIO backed device. This is suboptimal, as we want it to: a) report /dev/vfio/vfio on every addition or domain startup b) report /dev/vfio/vfio only on last VFIO device being

[libvirt] [PATCH 4/7] qemuSetupHostdevCgroup: Use qemuDomainGetHostdevPath

2017-02-10 Thread Michal Privoznik
Since these two functions are nearly identical (with qemuSetupHostdevCgroup actually calling virCgroupAllowDevicePath) we can have one function call the other and thus de-duplicate some code. Signed-off-by: Michal Privoznik --- src/qemu/qemu_cgroup.c | 147

[libvirt] [PATCH 0/7] qemu: Be more cautious about allowed devices

2017-02-10 Thread Michal Privoznik
As discussed here [1], it's unsafe to allow /dev/vfio/vfio to all the domains (even those not doing PCI assignemnt). The same goes for /dev/dri/*. 1: https://www.redhat.com/archives/libvir-list/2017-February/msg00267.html Michal Privoznik (7): qemu_cgroup: Kill qemuSetupHostUSBDeviceCgroup

[libvirt] [PATCH 3/7] qemu_cgroup: Kill qemuSetupHostSCSIVHostDeviceCgroup

2017-02-10 Thread Michal Privoznik
There's no need for this function. Currently it is passed as a callback to virSCSIVHostDeviceFileIterate(). However, SCSI host devices have just one file path. Therefore we can mimic approach used in qemuDomainGetHostdevPath() to get path and call virCgroupAllowDevicePath() directly.

[libvirt] [PATCH 5/7] qemuDomainGetHostdevPath: Create /dev/vfio/vfio iff needed

2017-02-10 Thread Michal Privoznik
So far, we are allowing /dev/vfio/vfio in the devices cgroup unconditionally (and creating it in the namespace too). Even if domain has no hostdev assignment configured. This is potential security hole. Therefore, when starting the domain (or hotplugging a hostdev) create & allow /dev/vfio/vfio

[libvirt] [PATCH 7/7] qemu: Allow /dev/dri/render* for virgl domains

2017-02-10 Thread Michal Privoznik
When enabling virgl, qemu opens /dev/dri/render*. So far, we are not allowing that in devices cgroup nor creating the file in domain's namespace and thus requiring users to set the paths in qemu.conf. This, however, is suboptimal as it allows access to ALL qemu processes even those which don't

[libvirt] [PATCH 2/7] qemu_cgroup: Kill qemuSetupHostSCSIDeviceCgroup

2017-02-10 Thread Michal Privoznik
There's no need for this function. Currently it is passed as a callback to virSCSIDeviceFileIterate(). However, SCSI devices have just one file path. Therefore we can mimic approach used in qemuDomainGetHostdevPath() to get path and call virCgroupAllowDevicePath() directly. Signed-off-by: Michal

Re: [libvirt] [PATCH] qemu: Forbid slashes in shmem name

2017-02-10 Thread John Ferlan
On 02/02/2017 08:14 AM, Martin Kletzander wrote: > With that users could access files outside /dev/shm. That itself > isn't a security problem, but might cause some errors we want to > avoid. So let's forbid slashes as we do with domain and volume names > and also mention that in the schema. >

Re: [libvirt] [RFC v3 1/8] Resctrl: Add some utils functions

2017-02-10 Thread Marcelo Tosatti
On Thu, Feb 09, 2017 at 03:43:02PM +0800, Eli Qiao wrote: > This patch adds some utils struct and functions to expose resctrl > information. > > virResCtrlAvailable: If resctrl interface exist on host > virResCtrlGet: get specify type resource contral information > virResCtrlInit: initialize

Re: [libvirt] [RFC v3 0/8] Support cache tune in libvirt

2017-02-10 Thread Marcelo Tosatti
On Fri, Feb 10, 2017 at 09:58:19AM +0800, Eli Qiao wrote: > > > -- > Eli Qiao > Sent with Sparrow (http://www.sparrowmailapp.com/?sig) > > > On Thursday, 9 February 2017 at 10:25 PM, Marcelo Tosatti wrote: > > > On Thu, Feb 09, 2017 at 03:43:01PM +0800, Eli Qiao wrote: > > > Addressed

Re: [libvirt] [RFC v3 3/8] Resctrl: Add new xml element to support cache tune

2017-02-10 Thread Marcelo Tosatti
On Thu, Feb 09, 2017 at 03:43:04PM +0800, Eli Qiao wrote: > This patch adds new xml element to support cache tune as: > > > ... > vcpus='1,2'/> > ... > > > id: any non-minus number > host_id: reference of the host's cache banks id, it's from capabilities > type: cache bank type >

Re: [libvirt] [v4 0/9] Support cache tune in libvirt

2017-02-10 Thread Marcelo Tosatti
On Fri, Feb 10, 2017 at 02:42:04PM +0800, Eli Qiao wrote: > Addressed comment from v3 -> v4: > > Daniel & Marcelo: >* Added concurrence support > > Addressed comment from v2 -> v3: > > Daniel: > * Fixed coding style, passed `make check` and `make syntax-check` > > *

[libvirt] [PATCH] util: Fix indentation for virnetdevmacvlan

2017-02-10 Thread Nitesh Konkar
Signed-off-by: Nitesh Konkar --- src/util/virnetdevmacvlan.c | 30 +++--- src/util/virnetdevmacvlan.h | 20 ++-- 2 files changed, 25 insertions(+), 25 deletions(-) diff --git a/src/util/virnetdevmacvlan.c

Re: [libvirt] [PATCH] tests: Link virusbmock with probes

2017-02-10 Thread Michal Privoznik
On 02/10/2017 02:04 PM, John Ferlan wrote: > Seeing similar error to commit id '997be5c27' with the inability > to find the libvirt_event_poll_purge_timeout_semaphore symbol > causing a virusbtest failure. > > Signed-off-by: John Ferlan > --- > > This is a really strange

[libvirt] [PATCH v2] Don't print extra newline in virsh domstats output

2017-02-10 Thread Nitesh Konkar
Signed-off-by: Nitesh Konkar --- virsh domstats --perf Domain: 'Fedora123' perf.cache_misses=394986 Domain: 'Fedora' perf.cache_misses=447017 virsh domstats Domain: 'Fedora123' state.state=1 state.reason=1 cpu.time=562472167198 cpu.user=22834000

Re: [libvirt] [PATCH] remote generator: Increase upper limit on lists of node devices

2017-02-10 Thread Michal Privoznik
On 02/10/2017 02:56 PM, Boris Fiuczynski wrote: > On a system with 697 SCSI disks each configured with 8 paths the command > virsh nodedev-list fails with > error: Failed to list node devices > error: internal error: Too many node_devices '16816' for limit '16384' > Increasing the upper limit on

Re: [libvirt] [PATCH] libxl: Resolve possible resource leak in dom0 maximum memory setting

2017-02-10 Thread Michal Privoznik
On 02/10/2017 02:06 PM, John Ferlan wrote: > If either the "if (STRPREFIX(mem_tokens[j], "max:"))" is never entered > or the "if (virStrToLong_ull(mem_tokens[j] + 4, , 10, maxmem) < 0)" break > is hit, control goes back to the outer loop processing 'cmd_tokens' and > it's possible that the