[libvirt] [PATCH] apparmor: add ptrace/mediation rules for unconfined guests

2017-12-14 Thread Christian Ehrhardt
If a guest runs unconfined , but libvirtd is confined then the peer for signal/ptrace can only be detected as 'unconfined'. That triggers issues like: apparmor="DENIED" operation="signal" profile="/usr/sbin/libvirtd" pid=22395 comm="libvirtd" requested_mask="send" denied_mask="send" signal

Re: [libvirt] [PATCH] add support of iSER transport type in qemu with libiscsi

2017-12-14 Thread Charles Kelimod
Thank you for your patience, I regret for my first time submit here that brings so may mistakes. I have done almost changes that you have mentioned. Now I have a question: I created drive-file-network-args.xml in test, and there is: -drive file=iser://example.org:6000/iqn.1992-01.com.example/1,for

Re: [libvirt] [PATCH 1/3] qemu: Need to assign PCI address to vhost-scsi

2017-12-14 Thread Laine Stump
On 12/12/2017 09:22 AM, John Ferlan wrote: > Commit id '70249927b' neglected to cover this case because the test > had taken the "shortcut" to already add the , so I altered > that too just to make sure it doesn't happen again. > > Previously the qemuxml2xmloutdata was a softlink to the source > qe

[libvirt] [PATCH] storage: Add unique UUID check for virStoragePoolObjAssignDef

2017-12-14 Thread John Ferlan
Commit id '4b2e0ed6e' converted to using hash tables for storing storage pool objs by name and uuid; however, neglected to add a check to virStoragePoolObjAssignDef that the pool by uuid wasn't defined. This caused issues for the virt-manager test driver which ended up using the same UUID for a new

Re: [libvirt] [PATCH] libxl: mark domain0 as persistent

2017-12-14 Thread Jim Fehlig
On 12/14/2017 12:15 AM, Michal Privoznik wrote: On 12/13/2017 10:41 PM, Jim Fehlig wrote: A Xen domain0 is better described as a persistent domain. Mark it as such during intialization. Signed-off-by: Jim Fehlig --- I noticed this while debugging a libvirt-guests issue. The list_guests() func

[libvirt] [PATCH 1/2] qemu: Invert condition nesting in qemuDomainDefValidate()

2017-12-14 Thread Andrea Bolognani
While at the moment we're only performing a single check that is connected to vCPU hotplugging, we're going to introduce a second one soon. Move the topology check underneath the capability check to make that easier; as a bonus, doing so allows us to reduce the scope of the 'topologycpus' variable.

[libvirt] [PATCH 0/2] qemu: Enforce vCPU hotplug granularity constraints

2017-12-14 Thread Andrea Bolognani
return -ENOBLURB; Andrea Bolognani (2): qemu: Invert condition nesting in qemuDomainDefValidate() qemu: Enforce vCPU hotplug granularity constraints src/qemu/qemu_domain.c | 56 +++--- tests/qemuxml2argvdata/cpu-hotplug-granularity.xml | 18 +

[libvirt] [PATCH 2/2] qemu: Enforce vCPU hotplug granularity constraints

2017-12-14 Thread Andrea Bolognani
QEMU 2.7 and newer don't allow guests to start unless the initial vCPUs count is a multiple of the vCPU hotplug granularity, so validate it and report an error if needed. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1283700 Signed-off-by: Andrea Bolognani --- src/qemu/qemu_domain.c

Re: [libvirt] [PATCH] qemu: remove input device after receiving the event

2017-12-14 Thread Erik Skultety
On Thu, Dec 14, 2017 at 10:51:27AM +0100, Ján Tomko wrote: > Also call qemuDomainRemoveInputDevice if we receive the > event after the Detach API ends. > > Commit 67486bb failed to include this. > > https://bugzilla.redhat.com/show_bug.cgi?id=1524837 > --- > src/qemu/qemu_hotplug.c | 5 - > 1

Re: [libvirt] [PATCH 3/3] nodedev: Move the udevPCITranslateInit call

2017-12-14 Thread Erik Skultety
On Thu, Dec 14, 2017 at 08:36:30AM -0500, John Ferlan wrote: > > > On 12/14/2017 08:19 AM, Erik Skultety wrote: > > On Sat, Dec 09, 2017 at 12:29:14PM -0500, John Ferlan wrote: > >> If the timing is "just right", there is a possibility that the > >> udev nodeStateInitialize conflicts with another s

Re: [libvirt] [PATCH v3 4/5] util: Improve CPU frequency parsing

2017-12-14 Thread Bjoern Walk
Andrea Bolognani [2017-12-14, 03:01PM +0100]: > On Thu, 2017-12-14 at 14:55 +0100, Bjoern Walk wrote: > > > + * Returns: 0 when the string has been parsed successfully and the CPU > > > + * frequency has been stored in @mhz, >0 when the string has not > > > > Maybe, >0 when the line pref

Re: [libvirt] [PATCH v3 4/5] util: Improve CPU frequency parsing

2017-12-14 Thread Andrea Bolognani
On Thu, 2017-12-14 at 14:55 +0100, Bjoern Walk wrote: > > + * Returns: 0 when the string has been parsed successfully and the CPU > > + * frequency has been stored in @mhz, >0 when the string has not > > Maybe, >0 when the line prefix does not match exactly? Documentation goes out of syn

Re: [libvirt] [PATCH 0/4] libvirtd: fix hang on termination in qemu driver

2017-12-14 Thread Nikolay Shirokovskiy
On 13.11.2017 18:46, John Ferlan wrote: > > > On 10/25/2017 05:05 AM, Nikolay Shirokovskiy wrote: >> Libvirtd termination can hang. For example if some API call in qemu >> driver awaiting monitor response it will never finish because event >> loop does not functional during termination. As a resu

Re: [libvirt] [PATCH v3 4/5] util: Improve CPU frequency parsing

2017-12-14 Thread Bjoern Walk
Andrea Bolognani [2017-12-14, 01:34PM +0100]: > Make the parser both more strict, by not ignoring errors reported > by virStrToLong_ui(), and more permissive, by not failing due to > unrelated fields which just happen to have a know prefix and > accepting any amount of whitespace before the numeri

Re: [libvirt] [PATCH 3/3] nodedev: Move the udevPCITranslateInit call

2017-12-14 Thread John Ferlan
On 12/14/2017 08:19 AM, Erik Skultety wrote: > On Sat, Dec 09, 2017 at 12:29:14PM -0500, John Ferlan wrote: >> If the timing is "just right", there is a possibility that the >> udev nodeStateInitialize conflicts with another systemd thread >> running an lspci command leaving both waiting for "som

Re: [libvirt] [PATCH 1/3] nodedev: Move device enumumeration out of nodeStateInitialize

2017-12-14 Thread Erik Skultety
On Thu, Dec 14, 2017 at 08:25:34AM -0500, John Ferlan wrote: > > > On 12/14/2017 05:42 AM, Erik Skultety wrote: > > On Sat, Dec 09, 2017 at 12:29:12PM -0500, John Ferlan wrote: > >> Let's move the udevEnumerateDevices into a thread to "speed > >> up" the initialization process. If the enumeration f

Re: [libvirt] [PATCH 1/3] nodedev: Move device enumumeration out of nodeStateInitialize

2017-12-14 Thread John Ferlan
On 12/14/2017 05:42 AM, Erik Skultety wrote: > On Sat, Dec 09, 2017 at 12:29:12PM -0500, John Ferlan wrote: >> Let's move the udevEnumerateDevices into a thread to "speed >> up" the initialization process. If the enumeration fails we >> can set the Quit flag to ensure that udevEventHandleCallback

Re: [libvirt] [PATCH 3/3] nodedev: Move the udevPCITranslateInit call

2017-12-14 Thread Erik Skultety
On Sat, Dec 09, 2017 at 12:29:14PM -0500, John Ferlan wrote: > If the timing is "just right", there is a possibility that the > udev nodeStateInitialize conflicts with another systemd thread > running an lspci command leaving both waiting for "something", > but resulting in a hung libvirtd (and hun

Re: [libvirt] [PATCH v5 3/3] libvirtd: fix crash on termination

2017-12-14 Thread Nikolay Shirokovskiy
On 14.12.2017 16:09, John Ferlan wrote: > > > On 12/14/2017 07:43 AM, Nikolay Shirokovskiy wrote: >> On 14.12.2017 15:31, John Ferlan wrote: >>> >>> >>> On 12/14/2017 06:58 AM, Nikolay Shirokovskiy wrote: Hi, all. I looked over thread for this particular patch again and found res

Re: [libvirt] [PATCH v5 3/3] libvirtd: fix crash on termination

2017-12-14 Thread John Ferlan
On 12/14/2017 07:43 AM, Nikolay Shirokovskiy wrote: > On 14.12.2017 15:31, John Ferlan wrote: >> >> >> On 12/14/2017 06:58 AM, Nikolay Shirokovskiy wrote: >>> Hi, all. >>> >>> I looked over thread for this particular patch again and found resolution >>> is we: >>> >>> 1. make a more sane cleanup

Re: [libvirt] [PATCH v3 3/5] util: Print architecture name in /proc/cpuinfo parser

2017-12-14 Thread Bjoern Walk
Andrea Bolognani [2017-12-14, 01:33PM +0100]: > Instead of a generic "your architecture", print the actual > architecture name. > > Signed-off-by: Andrea Bolognani > --- > src/Makefile.am | 1 + > src/util/virhostcpu.c | 3 ++- > 2 files changed, 3 insertions(+), 1 deletion(-) > > diff -

Re: [libvirt] [PATCH v5 3/3] libvirtd: fix crash on termination

2017-12-14 Thread Nikolay Shirokovskiy
On 14.12.2017 15:31, John Ferlan wrote: > > > On 12/14/2017 06:58 AM, Nikolay Shirokovskiy wrote: >> Hi, all. >> >> I looked over thread for this particular patch again and found resolution is >> we: >> >> 1. make a more sane cleanup order in libvirtd's main function (already done >> by [1]). >

[libvirt] [PATCH v3 3/5] util: Print architecture name in /proc/cpuinfo parser

2017-12-14 Thread Andrea Bolognani
Instead of a generic "your architecture", print the actual architecture name. Signed-off-by: Andrea Bolognani --- src/Makefile.am | 1 + src/util/virhostcpu.c | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Makefile.am b/src/Makefile.am index 4c022d1e4..166c9a8e9

[libvirt] [PATCH v3 5/5] util: Don't report CPU frequency for ARM hosts

2017-12-14 Thread Andrea Bolognani
Some ARM platforms, such as the original Raspberry Pi, report the CPU frequency in the BogoMIPS field of /proc/cpuinfo, so libvirt parsed that field and returned it through its API. However, not only many more boards don't report any value there, but several - including ARMv8-based server hardware

[libvirt] [PATCH v3 4/5] util: Improve CPU frequency parsing

2017-12-14 Thread Andrea Bolognani
Make the parser both more strict, by not ignoring errors reported by virStrToLong_ui(), and more permissive, by not failing due to unrelated fields which just happen to have a know prefix and accepting any amount of whitespace before the numeric value. Signed-off-by: Andrea Bolognani --- src/uti

[libvirt] [PATCH v3 1/5] tests: Add host CPU data for Moonshot (RHEL 7.4)

2017-12-14 Thread Andrea Bolognani
Signed-off-by: Andrea Bolognani --- .../linux-aarch64-rhel74-moonshot.cpuinfo | 72 ++ .../linux-aarch64-rhel74-moonshot.expected | 1 + .../linux-rhel74-moonshot/cpu/cpu0/node0 | 1 + .../linux-rhel74-moonshot/cpu/cpu0/online | 1 + .../

[libvirt] [PATCH v3 2/5] util: virhostcpu: factor out frequency parsing

2017-12-14 Thread Andrea Bolognani
From: Bjoern Walk All different architectures use the same copy-pasted code to parse processor frequency information from /proc/cpuinfo. Let's extract that code into a function to avoid repetition. We now also tolerate if the parsing of /proc/cpuinfo is not successful and just report a warning i

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

2017-12-14 Thread Andrea Bolognani
Changes from [v2]: * improve the parser; * print the architecture name instead of "your architecture". Changes from [v1]: * adopt Bjoern's approach to refactoring. [v2] https://www.redhat.com/archives/libvir-list/2017-December/msg00467.html [v1] https://www.redhat.com/archives/libvir-list/2017-

Re: [libvirt] [PATCH v5 3/3] libvirtd: fix crash on termination

2017-12-14 Thread John Ferlan
On 12/14/2017 06:58 AM, Nikolay Shirokovskiy wrote: > Hi, all. > > I looked over thread for this particular patch again and found resolution is > we: > > 1. make a more sane cleanup order in libvirtd's main function (already done > by [1]). > 2. rewrite linked series [2] by introducing event

Re: [libvirt] [PATCH v5 3/3] libvirtd: fix crash on termination

2017-12-14 Thread Nikolay Shirokovskiy
On 14.12.2017 15:09, Erik Skultety wrote: > On Thu, Dec 14, 2017 at 02:58:30PM +0300, Nikolay Shirokovskiy wrote: >> Hi, all. >> >> I looked over thread for this particular patch again and found resolution is >> we: >> >> 1. make a more sane cleanup order in libvirtd's main function (already don

Re: [libvirt] [PATCH v5 3/3] libvirtd: fix crash on termination

2017-12-14 Thread Erik Skultety
On Thu, Dec 14, 2017 at 02:58:30PM +0300, Nikolay Shirokovskiy wrote: > Hi, all. > > I looked over thread for this particular patch again and found resolution is > we: > > 1. make a more sane cleanup order in libvirtd's main function (already done > by [1]). > 2. rewrite linked series [2] by intr

Re: [libvirt] [PATCH v5 3/3] libvirtd: fix crash on termination

2017-12-14 Thread Nikolay Shirokovskiy
Hi, all. I looked over thread for this particular patch again and found resolution is we: 1. make a more sane cleanup order in libvirtd's main function (already done by [1]). 2. rewrite linked series [2] by introducing event loop closing callback (ok) But there is no resolution on this patch it

Re: [libvirt] [PATCH 0/3] Fix --keep-relative for block commit after libvirtd restart (blockdev-add saga)

2017-12-14 Thread Michal Privoznik
On 12/14/2017 10:30 AM, Peter Krempa wrote: > Relative paths were restored from the disks on libvirtd restart. Now > that we load the backing chain from XML we'll need to store them > somewhere. > > Peter Krempa (3): > conf: Add infrastructure for disk source private data XML > util: storage:

Re: [libvirt] [PATCH 0/9] Yet another version of CAT stuff (no idea about the version number)

2017-12-14 Thread Eli
I will try to more cases.. Sorry, I forget to limit line word as 80. Missing one issue I see: If the host enabled CDP, which is to see the host will report l3 cache type code and data. when user don't want code/data cache ways allocated separated, for current implement, it will report not s

Re: [libvirt] [PATCH 0/9] Yet another version of CAT stuff (no idea about the version number)

2017-12-14 Thread Eli
@Eli: Can you help with the testing? It seems the interface is only implement the isolated case, I remember that you have proposed that for some overlap case? I have not see the whole patch set yet, but I have some quick testing on you patch, will try to find more time to review patc

Re: [libvirt] [PATCH] add support of iSER transport type in qemu with libiscsi

2017-12-14 Thread Peter Krempa
On Thu, Dec 14, 2017 at 18:14:36 +0800, lichs...@gmail.com wrote: > From: zhangshengyu As pointed out last time, please follow the contributor guidelines. You did not run make syntax-check. Also the contributor guidelines state that you should write a commit message. I asked last time for that to

[libvirt] [PATCH] qemu: hotplug: unify "not found" logs when detaching device

2017-12-14 Thread Chen Hanxiao
From: Chen Hanxiao Some services, such as Nova, check whether device was not found by errror messages "not found". [1] This patch unify logs of qemuDomainDetachDeviceLive, which will be helpful. [1] https://github.com/openstack/nova/blob/master/nova/virt/libvirt/guest.py#L406 Signed-off-by: C

Re: [libvirt] [PATCH 1/3] nodedev: Move device enumumeration out of nodeStateInitialize

2017-12-14 Thread Erik Skultety
On Sat, Dec 09, 2017 at 12:29:12PM -0500, John Ferlan wrote: > Let's move the udevEnumerateDevices into a thread to "speed > up" the initialization process. If the enumeration fails we > can set the Quit flag to ensure that udevEventHandleCallback > will not run. > > Signed-off-by: John Ferlan > -

Re: [libvirt] [PATCH v2 2/4] util: virhostcpu: factor out frequency parsing

2017-12-14 Thread Andrea Bolognani
On Thu, 2017-12-14 at 11:07 +0100, Pino Toscano wrote: > On Thursday, 14 December 2017 10:46:33 CET Andrea Bolognani wrote: > > On Wed, 2017-12-13 at 17:35 +0100, Pino Toscano wrote: > > > > +while (fgets(line, sizeof(line), cpuinfo) != NULL) { > > > > +if (!STRPREFIX(line, prefix)) > >

[libvirt] [PATCH] add support of iSER transport type in qemu with libiscsi

2017-12-14 Thread lichstor
From: zhangshengyu --- src/conf/domain_conf.c | 13 src/qemu/qemu_block.c | 17 +- src/util/virstoragefile.c | 3 +- src/util/virstoragefile.h | 1 + tests/qemuxml2argvda

Re: [libvirt] [PATCH v2 2/4] util: virhostcpu: factor out frequency parsing

2017-12-14 Thread Pino Toscano
On Thursday, 14 December 2017 10:46:33 CET Andrea Bolognani wrote: > On Wed, 2017-12-13 at 17:35 +0100, Pino Toscano wrote: > > > +while (fgets(line, sizeof(line), cpuinfo) != NULL) { > > > +if (!STRPREFIX(line, prefix)) > > > +continue; > > > > IMHO here it would be a good

[libvirt] [PATCH] qemu: remove input device after receiving the event

2017-12-14 Thread Ján Tomko
Also call qemuDomainRemoveInputDevice if we receive the event after the Detach API ends. Commit 67486bb failed to include this. https://bugzilla.redhat.com/show_bug.cgi?id=1524837 --- src/qemu/qemu_hotplug.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_ho

Re: [libvirt] [PATCH v2 2/4] util: virhostcpu: factor out frequency parsing

2017-12-14 Thread Andrea Bolognani
On Wed, 2017-12-13 at 17:35 +0100, Pino Toscano wrote: > > +if (!prefix) { > > +VIR_WARN("Parser for /proc/cpuinfo needs to be adapted for your > > architecture"); > > +return 1; > > I'd print the architecture in the warning, so sysadmins can see easily > which architecture it

[libvirt] [PATCH 2/3] util: storage: Add helpers to parse and format relPath into privateData

2017-12-14 Thread Peter Krempa
This will be the first private piece of data that will need to be stored in the XML for some drivers. Add helpers which will do it. --- src/libvirt_private.syms | 2 ++ src/util/virstoragefile.c | 20 src/util/virstoragefile.h | 8 3 files changed, 30 insertions(+)

[libvirt] [PATCH 0/3] Fix --keep-relative for block commit after libvirtd restart (blockdev-add saga)

2017-12-14 Thread Peter Krempa
Relative paths were restored from the disks on libvirtd restart. Now that we load the backing chain from XML we'll need to store them somewhere. Peter Krempa (3): conf: Add infrastructure for disk source private data XML util: storage: Add helpers to parse and format relPath into privateDa

[libvirt] [PATCH 3/3] qemu: domain: Parse and format relPath into disk source private data

2017-12-14 Thread Peter Krempa
Register the helpers directly to format and parse the data. https://bugzilla.redhat.com/show_bug.cgi?id=1523261 --- src/qemu/qemu_domain.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 18c2d2cb8a..74b82450b4 100644 --- a/src/qemu/qemu_

[libvirt] [PATCH 1/3] conf: Add infrastructure for disk source private data XML

2017-12-14 Thread Peter Krempa
VM drivers may need to store additional private data to the status XML so that it can be restored after libvirtd restart. Since not everything is needed add a callback infrastructure, where VM drivers can add only stuff they need. Note that the private data is formatted as a sub-element of the o

Re: [libvirt] [PATCH 0/9] Yet another version of CAT stuff (no idea about the version number)

2017-12-14 Thread Michal Privoznik
On 12/14/2017 08:54 AM, Eli wrote: > > > On 2017年12月14日 10:10, 乔立勇(Eli Qiao) wrote: >> hi Martin, >> >> Thanks for reaching me, sure, I will try to testing your patch. >> >> BTW, do you have a github repo/branch for these  which I can directly >> pull? >> > Sorry, ignore this, I'v pulled your pat

Re: [libvirt] [PATCH 1/1] add support for iSER block type.

2017-12-14 Thread Peter Krempa
On Thu, Dec 14, 2017 at 14:09:30 +0800, Charles Kelimod wrote: > OK, I found qemu supports both: > file.driver=iser,file.portal=xxx.xxx.xxx.xxx:3260,file.target=iqn.xxx,file.lun=0,file.transport=iser,format=raw > file.driver=iscsi,file.portal=xxx.xxx.xxx.xxx:3260,file.target=iqn.xxx,file.lun=0,file