[libvirt] [PATCH] qemu: Prepare BIOS/UEFI when starting a domain

2018-01-02 Thread Michal Privoznik
https://bugzilla.redhat.com/show_bug.cgi?id=1527740 Users might use a block device as UEFI VAR store. Or even have OVMF stored there. Therefore, when starting a domain and separate mount namespace is used, we have to create all the /dev entries that are configured for the domain. Signed-off-by:

[libvirt] [PATCH v2] qemuBuildMemPathStr: Forbid memoryBacking/access for non-numa case

2018-01-02 Thread Michal Privoznik
https://bugzilla.redhat.com/show_bug.cgi?id=1448149 If a domain has no numa nodes, that means we don't put any memory-backend-file onto the qemu command line. That in turn means we can't set access='shared'. Therefore, we should produce an error instead of ignoring the setting silently.

Re: [libvirt] virt-install ERROR Host does not support any virtualization options

2018-01-02 Thread Michal Privoznik
On 01/02/2018 12:57 PM, Mihamina RAKOTOMANDIMBY wrote: > Hello, > > I face this problem and I am willing to provide a patch in order to have > a more informative message. > This, of course with our help. I am not quite certain. > > First of all: What is the problem? > > On a fresh Install

Re: [libvirt] [PATCH v2] maint: Update to latest gnulib

2018-01-02 Thread Michal Privoznik
On 01/02/2018 11:23 PM, Eric Blake wrote: > From: Michal Privoznik > > Unfortunately, since gnulib's commit of 2c5d558745 there's an > unused parameter to stat_time_normalize() function which gnulib > developers don't want to fix yet [1]. Therefore, we have to work > around

[libvirt] [PATCH v2] maint: Update to latest gnulib

2018-01-02 Thread Eric Blake
From: Michal Privoznik Unfortunately, since gnulib's commit of 2c5d558745 there's an unused parameter to stat_time_normalize() function which gnulib developers don't want to fix yet [1]. Therefore, we have to work around it by temporarily providing a downstream patch. 1:

Re: [libvirt] [PATCH] blockjob: Fix error checking of blockjob status

2018-01-02 Thread Eric Blake
On 12/26/2017 07:35 AM, Jie Wang wrote: > when the blockjob return status:"BLOCK_JOB_COMPLETED" with error: > "File descriptor in bad state", "offset" and "len" are equal to zero, > but the blockjob event should be "VIR_DOMAIN_BLOCK_JOB_FAILED" > --- > src/qemu/qemu_monitor_json.c | 2 +- > 1

Re: [libvirt] [PATCH] maint: Update to latest gnulib

2018-01-02 Thread Eric Blake
On 01/02/2018 07:09 AM, John Ferlan wrote: > > > On 01/02/2018 04:28 AM, Michal Privoznik wrote: >> Unfortunately, since gnulib's commit of 2c5d558745 there's an >> unused parameter to stat_time_normalize() function which gnulib >> developers don't want to fix [1]. Therefore, we have to work >>

Re: [libvirt] [PATCH 4/9] util: Remove now-unneeded resctrl functions

2018-01-02 Thread John Ferlan
On 12/13/2017 10:39 AM, Martin Kletzander wrote: > Signed-off-by: Martin Kletzander > --- > src/libvirt_private.syms | 2 - > src/util/virresctrl.c| 132 > --- > src/util/virresctrl.h| 11 > 3 files changed, 145

Re: [libvirt] [PATCH 3/9] conf: Use virResctrlInfo in capabilities

2018-01-02 Thread John Ferlan
On 12/13/2017 10:39 AM, Martin Kletzander wrote: > Signed-off-by: Martin Kletzander > --- > src/conf/capabilities.c | 53 > - > src/conf/capabilities.h | 2 ++ > 2 files changed, 28 insertions(+), 27 deletions(-) >

Re: [libvirt] [PATCH 2/9] util: Add virResctrlInfo

2018-01-02 Thread John Ferlan
On 12/13/2017 10:39 AM, Martin Kletzander wrote: > This will make the current functions obsolete and it will provide more > information to the virresctrl module so that it can be used later. > > Signed-off-by: Martin Kletzander > --- > po/POTFILES.in | 1 + >

Re: [libvirt] [PATCH 1/9] Rename virResctrlInfo to virResctrlInfoPerCache

2018-01-02 Thread John Ferlan
On 12/13/2017 10:39 AM, Martin Kletzander wrote: > Just to ease the review of following patches. > > Signed-off-by: Martin Kletzander > --- > src/conf/capabilities.c | 2 +- > src/conf/capabilities.h | 2 +- > src/util/virresctrl.c | 4 ++-- > src/util/virresctrl.h |

Re: [libvirt] [PATCH] storage: Fixing missing 'backingStore' tag from volume XML dumps.

2018-01-02 Thread Julio Faracco
Hi guys, Any possibility to include a test case for this scenario? 2018-01-02 16:52 GMT-02:00 Julio Faracco : > After commit a693fdb 'vol-dumpxml' missed the ability to show backingStore > information. This commit adds a volume type for files that fixes this > problem. > >

[libvirt] [PATCH] storage: Fixing missing 'backingStore' tag from volume XML dumps.

2018-01-02 Thread Julio Faracco
After commit a693fdb 'vol-dumpxml' missed the ability to show backingStore information. This commit adds a volume type for files that fixes this problem. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1529663 Signed-off-by: Julio Faracco ---

Re: [libvirt] [PATCH 4/5] qemu: implement the new virDomainQemuReconnect method

2018-01-02 Thread John Ferlan
On 12/20/2017 11:47 AM, Daniel P. Berrange wrote: > Signed-off-by: Daniel P. Berrange > --- > src/qemu/qemu_driver.c | 57 > + > src/qemu/qemu_process.c | 31 ++- > src/qemu/qemu_process.h | 1 + >

[libvirt] [PATCH 14/18] vsh: Introduce complete command

2018-01-02 Thread Michal Privoznik
This command is going to be called from bash completion script in the following form: virsh complete -- start --domain Its only purpose is to return list of possible strings for completion. Note that this is a 'hidden', unlisted command and therefore there's no documentation to it.

[libvirt] [PATCH 16/18] virsh: Introduce virshDomainNameCompleter

2018-01-02 Thread Michal Privoznik
Now that we have everything prepared let the fun begin. This completer is very simple and returns domain names. Moreover, depending on the command it can return just a subset of domains (e.g. only running/paused/transient/.. ones). Signed-off-by: Michal Privoznik ---

[libvirt] [PATCH 15/18] tools: Provide bash autompletion file

2018-01-02 Thread Michal Privoznik
The only purpose of this file is to be sourced. After that one can use completion even for their bash: # virsh list -- --all --inactive ... Signed-off-by: Michal Privoznik --- configure.ac | 3 ++ libvirt.spec.in| 3 ++

[libvirt] [PATCH 17/18] virsh: Introduce virshDomainInterfaceCompleter

2018-01-02 Thread Michal Privoznik
For given domain fetch list of defined interfaces. This can be used for commands like domif-getlink and others. If available, the interface name is returned (e.g. "vnet0", usually available only for running domains), if not the MAC address is returned. Moreover, the detach-interface command

[libvirt] [PATCH 18/18] virt-admin: Introduce vshAdmServerCompleter

2018-01-02 Thread Michal Privoznik
Signed-off-by: Michal Privoznik --- tools/Makefile.am| 9 ++ tools/virt-admin-completer.c | 76 tools/virt-admin-completer.h | 33 +++ tools/virt-admin.c | 8 + 4 files changed, 126

[libvirt] [PATCH 05/18] vshReadlineParse: Drop code duplication

2018-01-02 Thread Michal Privoznik
Now that we have a way of retrieving partly parsed command we don't need duplicate code that parses the user's input. Yes, this code removes call of opt's completer, but: a) current implementation is broken anyway, and b) it will be added back shortly Signed-off-by: Michal Privoznik

[libvirt] [PATCH 13/18] vsh: Filter --options

2018-01-02 Thread Michal Privoznik
Similarly to the previous commit, once we've presented an --option for a command to the user it makes no sense to offer it again. Therefore, we can prune all already specified options. For instance, after this patch: virsh # migrate --verbose will no longer offer --verbose option.

[libvirt] [PATCH 09/18] util: Introduce virStringListMerge

2018-01-02 Thread Michal Privoznik
For two string lists merge one into the other one. Signed-off-by: Michal Privoznik --- src/libvirt_private.syms | 1 + src/util/virstring.c | 36 src/util/virstring.h | 3 +++ 3 files changed, 40 insertions(+) diff --git

[libvirt] [PATCH 08/18] vshCommandOpt: Allow caller avoiding assert()

2018-01-02 Thread Michal Privoznik
In the future, completer callbacks will receive partially parsed command (and thus possibly incomplete). However, we still want them to use command options fetching APIs we already have (e.g. vshCommandOpt*()) and at the same time don't report any errors (nor call any asserts). Signed-off-by:

[libvirt] [PATCH 06/18] vshReadlineParse: Escape returned results if needed

2018-01-02 Thread Michal Privoznik
When returning a string that needs escaping there are two scenarios that can happen. Firstly, user already started the string with a quote (or double quote) in which case we don't need to do anything - readline takes care of that. However, if they haven't typed anything yet, we need to escape the

[libvirt] [PATCH 04/18] vshCommandStringParse: Allow retrieving partial result

2018-01-02 Thread Michal Privoznik
In the future, this function is going to be called from vshReadlineParse() to provide parsed input for completer callbacks. The idea is to allow the callbacks to provide more specific data. For instance, for the following input: virsh # domifaddr --domain fedora --interface the --interface

[libvirt] [PATCH 07/18] vshReadlineParse: Use string list

2018-01-02 Thread Michal Privoznik
It's better to fetch list of either commands or options just once and then iterate over it. Moreover, it makes future completers way simpler as they will return string lists too. Signed-off-by: Michal Privoznik --- tools/vsh.c | 121

[libvirt] [PATCH 11/18] vsh: Call vshCmdOptDef completer

2018-01-02 Thread Michal Privoznik
Now that we have everything prepared we can call options' completer again. At the same time, pass partially parsed input to the completer callback - it will help the callbacks to narrow down the list of returned options based on user's input. For instance, if the completer is supposed to return

[libvirt] [PATCH 03/18] vshCommandParse: Don't leak @tkdata

2018-01-02 Thread Michal Privoznik
When parsing cmd line which has "--" on it, this is leaked. Problem is, parser->getNextArg() allocates new string and stores it into tkdata. But as soon as "--" is detected 'continue' is issued without any free of the allocated memory. ==5304== 3 bytes in 1 blocks are definitely lost in loss

[libvirt] [PATCH 12/18] vsh: Prune string list returned by completer

2018-01-02 Thread Michal Privoznik
Instead of having completers prune returned string list based on user's input we can do that right after the callback is called. Only strings matching the prefix will be presented to the user then. Signed-off-by: Michal Privoznik --- tools/vsh.c | 43

[libvirt] [PATCH 10/18] vsh: Fix vshCompleter signature

2018-01-02 Thread Michal Privoznik
The first argument passed to this function is vshControl *. There's no need to use void pointer. Signed-off-by: Michal Privoznik --- tools/vsh.c | 2 +- tools/vsh.h | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/vsh.c b/tools/vsh.c index

[libvirt] [PATCH 02/18] vsh: Drop useless check for cmd != NULL

2018-01-02 Thread Michal Privoznik
All our internal *Free() functions are capable of handling NULL. Signed-off-by: Michal Privoznik --- tools/vsh.c | 12 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/tools/vsh.c b/tools/vsh.c index e38dcec92..a21e1d1de 100644 --- a/tools/vsh.c

[libvirt] [PATCH 00/18] Make bash completion great again

2018-01-02 Thread Michal Privoznik
Technically, this is a v2 of [1], but this implements the feature from different angle and therefore it's a start of new series. What's implemented? === Auto completion for both interactive and non-interactive virsh/virt-admin. Known limitations = Currently,

[libvirt] [PATCH 01/18] vsh: Drop useless check for opts != NULL

2018-01-02 Thread Michal Privoznik
All our internal *Free() functions are capable of handling NULL. Signed-off-by: Michal Privoznik --- tools/vsh.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tools/vsh.c b/tools/vsh.c index e878119b9..e38dcec92 100644 --- a/tools/vsh.c +++

Re: [libvirt] [PATCH v3 0/5] Improvements to CPU frequency reporting

2018-01-02 Thread Andrea Bolognani
A very 2018 ping :) On Thu, 2017-12-14 at 13:33 +0100, Andrea Bolognani wrote: > Changes from [v2]: > > * improve the parser; > * print the architecture name instead of "your architecture". > > Changes from [v1]: > > * adopt Bjoern's approach to refactoring. > > [v2]

[libvirt] [PATCH] docs: Fix serial console configuration examples

2018-01-02 Thread Andrea Bolognani
Signed-off-by: Andrea Bolognani --- Pushed as trivial. docs/formatdomain.html.in | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index 01db83e60..d272cc1ba 100644 ---

Re: [libvirt] [PATCH 3/5] qemu: add a public API to trigger QEMU driver to connect to running guest

2018-01-02 Thread John Ferlan
On 12/20/2017 11:47 AM, Daniel P. Berrange wrote: > Currently the QEMU driver will reconnect to running guests during libvirtd > startup. To support the ability to launch a fully supported guest externally > to the main libvirtd daemon, this adds a QEMU specific public API > >

Re: [libvirt] [PATCH 2/5] conf: expose APIs to let drivers load individual config / status files

2018-01-02 Thread John Ferlan
On 12/20/2017 11:47 AM, Daniel P. Berrange wrote: > Currently drivers can only do a bulk load of config / status files for > their guests. This exposes some helper methods to allow individual > guests to be loaded. > > Signed-off-by: Daniel P. Berrange > --- >

Re: [libvirt] [PATCH 1/5] conf: allow different resource registration modes

2018-01-02 Thread John Ferlan
I know it's a POC type series, but figured I'd take a look primarily at the first 4 patches, learn a bit in the 5th one, and provide some review feedback in order to help move things along... There's perhaps a few adjustments in here that could be made into multiple patches. On 12/20/2017

Re: [libvirt] [PATCH] maint: Update to latest gnulib

2018-01-02 Thread Michal Privoznik
On 01/02/2018 02:09 PM, John Ferlan wrote: > > > On 01/02/2018 04:28 AM, Michal Privoznik wrote: >> Unfortunately, since gnulib's commit of 2c5d558745 there's an >> unused parameter to stat_time_normalize() function which gnulib >> developers don't want to fix [1]. Therefore, we have to work >>

Re: [libvirt] [PATCH] maint: Update to latest gnulib

2018-01-02 Thread John Ferlan
On 01/02/2018 04:28 AM, Michal Privoznik wrote: > Unfortunately, since gnulib's commit of 2c5d558745 there's an > unused parameter to stat_time_normalize() function which gnulib > developers don't want to fix [1]. Therefore, we have to work > around it by temporarily suspending

[libvirt] virt-install ERROR Host does not support any virtualization options

2018-01-02 Thread Mihamina RAKOTOMANDIMBY
Hello, I face this problem and I am willing to provide a patch in order to have a more informative message. This, of course with our help. I am not quite certain. First of all: What is the problem? On a fresh Install (ArchLinux for me), if ever forget to install Qemu and launch

Re: [libvirt] [PATCH] conf: honor maxnames in nodeListDevices API

2018-01-02 Thread Michal Privoznik
On 01/02/2018 10:28 AM, Pavel Hrdina wrote: > Introduced by commit <4ae9dbea99c>. > > Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1528572 > > Signed-off-by: Pavel Hrdina > --- > src/conf/virnodedeviceobj.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git

[libvirt] [PATCH] maint: Update to latest gnulib

2018-01-02 Thread Michal Privoznik
Unfortunately, since gnulib's commit of 2c5d558745 there's an unused parameter to stat_time_normalize() function which gnulib developers don't want to fix [1]. Therefore, we have to work around it by temporarily suspending -Wunused-parameter. 1:

[libvirt] [PATCH] conf: honor maxnames in nodeListDevices API

2018-01-02 Thread Pavel Hrdina
Introduced by commit <4ae9dbea99c>. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1528572 Signed-off-by: Pavel Hrdina --- src/conf/virnodedeviceobj.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/conf/virnodedeviceobj.c b/src/conf/virnodedeviceobj.c

Re: [libvirt] error: operation failed: domain save job: unexpectedly failed

2018-01-02 Thread Michal Privoznik
On 12/27/2017 11:00 PM, Oscar Segarra wrote: > Hi,  > > For any unkown reason the virsh save raises an error in my environment > Centos 7.2: > > [root@vdicnode02 ~]# virsh list >  Id    Name                           State > >  2