Re: [libvirt] [PATCH v3] qemu: Pass file descriptor when using TPM passthrough

2015-01-30 Thread Eric Blake
On 11/20/2014 08:08 AM, Stefan Berger wrote: Wow, I've been horribly slow at reviewing this. Do feel free to ping on list if no one seems to notice a patch, to widen the chances of anyone taking a glance at it. > Pass the TPM file descriptor to QEMU via command line. > Instead of passing /dev/tp

Re: [libvirt] [PATCH] util: make virNetDev(Get|Set)IFFlags() static

2015-01-30 Thread Eric Blake
On 01/30/2015 10:16 AM, Laine Stump wrote: > e562a61a0739 added these two new helper functions and only used them > within virnetdev.c, but declared them in the .h file. If some > currently unsupported interface flags need to be accessed in the > future, it will make more sense to write the appropr

Re: [libvirt] [PATCH 0/2] schemas: Remove useless definition

2015-01-30 Thread Eric Blake
On 01/29/2015 11:50 PM, Martin Kletzander wrote: > In other words, if you have a group and elements in that group can > interleave, the group can interleave with other options only as a > group (no element it can interleave with can be placed inside that > group) -- that makes sense, until... > If

[libvirt] [PATCH 4/4] parallels: don't forget to unlock domain if unregister fails

2015-01-30 Thread Maxim Nestratov
Signed-off-by: Maxim Nestratov --- src/parallels/parallels_driver.c |7 ++- 1 files changed, 6 insertions(+), 1 deletions(-) diff --git a/src/parallels/parallels_driver.c b/src/parallels/parallels_driver.c index b569160..2f9cb5f 100644 --- a/src/parallels/parallels_driver.c +++ b/src/pa

[libvirt] [PATCH 2/4] parallels: set cpu mode when applying xml configuration

2015-01-30 Thread Maxim Nestratov
From: Mikhail Feoktistov Otherwise exporting existing domain config and defining a new one like this: virsh -c parallels:///system dumpxml instance01 > my.xml virsh -c parallels:///system define my.xml leads to an error because PCS default x64 mode turns to x32. Thus, we need to set correct cpuMo

[libvirt] [PATCH 0/4] parallels: Better bridged network interfaces support and some fixes

2015-01-30 Thread Maxim Nestratov
Maxim Nestratov (3): parallels: Fix connecting to parallels driver parallels: better bridge network interface support parallels: don't forget to unlock domain if unregister fails Mikhail Feoktistov (1): parallels: set cpu mode when applying xml configuration -- libvir-list mailing list li

[libvirt] [PATCH 3/4] parallels: better bridge network interface support

2015-01-30 Thread Maxim Nestratov
In order to support 'bridge' network adapters in parallels driver we need to plug our veth devices into corresponding linux bridges. We are going to do this by reusing our abstraction of Virtual Networks in terms of PCS. On a domain creation, we create a new Virtual Network naming it with the same

[libvirt] [PATCH 1/4] parallels: Fix connecting to parallels driver

2015-01-30 Thread Maxim Nestratov
After 55ea7be7, failures of parallelsLoadNetworks and parallelsStorageOpen started to fail establishing a new connection to parallels driver. Before this patch we simply ignored such errors. This patch restores the ability to connect to parallels driver even if parallelsLoadNetworks fails to get in

[libvirt] [PATCH] storage: Need to clear pool prior to refreshPool during Autostart

2015-01-30 Thread John Ferlan
https://bugzilla.redhat.com/show_bug.cgi?id=1176510 When storageDriverAutostart is called path virStateReload via a 'service libvirtd reload', then because the volume list in the pool wasn't cleared prior to the call, each volume would be listed multiple times (as many times as we reload). I belie

[libvirt] [PATCH v2 2/2] qemu: qemuOpenFileAs - set flag VIR_FILE_OPEN_FORCE_MODE

2015-01-30 Thread John Ferlan
In the event we're falling into the code that tries to create the file in a forked environment (VIR_FILE_OPEN_FORK) we pass different mode bits, but those are never set because the virFileOpenForceOwnerMode has a check if the OPEN_FORCE_MODE bit is set before attempting to change the mode. Since t

[libvirt] [PATCH v2 0/2] Followup for NFS root squashed domain save issue

2015-01-30 Thread John Ferlan
v1 here: http://www.redhat.com/archives/libvir-list/2015-January/msg01029.html Patch 1 of 2 replaces patch 4 from the original series Patch 2 of 2 is the same from the original series John Ferlan (2): virfile: Adjust error path for virFileOpenForked qemu: qemuOpenFileAs - set flag VIR_FILE_OP

[libvirt] [PATCH v2 1/2] virfile: Adjust error path for virFileOpenForked

2015-01-30 Thread John Ferlan
Rather than have a dummy waitpid loop and return of the failure status from recvfd, adjust the logic to save the recvfd error & fd and then in priority order: - if waitpid failed, use that errno value - waitpid succeeded, but if the child exited abnormally, report failure (use EACCES to report as

[libvirt] [PATCH] util: make virNetDev(Get|Set)IFFlags() static

2015-01-30 Thread Laine Stump
e562a61a0739 added these two new helper functions and only used them within virnetdev.c, but declared them in the .h file. If some currently unsupported interface flags need to be accessed in the future, it will make more sense to write the appropriate higher level function rather than require us t

Re: [libvirt] [PATCH] Add ability to set rlimits at container boot

2015-01-30 Thread Ryan Cleere
I guess I don't really have an argument for or against removing some of them from . The original patch that I wrote and we use internally only allowed setting of RLIMIT_NOFILE, but when I went to publish it back to this list is was trivial to just make it a generic interface to all of the RLIMIT_*

Re: [libvirt] [PATCH] Add ability to set rlimits at container boot

2015-01-30 Thread Daniel P. Berrange
On Fri, Jan 30, 2015 at 08:53:20AM -0600, Ryan Cleere wrote: > --- > docs/formatdomain.html.in | 49 +++ > docs/schemas/domaincommon.rng | 89 + > src/conf/domain_conf.c| 92 > +++ > sr

[libvirt] [PATCH] Add ability to set rlimits at container boot

2015-01-30 Thread Ryan Cleere
--- docs/formatdomain.html.in | 49 +++ docs/schemas/domaincommon.rng | 89 + src/conf/domain_conf.c| 92 +++ src/conf/domain_conf.h| 33 src/libvirt_private.sym

Re: [libvirt] [PATCHv2 08/13] qemu: Extract code to setup memory backing objects

2015-01-30 Thread Ján Tomko
On Fri, Jan 30, 2015 at 11:34:31AM +0100, Peter Krempa wrote: > Extract the memory backend device code into a separate function so that > it can be later easily refactored and reused. > > Few small changes for future reusability, namely: > - new (currently unused) parameter for user specified page

Re: [libvirt] [PATCHv2 00/13] memory hotplug: Preliminary fixes and cleanups

2015-01-30 Thread Ján Tomko
On Fri, Jan 30, 2015 at 11:34:23AM +0100, Peter Krempa wrote: > This series was split out from my memory hotplug series that is not quite > ready > yet. The aim of this series is to refactor the code that creates commandline > for the memory-backend-* qemu object so that it can be later reused for

Re: [libvirt] [PATCH] xend: Don't crash in virDomainXMLDevID

2015-01-30 Thread Michal Privoznik
On 30.01.2015 11:12, Ján Tomko wrote: > On Fri, Jan 30, 2015 at 10:53:09AM +0100, Michal Privoznik wrote: >> The function is called from all {Attach,Update,Detach}Device APIs to >> create config strings that are later passed to the xend to perform the >> desired action. The function is intended to

[libvirt] [RFC PATCH 05/12] conf: Add interface to parse and format memory device information

2015-01-30 Thread Peter Krempa
WIP: TODO: docs Also forbid the new device in post parse callback in all driver that implement the callback to warn users right away that the device is not supported with their hypervisor. --- docs/schemas/domaincommon.rng | 50 src/bhyve/bhyve_domain.c

[libvirt] [RFC PATCH 03/12] qemu: Implement setup of memory hotplug parameters

2015-01-30 Thread Peter Krempa
To enable memory hotplug the maximum memory size and slot count need to be specified. As qemu supports now other units than mebibytes when specifying memory, use the new interface in this case. --- docs/formatdomain.html.in | 2 +- src/qemu/qemu_command.c

[libvirt] [RFC PATCH 02/12] conf: Add support for parsing and formatting max memory and slot count

2015-01-30 Thread Peter Krempa
Add a XML element that will allow to specify maximum supportable memory and the count of memory slots to use with memory hotplug. To avoid possible confusion and misuse of the new element this patch also explicitly forbids the use of the maxMemory setting in individual drivers's post parse callbac

[libvirt] [RFC PATCH 04/12] conf: Add device address type for dimm devices

2015-01-30 Thread Peter Krempa
ACPI Dimm devices are described by the slot and base address. Add a new address type to be able to describe such address. --- docs/schemas/domaincommon.rng | 18 +++ src/conf/domain_conf.c| 69 ++- src/conf/domain_conf.h| 9 ++ 3

[libvirt] [RFC PATCH 12/12] qemu: Implement memory device hotunplug

2015-01-30 Thread Peter Krempa
Add code to hot-remove memory devices from qemu. Unfortunately QEMU doesn't support this right now, so this is just for completenes. --- src/qemu/qemu_driver.c | 4 ++- src/qemu/qemu_hotplug.c | 91 - src/qemu/qemu_hotplug.h | 3 ++ 3 files change

[libvirt] [RFC PATCH 09/12] conf: Introduce helper to find duplicate device address

2015-01-30 Thread Peter Krempa
When adding devices to the definition it's useful to check whether the devices don't reside on a conflicting address. This patch adds a helper that iterates all device info and comapres the addresses with the given info. --- src/conf/domain_conf.c | 104

[libvirt] [RFC PATCH 10/12] qemu: conf: Add support for memory device cold(un)plug

2015-01-30 Thread Peter Krempa
Add a few helpers that allow to operate with memory device definitions on the domain config and use them to implement memory device coldplug in the qemu driver. --- src/conf/domain_conf.c | 101 +++ src/conf/domain_conf.h | 10 + src/libvirt_pri

[libvirt] [RFC PATCH 06/12] qemu: memdev: Add infrastructure to load memory device information

2015-01-30 Thread Peter Krempa
When using 'acpi-dimm' memory devices with qemu, some of the information like the slot number and base address need to be reloaded from qemu after process start so that it reflects the actual state. The state then allows to use memory devices across migrations. --- src/qemu/qemu_domain.c |

[libvirt] [RFC PATCH 07/12] qemu: migration: Forbid migration with memory modules lacking info

2015-01-30 Thread Peter Krempa
Make sure that libvirt has all vital information needed to reliably represent configuration of guest's memory devices in case of a migration. This patch forbids migration in case the required slot number and module base address are not present (failed to be loaded from qemu via monitor). --- src/

[libvirt] [RFC PATCH 08/12] qemu: add support for memory devices

2015-01-30 Thread Peter Krempa
Add support to start qemu instance with 'pc-dimm' device. Thanks to the refactors we are able to reuse the existing function to determine the parameters. --- src/qemu/qemu_command.c | 114 src/qemu/qemu_domain.c | 18 ++-- src/qemu/qemu_domain

[libvirt] [RFC PATCH 11/12] qemu: Implement memory device hotplug

2015-01-30 Thread Peter Krempa
Add code to hot-add memory devices to running qemu instances. --- src/qemu/qemu_command.c | 4 +-- src/qemu/qemu_command.h | 15 + src/qemu/qemu_driver.c | 5 ++- src/qemu/qemu_hotplug.c | 86 + src/qemu/qemu_hotplug.h | 3 ++ 5 files cha

[libvirt] [RFC PATCH 00/12] Add support for memory hotplug

2015-01-30 Thread Peter Krempa
!! this series applies on top of the cleanup series posted earlier !! Hi, this is my try to implement memory hotplug in libvirt (for the qemu) driver. This series is almost code-complete but is lacking tests and docs as I wanted to agree on design first before attempting to write the documentation

[libvirt] [RFC PATCH 01/12] qemu: caps: Add capability bit for the "pc-dimm" device

2015-01-30 Thread Peter Krempa
The pc-dimm device represents a RAM memory module. --- src/qemu/qemu_capabilities.c | 2 ++ src/qemu/qemu_capabilities.h | 1 + tests/qemucapabilitiesdata/caps_2.1.1-1.caps | 1 + 3 files changed, 4 insertions(+) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu

Re: [libvirt] [PATCH v3 2/2] qemu: change macvtap device options in response to NIC_RX_FILTER_CHANGED

2015-01-30 Thread Michal Privoznik
On 22.01.2015 20:47, akrow...@linux.vnet.ibm.com wrote: > From: Tony Krowiak > > This patch enables synchronization of the host macvtap > device options with the guest device's in response to the > NIC_RX_FILTER_CHANGED event. > > The following device options will be synchronized: > * PROMISC >

Re: [libvirt] [PATCH v3 1/2] util: Functions for getting/setting device options

2015-01-30 Thread Michal Privoznik
On 22.01.2015 20:47, akrow...@linux.vnet.ibm.com wrote: > From: Tony Krowiak > > This patch provides the utility functions needed to synchronize > the rxfilter changes made to a guest domain with the corresponding > macvtap devices on the host: > > * Get/set PROMISC flag > * Get/set ALLMULTI, MU

Re: [libvirt] [PATCH v3 0/2] Sync macvtap device modes when guest rxfilter changes

2015-01-30 Thread Michal Privoznik
On 22.01.2015 20:47, akrow...@linux.vnet.ibm.com wrote: > From: Tony Krowiak > > This patch set provides the code to synchonize some macvtap device > modes when the values are changed on the guest's network device. The > following modes will by synchronized: > * PROMISC > * MULTICAST > * ALLMU

Re: [libvirt] [PATCH v3] conf: Don't mangle vcpu placement randomly

2015-01-30 Thread Martin Kletzander
On Thu, Jan 29, 2015 at 03:12:51PM +0100, Michal Privoznik wrote: https://bugzilla.redhat.com/show_bug.cgi?id=1170492 In one of our previous commits (dc8b7ce7) we've done a functional change even though it was intended as pure refactor. The problem is, that the following XML: 6 gets

[libvirt] [PATCHv2 04/13] util: bitmap: Add option to allocate bitmap without reporting error

2015-01-30 Thread Peter Krempa
The virBitmapNew() function reports only OOM errors. Split out the internals into a "quiet" function and add a wrapper that reports the error. --- Notes: Version 2: - new in series src/libvirt_private.syms | 1 + src/util/virbitmap.c | 42 +++---

[libvirt] [PATCHv2 09/13] qemu: command: Shuffle around formating of alias for memory backend objs

2015-01-30 Thread Peter Krempa
Move the alias as the second formated argument and tweak the tests so that a future refactor that will change the order doesn't break tests. --- src/qemu/qemu_command.c| 9 - .../qemuxml2argvdata/qemuxml2argv-hugepages-pages.args | 16 .../

[libvirt] [PATCHv2 05/13] util: json: Add functions to convert JSON arrays from/to virBitmaps

2015-01-30 Thread Peter Krempa
To be able to easily represent nodesets and other data stored in virBitmaps in libvirt, this patch introduces a set of helpers that allow to convert the bitmap to and from JSON value objects. --- Notes: Version 2: - consistently don't report any errors, as this function is being used in p

[libvirt] [PATCHv2 11/13] qemu: command: Switch to bytes when formatting size for memory backends

2015-01-30 Thread Peter Krempa
QEMU's command line visitor as well as the JSON interface take bytes by default for memory object sizes. Convert mebibytes to bytes so that we can later refactor the existing code for hotplug purposes. --- src/qemu/qemu_command.c| 2 +- tests/qemuxml2argvdata/q

[libvirt] [PATCHv2 10/13] qemu: command: Unify values for boolean values when formating memory backends

2015-01-30 Thread Peter Krempa
QEMU's qapi visitor code allows yes/on/y for true and no/off/n for false value of boolean properities. Unify the used style so that we can generate it later and fix test cases. --- src/qemu/qemu_command.c | 4 ++-- tests/qemuxml2argvdata/qemuxml2argv-hugepages-sha

[libvirt] [PATCHv2 06/13] util: json: add helper to iterate JSON object key=value pairs

2015-01-30 Thread Peter Krempa
This helper eases iterating all key=value pairs stored in a JSON object. Usually we pick only certain known keys from a JSON object, but this will allow to walk complete objects and have the callback act on those. --- Notes: Version 2:- - fixed typo in commit message - ACKed by Eric

[libvirt] [PATCHv2 07/13] qemu: command: Add helper to format -object strings from JSON representation

2015-01-30 Thread Peter Krempa
Unlike -device, qemu uses a JSON object to add backend "objects" via the monitor rather than the string that would be passed on the commandline. To be able to reuse code parts that configure backends for various devices, this patch adds a helper that will allow generating the command line represen

[libvirt] [PATCHv2 01/13] conf: numatune: Extract code for requesting memory nodeset from formatting

2015-01-30 Thread Peter Krempa
Extract the logic to determine which nodeset has to be used for a domain from the formatting step so that it can be reused separately when the nodeset is used in a different way. --- src/conf/numatune_conf.c | 33 ++--- src/conf/numatune_conf.h | 5 + src/libvirt_p

[libvirt] [PATCHv2 03/13] util: json: make value object creator universal by supporting adding

2015-01-30 Thread Peter Krempa
To allow constructing of value objects stepwise explode the helper into separate steps and allow appending into existing value objects. --- Notes: Version 2: - Fix freeing of the created JSON object on error -> use JSON freeing func src/libvirt_private.syms | 2 ++ src/util/virjson.c

[libvirt] [PATCHv2 12/13] qemu: command: Refactor NUMA backend object formatting to use JSON objs

2015-01-30 Thread Peter Krempa
With the new JSON to argv formatter we are now able to represent the memory backend definitions in the JSON object format that is reusable for monitor use (hotplug) and then convert it into the shell string. This will avoid having two separate instances of the same code that would create the differ

[libvirt] [PATCHv2 13/13] qemu: command: Don't combine old and modern NUMA node creation

2015-01-30 Thread Peter Krempa
Change done by commit f309db1f4d51009bad0d32e12efc75530b66836b wrongly assumes that qemu can start with a combination of NUMA nodes specified with the "memdev" option and the appropriate backends, and the legacy way by specifying only "mem" as a size argument. QEMU rejects such commandline though:

[libvirt] [PATCHv2 02/13] test: utils: Add helpers for automatic numbering of test cases

2015-01-30 Thread Peter Krempa
Adding or reordering test cases is usually a pain due to static test case names that are then passed to virtTestRun(). To ease the numbering of test cases, this patch adds two simple helpers that generate the test names according to the order they are run. The test name can be configured via the re

[libvirt] [PATCHv2 00/13] memory hotplug: Preliminary fixes and cleanups

2015-01-30 Thread Peter Krempa
This series was split out from my memory hotplug series that is not quite ready yet. The aim of this series is to refactor the code that creates commandline for the memory-backend-* qemu object so that it can be later reused for hotplug via monitor. Additionally this series also fixes a bug in NUMA

[libvirt] [PATCHv2 08/13] qemu: Extract code to setup memory backing objects

2015-01-30 Thread Peter Krempa
Extract the memory backend device code into a separate function so that it can be later easily refactored and reused. Few small changes for future reusability, namely: - new (currently unused) parameter for user specified page size - size of the memory is specified in kibibytes, divided up in the

Re: [libvirt] [PATCH] xend: Don't crash in virDomainXMLDevID

2015-01-30 Thread Ján Tomko
On Fri, Jan 30, 2015 at 10:53:09AM +0100, Michal Privoznik wrote: > The function is called from all {Attach,Update,Detach}Device APIs to > create config strings that are later passed to the xend to perform the > desired action. The function is intended to handle all supported > devices. However, as

Re: [libvirt] Bug fixing of libvirt -- attach-interface using xen driver

2015-01-30 Thread Michal Privoznik
On 30.01.2015 10:20, linxxnil wrote: > Dear: > > I think there was a bug, when attach-interface using xen driver. You're right. I've proposed a patch: https://www.redhat.com/archives/libvir-list/2015-January/msg01088.html Michal -- libvir-list mailing list libvir-list@redhat.com https://www.

[libvirt] [PATCH] xend: Don't crash in virDomainXMLDevID

2015-01-30 Thread Michal Privoznik
The function is called from all {Attach,Update,Detach}Device APIs to create config strings that are later passed to the xend to perform the desired action. The function is intended to handle all supported devices. However, as of 5b05358abacb1029fa0d61f72decacf0d4fd8ffb we are trying to get disk dri

[libvirt] Bug fixing of libvirt -- attach-interface using xen driver

2015-01-30 Thread linxxnil
Dear: I think there was a bug, when attach-interface using xen driver. when I use xen driver to attach interface for domain, the libvirtd will crash. the info with GDB: #0 0x77571815 in virDomainDiskGetDriver () from /usr/lib/libvirt.so.0 #1 0x7fffeb9ad471 in ?? () from /usr/lib/

Re: [libvirt] [PATCH] Add ability to set rlimits at container boot

2015-01-30 Thread Michal Privoznik
On 30.01.2015 01:02, Ryan Cleere wrote: > --- > docs/formatdomain.html.in | 49 > +++ > docs/schemas/domaincommon.rng | 89 > + > src/conf/domain_conf.c| 92 > +

Re: [libvirt] [PATCH 02/12] test: utils: Add helpers for automatic numbering of test cases

2015-01-30 Thread Peter Krempa
On Thu, Jan 29, 2015 at 14:23:52 -0500, John Ferlan wrote: > > I don't see this being used anywhere in this set of patches... I assume > you have some other upcoming patch series that will use it... > > NITs > > On 01/28/2015 05:30 AM, Peter Krempa wrote: > > Adding or reordering test cases is