[libvirt] [RFC v3 4/8] Resctrl: Add private interface to set cachebanks

2017-02-08 Thread Eli Qiao
virResCtrlSetCacheBanks: Set cache banks of a libvirt domain. It will create new resource domain under `/sys/fs/resctrl` and fill the schemata according the cache banks configration. virResCtrlUpdate: Update the schemata after libvirt domain destroy. Signed-off-by: Eli Qiao

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

2017-02-08 Thread Eli Qiao
Addressed comment from v2 -> v3: Daniel: * Fixed coding style, passed `make check` and `make syntax-check` * Variables renaming and move from header file to c file. * For locking/mutex support, no progress. There are some discussion from mailing list, but I can not find

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

2017-02-08 Thread Eli Qiao
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 resctrl struct from the host's sys fs. resctrlall[]: an array to maintain

[libvirt] [RFC v3 7/8] Resctrl: Make sure l3data/l3code are pairs

2017-02-08 Thread Eli Qiao
l3data and l3code type of cache banks should be configured pairs. Signed-off-by: Eli Qiao --- src/conf/domain_conf.c | 19 +++ src/util/virresctrl.c | 1 - src/util/virresctrl.h | 2 ++ 3 files changed, 21 insertions(+), 1 deletion(-) diff --git

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

2017-02-08 Thread Eli Qiao
This patch adds new xml element to support cache tune as: ... ... id: any non-minus number host_id: reference of the host's cache banks id, it's from capabilities type: cache bank type size: should be multiples of the min_size of the bank on host. vcpus: cache allocation on vcpu set, if

[libvirt] [RFC v3 8/8] Resctrl: Compatible mode for cdp enabled

2017-02-08 Thread Eli Qiao
This patch support l3 cache allocation compatible mode if cdp enabled on host. In this case l3code/l3data has same schemata. Signed-off-by: Eli Qiao --- src/conf/domain_conf.c | 15 +-- src/util/virresctrl.c | 11 +++ 2 files changed, 24

[libvirt] [RFC v3 2/8] Resctrl: expose cache information to capabilities

2017-02-08 Thread Eli Qiao
This patch expose cache information to host's capabilites xml. For l3 cache allocation For l3 cache allocation supported cdp(seperate data/code): RFC on mailing list. https://www.redhat.com/archives/libvir-list/2017-January/msg00644.html

[libvirt] [RFC v3 5/8] Qemu: Set cache banks

2017-02-08 Thread Eli Qiao
Set cache banks while booting a new domain. Signed-off-by: Eli Qiao --- src/qemu/qemu_driver.c | 6 -- src/qemu/qemu_process.c | 53 + 2 files changed, 57 insertions(+), 2 deletions(-) diff --git

[libvirt] [RFC v3 6/8] Resctrl: enable l3code/l3data

2017-02-08 Thread Eli Qiao
Enable l3code/l3data while doing cache tune. l3code/l3data should use a continus cbm in their seperated schemata and the cache size are shared between them, so we need to deal them differently with l3 cache. This should enable cdp feature while mounting /sys/fs/resctrl, eg: mount -t resctrl

Re: [libvirt] [PATCH V2 1/2] libxl: set default disk format in device post-parse

2017-02-08 Thread Michal Privoznik
On 02/07/2017 08:46 PM, Jim Fehlig wrote: > When starting a domian, a libxl_domain_config object is created from > virDomainDef. Any virDomainDiskDef devices with a format of > VIR_STORAGE_FILE_NONE are mapped to LIBXL_DISK_FORMAT_RAW in the > corresponding libxl_disk_device, but the

Re: [libvirt] [PATCH V2 2/2] libxl: fix disk detach when not specified

2017-02-08 Thread Michal Privoznik
On 02/07/2017 08:46 PM, Jim Fehlig wrote: > When a user does not explicitly set a in the disk config, > libvirt defers selection of a default to libxl. This approach works > fine when starting a domain with such configuration or attaching a > disk to a running domain. But when detaching such a

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

2017-02-08 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 2/3] qemu: Use nodedev callback mechanism to to get a nodedev data

2017-02-08 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.

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

2017-02-08 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.

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

2017-02-08 Thread John Ferlan
Add a callback mechanism for the nodedev driver (mimics the nwfilter) to allow the (c)ability to directly enumerate node devices and add/remove devices based on udev events. This is a set up of sorts for the ability to add a vHBA definition to a domain, create the vHBA, and allow the LUN's

[libvirt] [PATCH] conf: fix use-after-free when sending event message

2017-02-08 Thread Wang King
If there is a process with a client which registers event callbacks, and it calls libvirt's API which uses the same virConnectPtr in that callback function. When this process exit abnormally lead to client disconnect, there is a possibility that the main thread is refer to virServerClient just

Re: [libvirt] [PATCH 2/2] libxl: fix dom0 maximum memory setting

2017-02-08 Thread Jim Fehlig
Joao Martins wrote: > On 02/08/2017 04:06 PM, Jim Fehlig wrote: >> Joao Martins wrote: >>> On 02/02/2017 10:31 PM, Jim Fehlig wrote: When the libxl driver is initialized, it creates a virDomainDef object for dom0 and adds it to the list of domains. Total memory for dom0 was being

[libvirt] [PATCH V2 2/2] libxl: fix dom0 maximum memory setting

2017-02-08 Thread Jim Fehlig
When the libxl driver is initialized, it creates a virDomainDef object for dom0 and adds it to the list of domains. Total memory for dom0 was being set from the max_memkb field of libxl_dominfo struct retrieved from libxl, but this field can be set to LIBXL_MEMKB_DEFAULT (~0ULL) if dom0 maximum

[libvirt] [PATCH V2 1/2] libxl: fix reporting of maximum memory

2017-02-08 Thread Jim Fehlig
The libxl driver reports different values of maximum memory depending on state of a domain. If inactive, maximum memory value is reported correctly. When active, maximum memory is derived from max_pages value returned by the XEN_SYSCTL_getdomaininfolist sysctl operation. But max_pages can be

[libvirt] [PATCH V2 0/2] libxl: a few domain maximum memory fixes

2017-02-08 Thread Jim Fehlig
Patch 1 fixes reporting of domain maximum memory for running domains. When creating a virDomainDef object to represent dom0, max memory was not set correctly, which is fixed by patch2. V2: Check return value of libxl_get_physinfo and libxlDriverGetDom0MaxmemConf in patch2. Jim Fehlig (2):

[libvirt] [PATCH] nodedev: Return the parent for a virNodeDevicePtr struct

2017-02-08 Thread John Ferlan
When the 'parent' was added to the virNodeDevicePtr structure by commit id 'e8a4ea75a' the 'parent' field was not properly filled in when a virGetNodeDevice call was made within driver/config code. Only the device name was ever filled in. Fetching the parent required a second trip via

Re: [libvirt] [PATCH 2/2] libxl: use init and dispose functions with libxl_physinfo

2017-02-08 Thread Jim Fehlig
Joao Martins wrote: > On 02/08/2017 04:17 PM, Jim Fehlig wrote: >> Joao Martins wrote: >>> On 02/02/2017 10:39 PM, Jim Fehlig wrote: The typical pattern when calling libxl functions that populate a structure is libxl_foo foo; libxl_foo_init(); libxl_get_foo(ctx,

Re: [libvirt] [PATCH] vz: cleanup: remove unused constant

2017-02-08 Thread Andrea Bolognani
On Wed, 2017-02-08 at 18:26 +0300, Maxim Nestratov wrote: > PARALLELS_STATISTICS_DROP_COUNT isn't used anymore > > Signed-off-by: Maxim Nestratov ACK -- Andrea Bolognani / Red Hat / Virtualization -- libvir-list mailing list libvir-list@redhat.com

Re: [libvirt] [PATCH 2/2] libxl: fix dom0 maximum memory setting

2017-02-08 Thread Joao Martins
On 02/08/2017 04:06 PM, Jim Fehlig wrote: > Joao Martins wrote: >> On 02/02/2017 10:31 PM, Jim Fehlig wrote: >>> When the libxl driver is initialized, it creates a virDomainDef >>> object for dom0 and adds it to the list of domains. Total memory >>> for dom0 was being set from the max_memkb field

Re: [libvirt] [PATCH 2/2] libxl: use init and dispose functions with libxl_physinfo

2017-02-08 Thread Joao Martins
On 02/08/2017 04:17 PM, Jim Fehlig wrote: > Joao Martins wrote: >> On 02/02/2017 10:39 PM, Jim Fehlig wrote: >>> The typical pattern when calling libxl functions that populate a >>> structure is >>> >>> libxl_foo foo; >>> libxl_foo_init(); >>> libxl_get_foo(ctx, ); >>> ... >>>

[libvirt] [PATCH RFC 1/4] qemu_agent: move agent into util

2017-02-08 Thread Joao Martins
As it could be shared with libxl which now allows channels to be created. Also changed filename to match others in the same directory namely to virqemuagent.{h,c} Signed-off-by: Joao Martins --- po/POTFILES.in |2 +- src/Makefile.am |

[libvirt] [PATCH RFC 2/4] qemu_agent: ignore requests echoed back by guest

2017-02-08 Thread Joao Martins
Signed-off-by: Joao Martins --- src/util/virqemuagent.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/util/virqemuagent.c b/src/util/virqemuagent.c index caabae0..ffb3489 100644 --- a/src/util/virqemuagent.c +++ b/src/util/virqemuagent.c @@

[libvirt] [PATCH RFC 0/4] libxl: qemu agent support

2017-02-08 Thread Joao Martins
Hey! Back when channels were introduced in libxl (in answer to Michal[0]) I suggested the idea of integrating qemu guest agent (which currently lives qemu driver). This series is an attempt at pulling qemu agent from qemu driver into util in using it in libxl in subsequent patches. What do folks

[libvirt] [PATCH RFC 4/4] libxl: domainInterfaceAddresses agent support

2017-02-08 Thread Joao Martins
Allow querying of guest interface address through agent through command `virsh domifaddr test --source agent` Signed-off-by: Joao Martins --- src/libxl/libxl_driver.c | 18 ++ 1 file changed, 18 insertions(+) diff --git a/src/libxl/libxl_driver.c

[libvirt] [PATCH RFC 3/4] libxl: implement qemu-agent-command

2017-02-08 Thread Joao Martins
Signed-off-by: Joao Martins --- src/libxl/libxl_domain.c | 239 ++- src/libxl/libxl_domain.h | 16 src/libxl/libxl_driver.c | 51 ++ 3 files changed, 305 insertions(+), 1 deletion(-) diff --git

[libvirt] [PATCH 05/11] daemon: Refactor connection driver module loading

2017-02-08 Thread Peter Krempa
Pass the registration function name to virDriverLoadModule so that we can later call specific functions if necessary (e.g. for testing purposes). This gets rid of the rather ugly automatic name generator and unifies the code to load/initialize the modules. It's also clear which registration

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

2017-02-08 Thread Peter Krempa
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 will be turned into a virtual package pulling in all

[libvirt] [PATCH 01/11] configure: Fix configure output for RBD storage backend

2017-02-08 Thread Peter Krempa
We'd print status for the 'dir' backend instead of the correct one. --- m4/virt-storage-rbd.m4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/m4/virt-storage-rbd.m4 b/m4/virt-storage-rbd.m4 index 0104b7cfc..48522a6a7 100644 --- a/m4/virt-storage-rbd.m4 +++

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

2017-02-08 Thread Peter Krempa
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 subset of drivers if the rest is not necessary. The

[libvirt] [PATCH 04/11] driver: Split/refactor driver module loading

2017-02-08 Thread Peter Krempa
Split the convoluted driver loader function into simpler parts which will potentially allow reuse. --- src/driver.c| 133 +--- src/driver.h| 3 + src/libvirt_driver_modules.syms | 1 + 3 files changed, 101

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

2017-02-08 Thread Peter Krempa
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 insertions(+), 16 deletions(-) diff --git

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

2017-02-08 Thread Peter Krempa
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 src/storage/storage_backend.h | 2 +-

[libvirt] [PATCH 03/11] tests: drivermodule: Drop unused macro arguments

2017-02-08 Thread Peter Krempa
Refactors of the test resulted into the second argument of the 'TEST' macro to be unused. Drop them. --- tests/virdrivermoduletest.c | 31 ++- 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/tests/virdrivermoduletest.c b/tests/virdrivermoduletest.c

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

2017-02-08 Thread Peter Krempa
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. --- src/storage/storage_backend.c | 111 ++---

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

2017-02-08 Thread Peter Krempa
--- 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. + + + storage: modularize

[libvirt] [PATCH 02/11] tests: storagepoolxml2xml: Remove compile conditionals

2017-02-08 Thread Peter Krempa
The XML2XML test should work properly even if the storage backend is disabled, since it does not use it. --- tests/storagepoolxml2xmltest.c | 6 -- 1 file changed, 6 deletions(-) diff --git a/tests/storagepoolxml2xmltest.c b/tests/storagepoolxml2xmltest.c index 98a844926..79bdc26da 100644

[libvirt] [PATCH 00/11] storage: modularize the storage driver backends

2017-02-08 Thread Peter Krempa
Split up the storage driver backends into loadable modules so that binary distributions don't have to compromise on shipping the storage driver with all backends which may pull in too many dependencies. Peter Krempa (11): configure: Fix configure output for RBD storage backend tests:

Re: [libvirt] [PATCH 2/2] libxl: use init and dispose functions with libxl_physinfo

2017-02-08 Thread Jim Fehlig
Joao Martins wrote: > On 02/02/2017 10:39 PM, Jim Fehlig wrote: >> The typical pattern when calling libxl functions that populate a >> structure is >> >> libxl_foo foo; >> libxl_foo_init(); >> libxl_get_foo(ctx, ); >> ... >> libxl_foo_dispose(); >> >> Fix several instances of

Re: [libvirt] [PATCH 2/2] libxl: fix dom0 maximum memory setting

2017-02-08 Thread Jim Fehlig
Joao Martins wrote: > On 02/02/2017 10:31 PM, Jim Fehlig wrote: >> When the libxl driver is initialized, it creates a virDomainDef >> object for dom0 and adds it to the list of domains. Total memory >> for dom0 was being set from the max_memkb field of libxl_dominfo >> struct retrieved from libxl,

Re: [libvirt] [PATCH 1/2] vz: fix handle leak in prlsdkHandleVmStateEvent

2017-02-08 Thread Daniel P. Berrange
On Wed, Feb 08, 2017 at 06:28:33PM +0300, Maxim Nestratov wrote: > Every successful call of PrlEvent_GetParamByName allocates a handle, > which has to be freed. > > Signed-off-by: Maxim Nestratov > --- > src/vz/vz_sdk.c | 1 + > 1 file changed, 1 insertion(+) > > diff

Re: [libvirt] [PATCH 2/2] vz: fix event handle leak in prlsdkHandlePerfEvent

2017-02-08 Thread Daniel P. Berrange
On Wed, Feb 08, 2017 at 06:28:34PM +0300, Maxim Nestratov wrote: > When we happen to lose a domain but still get a performance event > for it, we should also free the event handle. > > Signed-off-by: Maxim Nestratov > --- > src/vz/vz_sdk.c | 4 +++- > 1 file changed, 3

[libvirt] [PATCH 2/2] vz: fix event handle leak in prlsdkHandlePerfEvent

2017-02-08 Thread Maxim Nestratov
When we happen to lose a domain but still get a performance event for it, we should also free the event handle. Signed-off-by: Maxim Nestratov --- src/vz/vz_sdk.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/vz/vz_sdk.c b/src/vz/vz_sdk.c

[libvirt] [PATCH] vz: cleanup: remove unused constant

2017-02-08 Thread Maxim Nestratov
PARALLELS_STATISTICS_DROP_COUNT isn't used anymore Signed-off-by: Maxim Nestratov --- src/vz/vz_sdk.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/vz/vz_sdk.c b/src/vz/vz_sdk.c index 614dca1..30eb743 100644 --- a/src/vz/vz_sdk.c +++ b/src/vz/vz_sdk.c @@

[libvirt] [PATCH 1/2] vz: fix handle leak in prlsdkHandleVmStateEvent

2017-02-08 Thread Maxim Nestratov
Every successful call of PrlEvent_GetParamByName allocates a handle, which has to be freed. Signed-off-by: Maxim Nestratov --- src/vz/vz_sdk.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/vz/vz_sdk.c b/src/vz/vz_sdk.c index 727b572..ec954dd 100644 ---

[libvirt] [PATCH 0/2] vz: fix two handle leaks

2017-02-08 Thread Maxim Nestratov
Maxim Nestratov (2): vz: fix handle leak in prlsdkHandleVmStateEvent vz: fix event handle leak in prlsdkHandlePerfEvent src/vz/vz_sdk.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) -- 2.4.11 -- libvir-list mailing list libvir-list@redhat.com

Re: [libvirt] [PATCH] xenconfig: fix xml conversion convert with no graphics

2017-02-08 Thread Jim Fehlig
Joao Martins wrote: > If no graphics element is in XML xenFormatXLSpice will access > graphics without checking it has one in the first place, leading to a > segmentation fault. > > Signed-off-by: Joao Martins ACK. I changed the commit description to "xenconfig: fix

Re: [libvirt] [RFC PATCH 00/10] introduce push backups

2017-02-08 Thread Martin Kletzander
On Wed, Feb 08, 2017 at 06:11:30PM +0300, Maxim Nestratov wrote: 08-Feb-17 17:52, Martin Kletzander пишет: On Wed, Jan 18, 2017 at 01:21:48PM +0300, Nikolay Shirokovskiy wrote: By the way we came to agreement to create distinct API to support backup operations in [1] and there is a

Re: [libvirt] [PATCH] qemu_security: Introduce ImageLabel APIs

2017-02-08 Thread Peter Krempa
On Wed, Feb 08, 2017 at 16:16:42 +0100, Michal Privoznik wrote: > Just like we need wrappers over other virSecurityManager APIs, we > need one for virSecurityManagerSetImageLabel and > virSecurityManagerRestoreImageLabel. Otherwise we might end up > relabelling device in wrong namespace. > >

[libvirt] [PATCH] qemu_security: Introduce ImageLabel APIs

2017-02-08 Thread Michal Privoznik
Just like we need wrappers over other virSecurityManager APIs, we need one for virSecurityManagerSetImageLabel and virSecurityManagerRestoreImageLabel. Otherwise we might end up relabelling device in wrong namespace. Signed-off-by: Michal Privoznik ---

Re: [libvirt] [RFC PATCH 00/10] introduce push backups

2017-02-08 Thread Maxim Nestratov
08-Feb-17 17:52, Martin Kletzander пишет: On Wed, Jan 18, 2017 at 01:21:48PM +0300, Nikolay Shirokovskiy wrote: By the way we came to agreement to create distinct API to support backup operations in [1] and there is a discussion of pull backup series in [2]. The latter is blocked as some

Re: [libvirt] [PATCH 00/11] qemu: Big namespace cleanup

2017-02-08 Thread Michal Privoznik
On 02/08/2017 11:37 AM, Michal Privoznik wrote: > Couple of these patches were requested in reviews to my previous namespace > patches, couple of them are my own idea. At the same time, 3 bugs are fixed: > 1) qemuSecurity wrappers are preferred over virSecurityManager > 2) corresponding /dev entry

Re: [libvirt] [PATCH 04/11] qemu_security: Kill code duplication

2017-02-08 Thread Michal Privoznik
On 02/08/2017 03:55 PM, Martin Kletzander wrote: > On Wed, Feb 08, 2017 at 03:49:47PM +0100, Peter Krempa wrote: >> On Wed, Feb 08, 2017 at 15:33:48 +0100, Michal Privoznik wrote: >>> On 02/08/2017 02:59 PM, Martin Kletzander wrote: >>> > On Wed, Feb 08, 2017 at 02:37:48PM +0100, Michal Privoznik

Re: [libvirt] [PATCH 04/11] qemu_security: Kill code duplication

2017-02-08 Thread Martin Kletzander
On Wed, Feb 08, 2017 at 03:49:47PM +0100, Peter Krempa wrote: On Wed, Feb 08, 2017 at 15:33:48 +0100, Michal Privoznik wrote: On 02/08/2017 02:59 PM, Martin Kletzander wrote: > On Wed, Feb 08, 2017 at 02:37:48PM +0100, Michal Privoznik wrote: >> On 02/08/2017 01:43 PM, Peter Krempa wrote: >>>

Re: [libvirt] [RFC PATCH 00/10] introduce push backups

2017-02-08 Thread Martin Kletzander
On Wed, Jan 18, 2017 at 01:21:48PM +0300, Nikolay Shirokovskiy wrote: By the way we came to agreement to create distinct API to support backup operations in [1] and there is a discussion of pull backup series in [2]. The latter is blocked as some necessary operations are still experimental in

Re: [libvirt] [PATCH 06/11] qemu_domain: Don't pass virDomainDeviceDefPtr to ns helpers

2017-02-08 Thread Peter Krempa
On Wed, Feb 08, 2017 at 11:37:09 +0100, Michal Privoznik wrote: > There is no need for this. None of the namespace helpers uses it. > Historically it was used when calling secdriver APIs, but we > don't to that anymore. > > Signed-off-by: Michal Privoznik > --- >

Re: [libvirt] [PATCH 04/11] qemu_security: Kill code duplication

2017-02-08 Thread Peter Krempa
On Wed, Feb 08, 2017 at 15:33:48 +0100, Michal Privoznik wrote: > On 02/08/2017 02:59 PM, Martin Kletzander wrote: > > On Wed, Feb 08, 2017 at 02:37:48PM +0100, Michal Privoznik wrote: > >> On 02/08/2017 01:43 PM, Peter Krempa wrote: > >>> On Wed, Feb 08, 2017 at 13:37:48 +0100, Michal Privoznik

Re: [libvirt] [PATCH 02/11] syntax-check: Enforce qemuSecurity

2017-02-08 Thread Michal Privoznik
On 02/08/2017 02:32 PM, Peter Krempa wrote: > On Wed, Feb 08, 2017 at 11:37:05 +0100, Michal Privoznik wrote: >> Now that we have some qemuSecurity wrappers over >> virSecurityManager APIs, lets make sure everybody sticks with >> them. We have them for a reason and calling virSecurityManager >>

Re: [libvirt] [PATCH 04/11] qemu_security: Kill code duplication

2017-02-08 Thread Michal Privoznik
On 02/08/2017 02:59 PM, Martin Kletzander wrote: > On Wed, Feb 08, 2017 at 02:37:48PM +0100, Michal Privoznik wrote: >> On 02/08/2017 01:43 PM, Peter Krempa wrote: >>> On Wed, Feb 08, 2017 at 13:37:48 +0100, Michal Privoznik wrote: On 02/08/2017 01:23 PM, Peter Krempa wrote: > On Wed, Feb

Re: [libvirt] [PATCH 04/11] qemu_security: Kill code duplication

2017-02-08 Thread Peter Krempa
On Wed, Feb 08, 2017 at 14:59:13 +0100, Martin Kletzander wrote: > On Wed, Feb 08, 2017 at 02:37:48PM +0100, Michal Privoznik wrote: > > On 02/08/2017 01:43 PM, Peter Krempa wrote: [...] > > How about simply: > > int > qemuNamespaceMountTransactionStart(virDomainObjPtr vm, >

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

2017-02-08 Thread Roman Bogorodskiy
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 support e1000 and also pass >virConnectPtr so it could

Re: [libvirt] [PATCH 04/11] qemu_security: Kill code duplication

2017-02-08 Thread Martin Kletzander
On Wed, Feb 08, 2017 at 02:37:48PM +0100, Michal Privoznik wrote: On 02/08/2017 01:43 PM, Peter Krempa wrote: On Wed, Feb 08, 2017 at 13:37:48 +0100, Michal Privoznik wrote: On 02/08/2017 01:23 PM, Peter Krempa wrote: On Wed, Feb 08, 2017 at 11:37:07 +0100, Michal Privoznik wrote: Nearly all

Re: [libvirt] [PATCH 03/11] qemuDomainAttachSCSIVHostDevice: manage /dev entry

2017-02-08 Thread Peter Krempa
On Wed, Feb 08, 2017 at 11:37:06 +0100, Michal Privoznik wrote: > Again, one missed bit. This time without this commit there is no > /dev entry when attaching vhost SCSI device. Commit message is a bit confusing. So the /dev/ entry in the namespace of the qemu process is not created when

Re: [libvirt] [PATCH 04/11] qemu_security: Kill code duplication

2017-02-08 Thread Peter Krempa
On Wed, Feb 08, 2017 at 14:37:48 +0100, Michal Privoznik wrote: > On 02/08/2017 01:43 PM, Peter Krempa wrote: > > On Wed, Feb 08, 2017 at 13:37:48 +0100, Michal Privoznik wrote: > >> On 02/08/2017 01:23 PM, Peter Krempa wrote: > >>> On Wed, Feb 08, 2017 at 11:37:07 +0100, Michal Privoznik wrote: >

Re: [libvirt] [PATCH 04/11] qemu_security: Kill code duplication

2017-02-08 Thread Michal Privoznik
On 02/08/2017 01:43 PM, Peter Krempa wrote: > On Wed, Feb 08, 2017 at 13:37:48 +0100, Michal Privoznik wrote: >> On 02/08/2017 01:23 PM, Peter Krempa wrote: >>> On Wed, Feb 08, 2017 at 11:37:07 +0100, Michal Privoznik wrote: Nearly all of these functions look the same. Except for a

Re: [libvirt] [PATCH 2/2] libxl: fix dom0 maximum memory setting

2017-02-08 Thread Joao Martins
On 02/02/2017 10:31 PM, Jim Fehlig wrote: > When the libxl driver is initialized, it creates a virDomainDef > object for dom0 and adds it to the list of domains. Total memory > for dom0 was being set from the max_memkb field of libxl_dominfo > struct retrieved from libxl, but this field can be set

Re: [libvirt] [PATCH 02/11] syntax-check: Enforce qemuSecurity

2017-02-08 Thread Peter Krempa
On Wed, Feb 08, 2017 at 11:37:05 +0100, Michal Privoznik wrote: > Now that we have some qemuSecurity wrappers over > virSecurityManager APIs, lets make sure everybody sticks with > them. We have them for a reason and calling virSecurityManager > API directly instead of wrapper may lead into

Re: [libvirt] [PATCH 07/11] qemuDomainNamespaceSetupDisk: Drop useless @src variable

2017-02-08 Thread Peter Krempa
On Wed, Feb 08, 2017 at 11:37:10 +0100, Michal Privoznik wrote: > Since its introduction in 81df21507bef9 this variable was never > used. > > Signed-off-by: Michal Privoznik > --- > src/qemu/qemu_domain.c | 5 ++--- > 1 file changed, 2 insertions(+), 3 deletions(-) ACK

Re: [libvirt] [PATCH 11/11] qemuDomainNamespaceSetupDisk: Simplify disk check

2017-02-08 Thread Peter Krempa
On Wed, Feb 08, 2017 at 11:37:14 +0100, Michal Privoznik wrote: > Firstly, instead of checking for next->path the > virStorageSourceIsEmpty() function should be used which also > takes disk type into account. > Secondly, not every disk source passed has the correct type set > (due to our

Re: [libvirt] [PATCH 10/11] qemu_security: Introduce ImageLabel APIs

2017-02-08 Thread Peter Krempa
On Wed, Feb 08, 2017 at 11:37:13 +0100, Michal Privoznik wrote: > Just like we need wrappers over other virSecurityManager APIs, we > need one for virSecurityManagerSetImageLabel and > virSecurityManagerRestoreImageLabel. > > Signed-off-by: Michal Privoznik > --- >

Re: [libvirt] [PATCH 09/11] qemuDomainDiskChainElement{Prepare, Revoke}: manage /dev entry

2017-02-08 Thread Peter Krempa
On Wed, Feb 08, 2017 at 11:37:12 +0100, Michal Privoznik wrote: > Again, one missed bit. This time without this commit there is no > /dev entry when doing disk snapshots. Snapshots and block-copy. Both of them start using a new image file. > Signed-off-by: Michal Privoznik

Re: [libvirt] [PATCH 08/11] qemuDomainNamespace{Setup, Teardown}Disk: Don't pass pointer to full disk

2017-02-08 Thread Peter Krempa
On Wed, Feb 08, 2017 at 11:37:11 +0100, Michal Privoznik wrote: > These functions do not need to see the whole virDomainDiskDef. > Moreover, they are going to be called from places where we don't > have access to the full disk definition. Sticking with > virStorageSource is more than enough. > >

Re: [libvirt] [PATCH 2/2] libxl: use init and dispose functions with libxl_physinfo

2017-02-08 Thread Joao Martins
On 02/02/2017 10:39 PM, Jim Fehlig wrote: > The typical pattern when calling libxl functions that populate a > structure is > > libxl_foo foo; > libxl_foo_init(); > libxl_get_foo(ctx, ); > ... > libxl_foo_dispose(); > > Fix several instances of libxl_physinfo missing the init and >

Re: [libvirt] [PATCH 05/11] qemu_security: Drop qemuSecuritySetRestoreAllLabelData struct

2017-02-08 Thread Peter Krempa
On Wed, Feb 08, 2017 at 11:37:08 +0100, Michal Privoznik wrote: > This struct is unused after 095f042ed68b01. > > Signed-off-by: Michal Privoznik > --- > src/qemu/qemu_security.c | 9 - > 1 file changed, 9 deletions(-) ACK signature.asc Description: Digital

Re: [libvirt] [PATCH 1/2] libxl: honor autoballoon setting in libxl.conf

2017-02-08 Thread Joao Martins
On 02/02/2017 10:39 PM, Jim Fehlig wrote: > libxlGetAutoballoonConf is supposed to honor user-specified > autoballoon setting in libxl.conf. As written, the user-specified > setting could be overwritten by the subsequent logic to check > dom0_mem parameter. If user-specified setting is present

Re: [libvirt] [resend v2 0/7] Support cache tune in libvirt

2017-02-08 Thread Marcelo Tosatti
On Wed, Feb 08, 2017 at 10:19:07AM +0800, Eli Qiao wrote: > > > -- > Eli Qiao > Sent with Sparrow (http://www.sparrowmailapp.com/?sig) > > > On Tuesday, 7 February 2017 at 7:56 PM, Marcelo Tosatti wrote: > > > On Tue, Feb 07, 2017 at 02:43:13PM +0800, Eli Qiao wrote: > > > > > > > > >

Re: [libvirt] [PATCH 01/11] qemuDomainAttachSCSIVHostDevice: Prefer qemuSecurity wrappers

2017-02-08 Thread Peter Krempa
On Wed, Feb 08, 2017 at 11:37:04 +0100, Michal Privoznik wrote: > Since we have qemuSecurity wrappers over > virSecurityManagerSetHostdevLabel and > virSecurityManagerRestoreHostdevLabel we ought to use them > instead of calling secdriver APIs directly. Also it possibly would be worth mentioning

Re: [libvirt] [PATCH 04/11] qemu_security: Kill code duplication

2017-02-08 Thread Peter Krempa
On Wed, Feb 08, 2017 at 13:37:48 +0100, Michal Privoznik wrote: > On 02/08/2017 01:23 PM, Peter Krempa wrote: > > On Wed, Feb 08, 2017 at 11:37:07 +0100, Michal Privoznik wrote: > >> Nearly all of these functions look the same. Except for a > >> different virSecurityManager API call. There is no

Re: [libvirt] [PATCH] conf: fix use-after-free when sending event message

2017-02-08 Thread Peter Krempa
On Wed, Feb 08, 2017 at 20:33:10 +0800, Wang King wrote: > > If there is a process with a client which registers event callbacks, > and it calls libvirt's API which uses the same virConnectPtr in that > callback function. When this process exit abnormally lead to client > disconnect, there is a

Re: [libvirt] [PATCH 04/11] qemu_security: Kill code duplication

2017-02-08 Thread Michal Privoznik
On 02/08/2017 01:23 PM, Peter Krempa wrote: > On Wed, Feb 08, 2017 at 11:37:07 +0100, Michal Privoznik wrote: >> Nearly all of these functions look the same. Except for a >> different virSecurityManager API call. There is no need to copy >> paste the code when we can use macros to generate it. >>

[libvirt] [PATCH] conf: fix use-after-free when sending event message

2017-02-08 Thread Wang King
If there is a process with a client which registers event callbacks, and it calls libvirt's API which uses the same virConnectPtr in that callback function. When this process exit abnormally lead to client disconnect, there is a possibility that the main thread is refer to virServerClient just

[libvirt] [PATCH] xenconfig: fix xml conversion convert with no graphics

2017-02-08 Thread Joao Martins
If no graphics element is in XML xenFormatXLSpice will access graphics without checking it has one in the first place, leading to a segmentation fault. Signed-off-by: Joao Martins --- src/xenconfig/xen_xl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff

Re: [libvirt] [PATCH 04/11] qemu_security: Kill code duplication

2017-02-08 Thread Peter Krempa
On Wed, Feb 08, 2017 at 11:37:07 +0100, Michal Privoznik wrote: > Nearly all of these functions look the same. Except for a > different virSecurityManager API call. There is no need to copy > paste the code when we can use macros to generate it. > > Signed-off-by: Michal Privoznik

Re: [libvirt] [PATCH] Remove additional newline from virsh-domain-monitor.c

2017-02-08 Thread Peter Krempa
On Wed, Feb 08, 2017 at 14:20:49 +0530, Nitesh Konkar wrote: > Currently "virsh domstats domainName" result ends > with two blanklines. This shall remove the additional > blank line. > > Signed-off-by: Nitesh Konkar > --- > tools/virsh-domain-monitor.c | 1 - > 1

[libvirt] [PATCH 06/11] qemu_domain: Don't pass virDomainDeviceDefPtr to ns helpers

2017-02-08 Thread Michal Privoznik
There is no need for this. None of the namespace helpers uses it. Historically it was used when calling secdriver APIs, but we don't to that anymore. Signed-off-by: Michal Privoznik --- src/qemu/qemu_domain.c | 28 +--- 1 file changed, 5

[libvirt] [PATCH 07/11] qemuDomainNamespaceSetupDisk: Drop useless @src variable

2017-02-08 Thread Michal Privoznik
Since its introduction in 81df21507bef9 this variable was never used. Signed-off-by: Michal Privoznik --- src/qemu/qemu_domain.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index

[libvirt] [PATCH 09/11] qemuDomainDiskChainElement{Prepare, Revoke}: manage /dev entry

2017-02-08 Thread Michal Privoznik
Again, one missed bit. This time without this commit there is no /dev entry when doing disk snapshots. Signed-off-by: Michal Privoznik --- src/qemu/qemu_domain.c | 14 ++ 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/qemu/qemu_domain.c

[libvirt] [PATCH 05/11] qemu_security: Drop qemuSecuritySetRestoreAllLabelData struct

2017-02-08 Thread Michal Privoznik
This struct is unused after 095f042ed68b01. Signed-off-by: Michal Privoznik --- src/qemu/qemu_security.c | 9 - 1 file changed, 9 deletions(-) diff --git a/src/qemu/qemu_security.c b/src/qemu/qemu_security.c index b2155afcf..06bff2470 100644 ---

[libvirt] [PATCH 02/11] syntax-check: Enforce qemuSecurity

2017-02-08 Thread Michal Privoznik
Now that we have some qemuSecurity wrappers over virSecurityManager APIs, lets make sure everybody sticks with them. We have them for a reason and calling virSecurityManager API directly instead of wrapper may lead into accidentally labelling a file on the host instead of namespace.

[libvirt] [PATCH 03/11] qemuDomainAttachSCSIVHostDevice: manage /dev entry

2017-02-08 Thread Michal Privoznik
Again, one missed bit. This time without this commit there is no /dev entry when attaching vhost SCSI device. Signed-off-by: Michal Privoznik --- src/qemu/qemu_hotplug.c | 8 1 file changed, 8 insertions(+) diff --git a/src/qemu/qemu_hotplug.c

[libvirt] [PATCH 01/11] qemuDomainAttachSCSIVHostDevice: Prefer qemuSecurity wrappers

2017-02-08 Thread Michal Privoznik
Since we have qemuSecurity wrappers over virSecurityManagerSetHostdevLabel and virSecurityManagerRestoreHostdevLabel we ought to use them instead of calling secdriver APIs directly. Signed-off-by: Michal Privoznik --- src/qemu/qemu_hotplug.c | 6 ++ 1 file changed, 2

[libvirt] [PATCH 11/11] qemuDomainNamespaceSetupDisk: Simplify disk check

2017-02-08 Thread Michal Privoznik
Firstly, instead of checking for next->path the virStorageSourceIsEmpty() function should be used which also takes disk type into account. Secondly, not every disk source passed has the correct type set (due to our laziness). Therefore, instead of checking for virStorageSourceIsBlockLocal() and

[libvirt] [PATCH 08/11] qemuDomainNamespace{Setup, Teardown}Disk: Don't pass pointer to full disk

2017-02-08 Thread Michal Privoznik
These functions do not need to see the whole virDomainDiskDef. Moreover, they are going to be called from places where we don't have access to the full disk definition. Sticking with virStorageSource is more than enough. Signed-off-by: Michal Privoznik ---

[libvirt] [PATCH 04/11] qemu_security: Kill code duplication

2017-02-08 Thread Michal Privoznik
Nearly all of these functions look the same. Except for a different virSecurityManager API call. There is no need to copy paste the code when we can use macros to generate it. Signed-off-by: Michal Privoznik --- src/qemu/qemu_security.c | 179

[libvirt] [PATCH 00/11] qemu: Big namespace cleanup

2017-02-08 Thread Michal Privoznik
Couple of these patches were requested in reviews to my previous namespace patches, couple of them are my own idea. At the same time, 3 bugs are fixed: 1) qemuSecurity wrappers are preferred over virSecurityManager 2) corresponding /dev entry is not created when attaching vhost scsi device 3)

[libvirt] [PATCH 10/11] qemu_security: Introduce ImageLabel APIs

2017-02-08 Thread Michal Privoznik
Just like we need wrappers over other virSecurityManager APIs, we need one for virSecurityManagerSetImageLabel and virSecurityManagerRestoreImageLabel. Signed-off-by: Michal Privoznik --- src/qemu/qemu_domain.c | 7 +++ src/qemu/qemu_security.c | 3 +++

  1   2   >