Re: [libvirt] [PATCH] util: Fix leak in virStringTrimOptionalNewline

2017-11-22 Thread Michal Privoznik
On 11/22/2017 10:03 PM, Martin Kletzander wrote: > Do not access any data if strlen() == 0. > > Signed-off-by: Martin Kletzander > --- > src/util/virstring.c | 10 +++--- > 1 file changed, 7 insertions(+), 3 deletions(-) > > diff --git a/src/util/virstring.c b/src/util/virstring.c > index e

Re: [libvirt] [PATCH] Adjust backslash alignment syntax-check

2017-11-22 Thread Michal Privoznik
On 11/22/2017 11:17 PM, Martin Kletzander wrote: > We have a check for backslash alignment that checks for two blanks preceding a > backslash. However there can be alignment done using a tabulator and in some > cases one might be enough. There are none currently, but I found out that was > the ca

[libvirt] [PATCH] Adjust backslash alignment syntax-check

2017-11-22 Thread Martin Kletzander
We have a check for backslash alignment that checks for two blanks preceding a backslash. However there can be alignment done using a tabulator and in some cases one might be enough. There are none currently, but I found out that was the case before. at some point. so let's check for \t precedin

[libvirt] [PATCH] util: Fix leak in virStringTrimOptionalNewline

2017-11-22 Thread Martin Kletzander
Do not access any data if strlen() == 0. Signed-off-by: Martin Kletzander --- src/util/virstring.c | 10 +++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/util/virstring.c b/src/util/virstring.c index eac4774b533e..b2ebce27ff49 100644 --- a/src/util/virstring.c +++ b/s

[libvirt] [PATCH v2 3/5] qemu_capabilities: Introcude QEMU_CAPS_NUMA_DIST

2017-11-22 Thread Michal Privoznik
This capability says if qemu is capable of specifying distances between NUMA nodes on the command line. Unfortunately, there's no real way to check this and thus we have to go with version check. QEMU introduced this in 0f203430dd8 (and friend) which was released in 2.10.0. Signed-off-by: Michal P

[libvirt] [PATCH v2 4/5] qemu: Support setting NUMA distances

2017-11-22 Thread Michal Privoznik
Since we already have such support for libxl all we need is qemu driver adjustment. And a test case. Signed-off-by: Michal Privoznik --- docs/formatdomain.html.in | 2 +- src/qemu/qemu_command.c| 39 - .../qemuxml2argv-numatune-di

[libvirt] [PATCH v2 0/5] qemu: Support setting NUMA distances

2017-11-22 Thread Michal Privoznik
diff to v1: - Renamed & simplified function in 2/5 - Other small nits fixed as raised in review Michal Privoznik (5): virDomainNumaGetNodeDistance: Fix input arguments validation numa: Introduce virDomainNumaNodeDistanceIsUsingDefaults qemu_capabilities: Introcude QEMU_CAPS_NUMA_DIST qemu:

[libvirt] [PATCH v2 5/5] news: Document which drivers support NUMA distances

2017-11-22 Thread Michal Privoznik
Signed-off-by: Michal Privoznik Reviewed-by: John Ferlan --- docs/news.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/news.xml b/docs/news.xml index 5eb0b79d6..81b7b68f9 100644 --- a/docs/news.xml +++ b/docs/news.xml @@ -43,7 +43,7 @@ A NUMA hardware arch

[libvirt] [PATCH v2 2/5] numa: Introduce virDomainNumaNodeDistanceIsUsingDefaults

2017-11-22 Thread Michal Privoznik
The function returns true/false depending on distance configuration being present in the domain XML. Signed-off-by: Michal Privoznik --- src/conf/numa_conf.c | 21 + src/conf/numa_conf.h | 4 src/libvirt_private.syms | 1 + 3 files changed, 26 insertions(+) di

Re: [libvirt] [PATCH v2 0/9] qemu: command: Refactor handling of disk drive arguments (blockdev-add saga)

2017-11-22 Thread Ján Tomko
On Wed, Nov 22, 2017 at 11:01:32AM +0100, Peter Krempa wrote: Version 2 only prepares for the move of the arguments to -device which will be used together with -blockdev rather than switching right away. This will prevent breaking old qemu support since individual parameters were moved to -devic

[libvirt] [PATCH v2 1/5] virDomainNumaGetNodeDistance: Fix input arguments validation

2017-11-22 Thread Michal Privoznik
There's no point in checking if numa->mem_nodes[node].ndistances is set if we check for numa->mem_nodes[node].distances. However, it makes sense to check if the sibling node (@cellid) caller passed falls within boundaries. Signed-off-by: Michal Privoznik --- src/conf/numa_conf.c | 4 ++-- 1 file

[libvirt] [jenkins-ci PATCH] guests: install additional debugging tools

2017-11-22 Thread Pavel Hrdina
Signed-off-by: Pavel Hrdina --- guests/vars/mappings.yml | 14 ++ guests/vars/projects/base.yml | 4 2 files changed, 18 insertions(+) diff --git a/guests/vars/mappings.yml b/guests/vars/mappings.yml index eca8dbe..ff97231 100644 --- a/guests/vars/mappings.yml +++ b/guests

Re: [libvirt] [PATCH 1/4] storage: Introduce virStoragePoolObjEndAPI

2017-11-22 Thread Erik Skultety
On Thu, Nov 16, 2017 at 11:58:02AM -0500, John Ferlan wrote: > For now it'll just call the virStoragePoolObjUnlock, but a future > adjustment will do something different. Since the new API will check > for a NULL object before the Unlock call, callers no longer need to > check for NULL before calli

Re: [libvirt] [PATCH] qemu: domain: Don't call namespace setup for storage already accessed by vm

2017-11-22 Thread Michal Privoznik
On 11/22/2017 04:49 PM, Peter Krempa wrote: > When doing block commit we need to allow write for members of the > backing chain so that we can commit the data into them. > > qemuDomainDiskChainElementPrepare was used for this which since commit > 786d8d91b4 calls qemuDomainNamespaceSetupDisk which

[libvirt] [PATCH] qemu: domain: Don't call namespace setup for storage already accessed by vm

2017-11-22 Thread Peter Krempa
When doing block commit we need to allow write for members of the backing chain so that we can commit the data into them. qemuDomainDiskChainElementPrepare was used for this which since commit 786d8d91b4 calls qemuDomainNamespaceSetupDisk which has very adverse side-effects, namely it relabels the

[libvirt] [PATCH v2 23/21] news: Update for serial console fixes

2017-11-22 Thread Andrea Bolognani
Signed-off-by: Andrea Bolognani --- docs/news.xml | 12 1 file changed, 12 insertions(+) diff --git a/docs/news.xml b/docs/news.xml index 5eb0b79d6..abb9b5d0d 100644 --- a/docs/news.xml +++ b/docs/news.xml @@ -135,6 +135,18 @@ can prepare the files if they need to do so.

[libvirt] [PATCH v2 22/21] docs: Improve documentation for serial consoles

2017-11-22 Thread Andrea Bolognani
Our current documentation is missing some information and doesn't do a great job at explaining how the and elements are connected. Let's try to fix that. Signed-off-by: Andrea Bolognani --- docs/formatdomain.html.in | 230 ++ 1 file changed, 172 inse

[libvirt] [PATCH v2 22/21] docs: Improve documentation for serial consoles

2017-11-22 Thread Andrea Bolognani
Our current documentation is missing some information and doesn't do a great job at explaining how the and elements are connected. Let's try to fix that. Signed-off-by: Andrea Bolognani --- docs/formatdomain.html.in | 230 ++ 1 file changed, 172 inse

Re: [libvirt] [PATCH v2 01/21] qemu: Introduce qemuDomainChrDefPostParse()

2017-11-22 Thread Marc Hartmayer
On Tue, Nov 21, 2017 at 05:42 PM +0100, Andrea Bolognani wrote: > Having a separate function for char device handling is better than > adding even more code to qemuDomainDeviceDefPostParse(). > > Signed-off-by: Andrea Bolognani > --- > src/qemu/qemu_domain.c | 57 >

[libvirt] [PATCH 2/3] vierror: Define VIR_ERROR_MAX_LENGTH macro

2017-11-22 Thread Jiri Denemark
And use it instead of a magic 1024 constant. Signed-off-by: Jiri Denemark --- src/util/virerror.c | 6 +++--- src/util/virerror.h | 2 ++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/util/virerror.c b/src/util/virerror.c index 1f15c5dbbe..91022c3b63 100644 --- a/src/util/vi

[libvirt] [PATCH 3/3] qemu: Use the end of QEMU log for reporting errors

2017-11-22 Thread Jiri Denemark
When QEMU dies, we read its output stored in a log file and use it for reporting a hopefully useful error. However, virReportError will trim the message to (VIR_ERROR_MAX_LENGTH - 1) characters, which means the end of the log (which likely contains the error message we want to report) may get lost.

[libvirt] [PATCH 0/3] qemu: Fix error reporting from QEMU log

2017-11-22 Thread Jiri Denemark
Jiri Denemark (3): qemu: Properly skip "char device redirected to" in QEMU log vierror: Define VIR_ERROR_MAX_LENGTH macro qemu: Use the end of QEMU log for reporting errors src/qemu/qemu_process.c | 36 +++- src/util/virerror.c | 6 +++--- src/util/virer

[libvirt] [PATCH 1/3] qemu: Properly skip "char device redirected to" in QEMU log

2017-11-22 Thread Jiri Denemark
When reading QEMU log for reporting it as an error message, we want to skip "char device redirected to" line. However, this string is not printed at the beginning of a line, which means STRPREFIX will never find it. Signed-off-by: Jiri Denemark --- src/qemu/qemu_process.c | 2 +- 1 file changed,

Re: [libvirt] [PATCH 4/5] qemu: Support setting NUMA distances

2017-11-22 Thread John Ferlan
On 11/22/2017 04:45 AM, Michal Privoznik wrote: > On 11/22/2017 01:04 AM, John Ferlan wrote: >> >> >> On 11/14/2017 09:47 AM, Michal Privoznik wrote: >>> Since we already have such support for libxl all we need is qemu >>> driver adjustment. And a test case. >>> >>> Signed-off-by: Michal Privozni

Re: [libvirt] [PATCH] virsh: domifstat: clarify description of --help option

2017-11-22 Thread Erik Skultety
On Sat, Nov 18, 2017 at 03:21:57PM +0800, ZhiPeng Lu wrote: > can be the interface target by > name or MAC address. So clarify description of --help option > > Signed-off-by:ZhiPeng Lu > --- > tools/virsh-domain-monitor.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/t

Re: [libvirt] [PATCH 2/5] numa: Introduce virDomainNumaNodeDistanceSpecified

2017-11-22 Thread John Ferlan
On 11/22/2017 04:45 AM, Michal Privoznik wrote: > On 11/22/2017 12:38 AM, John Ferlan wrote: >> >> >> On 11/14/2017 09:47 AM, Michal Privoznik wrote: >>> The function returns true/false depending on distance >>> configuration being present in the domain XML. >>> >>> Signed-off-by: Michal Privozni

Re: [libvirt] [PATCH 1/5] virDomainNumaGetNodeDistance: Fix input arguments validation

2017-11-22 Thread John Ferlan
On 11/22/2017 04:45 AM, Michal Privoznik wrote: > On 11/22/2017 12:22 AM, John Ferlan wrote: >> >> >> On 11/14/2017 09:47 AM, Michal Privoznik wrote: >>> There's no point in checking if numa->mem_nodes[node].ndistances >>> is set if we check for numa->mem_nodes[node].distances. However, >>> it ma

[libvirt] [PATCH v2 04/11] qemu: domain: Move video device validation into separate function

2017-11-22 Thread Peter Krempa
--- src/qemu/qemu_domain.c | 43 ++- 1 file changed, 26 insertions(+), 17 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 7a369969d8..acda06b913 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -3701,6 +370

[libvirt] [PATCH v2 11/11] qemu: command: Mark disks as such in qemu

2017-11-22 Thread Peter Krempa
Qemu has now an internal mechanism for locking images to fix specific cases of disk corruption. This requires libvirt to mark the image as shared so that qemu lifts certain restrictions. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1378242 --- src/qemu/qemu_command.c

[libvirt] [PATCH v2 00/11] qemu: Fix disks for new qemu

2017-11-22 Thread Peter Krempa
Introduction of the disk image locking in qemu created a regression where disk shared access with would not work. Since the disk locking is a desired feature, allow libvirt to configure qemu in such way that disks are exempt from write locks. First few patches refactor some stuff so that it's l

[libvirt] [PATCH v2 06/11] qemu: block: Add function to check if storage source allows concurrent access

2017-11-22 Thread Peter Krempa
Storage source format backing a shared device (e.g. running a cluster filesystem) needs to support the sharing so that metadata are not corrupted. Add a central function for checking this. --- src/qemu/qemu_block.c | 15 +++ src/qemu/qemu_block.h | 3 +++ 2 files changed, 18 insertion

[libvirt] [PATCH v2 09/11] qemu: Disallow pivot of shared disks to unsupported storage

2017-11-22 Thread Peter Krempa
Pivoting to a unsupported storage type might break the assumption that shared disks will not corrupt metadata. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1511480 --- src/qemu/qemu_driver.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/src/qemu/qemu_driver.c b/src/qemu

[libvirt] [PATCH v2 07/11] qemu: domain: Reject shared disk access if backing format does not support it

2017-11-22 Thread Peter Krempa
Disk sharing between two VMs may corrupt the images if the format driver does not support it. Check tha the user declared use of a supported storage format when they want to share the disk. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1511480 --- src/qemu/qemu_domain.c

[libvirt] [PATCH v2 08/11] qemu: snapshot: Disallow snapshot of unsupported shared disks

2017-11-22 Thread Peter Krempa
Creating a snapshot would introduce a possibly unsupported member for sharing into the backing chain. Add a check to prevent that from happening. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1511480 --- src/qemu/qemu_driver.c | 24 1 file changed, 24 insertions(+

[libvirt] [PATCH v2 10/11] qemu: caps: Add capability for 'share-rw' disk option

2017-11-22 Thread Peter Krempa
'share-rw' for the disk device configures qemu to allow concurrent access to the backing storage. The capability is checked in various supported disk frontend buses since it does not make sense to partially backport it. --- src/qemu/qemu_capabilities.c | 5 + src/q

[libvirt] [PATCH v2 02/11] qemu: domain: Despaghetify qemuDomainDeviceDefValidate

2017-11-22 Thread Peter Krempa
Move network device validation into a separate function. --- src/qemu/qemu_domain.c | 158 ++--- 1 file changed, 84 insertions(+), 74 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index cc7596bad1..3755a23907 100644 --- a/src

[libvirt] [PATCH v2 03/11] qemu: domain: Move hostdev validation into separate function

2017-11-22 Thread Peter Krempa
--- src/qemu/qemu_domain.c | 30 -- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 3755a23907..7a369969d8 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -3684,6 +3684,23 @@ qemuD

[libvirt] [PATCH v2 05/11] qemu: domain: Refactor domain device validation function

2017-11-22 Thread Peter Krempa
Use a style that will discourage from adding inline checks. --- src/qemu/qemu_domain.c | 79 +- 1 file changed, 52 insertions(+), 27 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index acda06b913..29fdb49d14 100644 --- a/

[libvirt] [PATCH v2 01/11] qemu: Move snapshot disk validation functions into one

2017-11-22 Thread Peter Krempa
Move the code so that both the new image and old image can be verified in the same function. --- src/qemu/qemu_driver.c | 91 -- 1 file changed, 36 insertions(+), 55 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 3a0

Re: [libvirt] [PATCH 00/11] qemu: Fix disks for new qemu

2017-11-22 Thread Peter Krempa
On Thu, Nov 16, 2017 at 13:47:53 +0100, Peter Krempa wrote: > Introduction of the disk image locking in qemu created a regression > where disk shared access with would not work. > > Since the disk locking is a desired feature, allow libvirt to configure > qemu in such way that disks are exempt f

[libvirt] [PATCH] build: Fix make dist

2017-11-22 Thread Martin Kletzander
Since we don't pack symlinks we cannot have recursive loops in them. Since we need one directory to be in tests/vircaps2xmldata/linux-caches/, instead of creating a symlink, just move the files in that directory and adjust tests. Signed-off-by: Martin Kletzander --- Pushed under the build-breake

[libvirt] [PATCH v2 9/9] qemu: command: Anotate formatting of the frontend attributes with -drive

2017-11-22 Thread Peter Krempa
Explain that certain attributes formatted with -drive are in fact attributes of the drive itself and not the storage backing it. --- src/qemu/qemu_command.c | 8 1 file changed, 8 insertions(+) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index ca4934b75c..26d395d67c 10

[libvirt] [PATCH v2 4/9] qemu: command: Move disk 'serial' into frontend parameter formatter

2017-11-22 Thread Peter Krempa
Disk serial is not a property of the image but of the disk frontend. Account for this appropriately. --- src/qemu/qemu_command.c | 15 --- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 31df61a944..d286681691 100644

[libvirt] [PATCH v2 3/9] tests: qemuxml2argv: Test SD card with serial number

2017-11-22 Thread Peter Krempa
--- tests/qemuxml2argvdata/qemuxml2argv-disk-serial.args| 1 + tests/qemuxml2argvdata/qemuxml2argv-disk-serial.xml | 5 + tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-serial.xml | 5 + 3 files changed, 11 insertions(+) diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-serial.a

[libvirt] [PATCH v2 7/9] qemu: command: Move disk trhottling argument building into a separate function

2017-11-22 Thread Peter Krempa
Isolate it from the other code. --- src/qemu/qemu_command.c | 75 +++-- 1 file changed, 41 insertions(+), 34 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 36b8f3cb7f..92e3407632 100644 --- a/src/qemu/qemu_command.c ++

[libvirt] [PATCH v2 2/9] tests: qemuxml2xml: Run the 'disk-serial' test

2017-11-22 Thread Peter Krempa
--- .../qemuxml2xmlout-disk-serial.xml | 42 ++ tests/qemuxml2xmltest.c| 2 ++ 2 files changed, 44 insertions(+) create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-serial.xml diff --git a/tests/qemuxml2xmloutdata/qemux

[libvirt] [PATCH v2 5/9] qemu: command: Move around order of generating -drive arguments

2017-11-22 Thread Peter Krempa
Move together sections which are conditionaly executed depending on whether -device will be used together with the -drive. --- src/qemu/qemu_command.c| 28 -- .../qemuxml2argvdata/qemuxml2argv-boot-cdrom.args | 2 +- .../qemuxml2argv-boot-complex-b

[libvirt] [PATCH v2 6/9] qemu: command: Refactor logic when formatting -drive

2017-11-22 Thread Peter Krempa
Move all logic depending on whether we are solely formatting -drive (no -device along with it) into one block. --- src/qemu/qemu_command.c | 23 ++- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index b53faadc1

[libvirt] [PATCH v2 8/9] qemu: command: Move formatting of disk io error policy from -drive

2017-11-22 Thread Peter Krempa
That's a disk frontend attribute. Move the code to a separate function since it's non-trivial and call it from the frontend attribute formatter. --- src/qemu/qemu_command.c| 62 +- ...uxml2argv-disk-drive-error-policy-enospace.args | 2 +- .../qemux

[libvirt] [PATCH v2 1/9] qemu: command: Split out geometry frontend attribute formatting from -drive

2017-11-22 Thread Peter Krempa
Historically we've formatted a lot of the attributes of a disk (disk geometry, etc) with -drive. Since we use -device now, they should be formatted there. Extract them to a separate function for keeping compatibility with SDcards which still use only -drive. Start this by moving the geometry into

[libvirt] [PATCH v2 0/9] qemu: command: Refactor handling of disk drive arguments (blockdev-add saga)

2017-11-22 Thread Peter Krempa
Version 2 only prepares for the move of the arguments to -device which will be used together with -blockdev rather than switching right away. This will prevent breaking old qemu support since individual parameters were moved to -device in separate instances. Peter Krempa (9): qemu: command: Spl

Re: [libvirt] [PATCH 1/5] virDomainNumaGetNodeDistance: Fix input arguments validation

2017-11-22 Thread Michal Privoznik
On 11/22/2017 12:22 AM, John Ferlan wrote: > > > On 11/14/2017 09:47 AM, Michal Privoznik wrote: >> There's no point in checking if numa->mem_nodes[node].ndistances >> is set if we check for numa->mem_nodes[node].distances. However, >> it makes sense to check if the sibling node caller passed fal

Re: [libvirt] [PATCH 2/5] numa: Introduce virDomainNumaNodeDistanceSpecified

2017-11-22 Thread Michal Privoznik
On 11/22/2017 12:38 AM, John Ferlan wrote: > > > On 11/14/2017 09:47 AM, Michal Privoznik wrote: >> The function returns true/false depending on distance >> configuration being present in the domain XML. >> >> Signed-off-by: Michal Privoznik >> --- >> src/conf/numa_conf.c | 13 +

Re: [libvirt] [PATCH 4/5] qemu: Support setting NUMA distances

2017-11-22 Thread Michal Privoznik
On 11/22/2017 01:04 AM, John Ferlan wrote: > > > On 11/14/2017 09:47 AM, Michal Privoznik wrote: >> Since we already have such support for libxl all we need is qemu >> driver adjustment. And a test case. >> >> Signed-off-by: Michal Privoznik >> --- >> src/qemu/qemu_command.c

[libvirt] Set allmulticast automatically on macvtap interfaces

2017-11-22 Thread Marc Haber
Hi, the easiest way to connect a domain to a network is a macvtap interface with the following XML code: This makes everything work but incoming IPv6, which relies on multicast, which is filtered by the macvtap interface by default. I need to