Re: [libvirt] [PATCH 7/8] appmor, libvirt-qemu: Add 9p support

2017-05-18 Thread Stefan Bader
On 18.05.2017 21:40, Serge E. Hallyn wrote: > Quoting Guido Günther (a...@sigxcpu.org): >> On Thu, May 18, 2017 at 11:21:54AM -0500, Serge E. Hallyn wrote: >>> Mind you I'm not crazy about this. If this could be toggled with a >>> default-off config option that would seem better than always giving

Re: [libvirt] libvirt question

2017-05-18 Thread zhun...@gmail.com
Thanks a lot! zhun...@gmail.com From: Martin Kletzander Date: 2017-05-19 14:16 To: zhun...@gmail.com CC: libvir-list Subject: Re: [libvirt] libvirt question On Fri, May 19, 2017 at 10:52:32AM +0800, zhun...@gmail.com wrote: >Hello,I wrote a program using libvirt API to get vm information like

Re: [libvirt] libvirt question

2017-05-18 Thread Martin Kletzander
On Fri, May 19, 2017 at 10:52:32AM +0800, zhun...@gmail.com wrote: Hello,I wrote a program using libvirt API to get vm information like this: /*dom is virDomainPtr type*/ dom=virDomainLookupByID(conn,activeDomains[i]); if(dom!=NULL) printf("%d--%s\n",activeDomains[i],dom->name); .

[libvirt] libvirt question

2017-05-18 Thread zhun...@gmail.com
Hello,I wrote a program using libvirt API to get vm information like this: /*dom is virDomainPtr type*/ dom=virDomainLookupByID(conn,activeDomains[i]); if(dom!=NULL) printf("%d--%s\n",activeDomains[i],dom->name); .. but when compile it,error occured like this: vm_eraser_detect.

Re: [libvirt] [PATCH] datatypes: removing unnecessary return statement.

2017-05-18 Thread John Ferlan
On 05/17/2017 09:53 PM, Julio Faracco wrote: > There is a wrong 'return' statement after a 'goto' statement inside the > function virConnectCloseCallbackDataRegister(). This commit only removes > the 'return'. > > Signed-off-by: Julio Faracco > --- > src/datatypes.c | 1 - > 1 file changed, 1

Re: [libvirt] [PATCH] qemu: allow to control host side link status of network device

2017-05-18 Thread Vasiliy Tolstov
2017-05-17 15:28 GMT+03:00 Peter Krempa : >> >> Well, *I* think I've given sufficient reasons for having the two link >> states controlled separately, but since Dan and Peter had questioned its >> usefulness, we should see whether or not I've swayed their opinions :-) > > I think we should have two

Re: [libvirt] [PATCH 7/8] appmor, libvirt-qemu: Add 9p support

2017-05-18 Thread Serge E. Hallyn
Quoting Guido Günther (a...@sigxcpu.org): > On Thu, May 18, 2017 at 11:21:54AM -0500, Serge E. Hallyn wrote: > > Mind you I'm not crazy about this. If this could be toggled with a > > default-off config option that would seem better than always giving > > these caps to libvirt-qemu. > > virt-aa-h

Re: [libvirt] [PATCH 7/8] appmor, libvirt-qemu: Add 9p support

2017-05-18 Thread Guido Günther
On Thu, May 18, 2017 at 11:21:54AM -0500, Serge E. Hallyn wrote: > Mind you I'm not crazy about this. If this could be toggled with a > default-off config option that would seem better than always giving > these caps to libvirt-qemu. virt-aa-helper could add these if it detects a 9pfs file system

Re: [libvirt] [PATCH 7/8] appmor, libvirt-qemu: Add 9p support

2017-05-18 Thread Serge E. Hallyn
Mind you I'm not crazy about this. If this could be toggled with a default-off config option that would seem better than always giving these caps to libvirt-qemu. Quoting Stefan Bader (stefan.ba...@canonical.com): > From: Serge Hallyn > > Add fowner and fsetid to libvirt-qemu profile. > > Bug-

Re: [libvirt] Various apparmor related changes (part 1), version 2

2017-05-18 Thread Serge E. Hallyn
Quoting Stefan Bader (stefan.ba...@canonical.com): > > Over the years there have been a bunch of changes to the > > apparmor profiles and/or virt-aa-helper which have been > > carried in Debian/Ubuntu but never made it upstream. > > > > In an attempt to clean this up and generally improve the > >

[libvirt] [PATCH 1/3] virfile: Provide stub for virFileInData

2017-05-18 Thread Michal Privoznik
Some older systems (such as RHEL6) lack SEEK_HOLE and SEEK_DATA which virFileInData relies on. Provide a stub for these systems. Signed-off-by: Michal Privoznik --- configure.ac | 5 + src/util/virfile.c | 15 +++ 2 files changed, 20 insertions(+) diff --git a/configure.a

[libvirt] [PATCH 0/3] Couple of build fixes after sparse streams

2017-05-18 Thread Michal Privoznik
Some systems lack the symbols we need or have them in different header files. Michal Privoznik (3): virfile: Provide stub for virFileInData virfiletest: Test virFileInData iff SEEK_HOLE is defined virfiletest: include linux/falloc.h configure.ac| 5 + src/util/virfile.c | 15

[libvirt] [PATCH 3/3] virfiletest: include linux/falloc.h

2017-05-18 Thread Michal Privoznik
On systems with older glibc including fcntl.h for getting FALLOC_FL_PUNCH_HOLE defined is not enough. We must also include linux/falloc.h. Signed-off-by: Michal Privoznik --- tests/virfiletest.c | 4 1 file changed, 4 insertions(+) diff --git a/tests/virfiletest.c b/tests/virfiletest.c ind

[libvirt] [PATCH 2/3] virfiletest: Test virFileInData iff SEEK_HOLE is defined

2017-05-18 Thread Michal Privoznik
Yet another place where we need to wrap code in HAVE_DECL_SEEK_HOLE block. Signed-off-by: Michal Privoznik --- tests/virfiletest.c | 36 +++- 1 file changed, 23 insertions(+), 13 deletions(-) diff --git a/tests/virfiletest.c b/tests/virfiletest.c index a93bee01a.

[libvirt] [PATCH] nodedev: mdev: Fix build caused by symbol shadowing

2017-05-18 Thread Erik Skultety
GCC 4.6 complains about a local declaration shadowing a global symbol. Signed-off-by: Erik Skultety --- Pushed as build breaker. src/node_device/node_device_udev.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/node_device/node_device_udev.c b/src/node_device/n

[libvirt] [PATCH] cpu_ppc64: Add support for host-model on POWER9

2017-05-18 Thread Jiri Denemark
Signed-off-by: Jiri Denemark --- src/cpu/cpu_ppc64.c| 8 .../qemuxml2argv-pseries-cpu-compat-power9.args| 24 ++ .../qemuxml2argv-pseries-cpu-compat-power9.xml | 21 +++ tests/qemuxml2argvtest.c

Re: [libvirt] [PATCH] qemu: monitor: Don't bother extracting vCPU halted state in text monitor

2017-05-18 Thread Peter Krempa
On Thu, May 18, 2017 at 13:53:55 +0200, Ján Tomko wrote: > On Thu, May 18, 2017 at 01:47:03PM +0200, Peter Krempa wrote: > > The code causes the 'offset' variable to be overwritten (possibly with > > NULL if neither of the vCPUs is halted) which causes a crash since the > > variable is still used a

Re: [libvirt] [PATCH 0/2] Couple of sparse streams improvements

2017-05-18 Thread Ján Tomko
On Thu, May 18, 2017 at 08:53:34AM +0200, Michal Privoznik wrote: News entry & one simple fix. Michal Privoznik (2): news: Document sparse streams virStream: Forbid negative seeks docs/news.xml| 10 ++ src/internal.h | 7 +++ src/rpc/virnetclientstream

Re: [libvirt] [PATCH] qemu: monitor: Don't bother extracting vCPU halted state in text monitor

2017-05-18 Thread Ján Tomko
On Thu, May 18, 2017 at 01:47:03PM +0200, Peter Krempa wrote: The code causes the 'offset' variable to be overwritten (possibly with NULL if neither of the vCPUs is halted) which causes a crash since the variable is still used after that part. Additionally there's a bug, since strstr() would loo

[libvirt] [PATCH] qemu: monitor: Don't bother extracting vCPU halted state in text monitor

2017-05-18 Thread Peter Krempa
The code causes the 'offset' variable to be overwritten (possibly with NULL if neither of the vCPUs is halted) which causes a crash since the variable is still used after that part. Additionally there's a bug, since strstr() would look up the '(halted)' string in the whole string rather than just

Re: [libvirt] [PATCH v2 2/2] util: do not leak handles in stop netlink event service

2017-05-18 Thread John Ferlan
On 05/18/2017 12:06 AM, Wang King wrote: > handles stored in virNetlinkEventSrvPrivatePtr should be freed when > stop netlink event service. Altered the commit message to describe which commit introduced and just fit that into the text... > --- > src/util/virnetlink.c | 1 + > 1 file changed,

Re: [libvirt] [RFC] Fixing a regression caused by recent CPU driver changes

2017-05-18 Thread Martin Kletzander
On Thu, May 18, 2017 at 11:14:50AM +0200, Pavel Hrdina wrote: On Thu, May 18, 2017 at 10:22:59AM +0200, Jiri Denemark wrote: Hi all, when I was enhancing libvirt's guest CPU configuration code to be able to really ensure stable guest CPU ABI, I added a new attribute //cpu/@check which is nicely

Re: [libvirt] [PATCH v2 1/2] util: Deduplicate code in virNetlinkEventServiceStopAll

2017-05-18 Thread John Ferlan
On 05/18/2017 12:06 AM, Wang King wrote: > Commit 15a71e60 introduced the virNetlinkEventServiceStopAll function, and > the code in virNetlinkEventServiceStop is copied to this function. can use > virNetlinkEventServiceStop instead. > --- > src/util/virnetlink.c | 25 +++-- >

Re: [libvirt] [PATCH v4 4/6] nodedev: Introduce the mdev capability to a PCI parent device

2017-05-18 Thread Erik Skultety
On Thu, May 18, 2017 at 06:48:48AM -0400, John Ferlan wrote: > [...] > > >>> +static int > >>> +udevFillMdevType(struct udev_device *device, > >>> + const char *dir, > >>> + virNodeDevCapMdevTypePtr type) > >>> +{ > >>> +int ret = -1; > >>> +char *attrpath =

Re: [libvirt] [PATCH v4 4/6] nodedev: Introduce the mdev capability to a PCI parent device

2017-05-18 Thread John Ferlan
[...] >>> +static int >>> +udevFillMdevType(struct udev_device *device, >>> + const char *dir, >>> + virNodeDevCapMdevTypePtr type) >>> +{ >>> +int ret = -1; >>> +char *attrpath = NULL; >>> + >>> +#define MDEV_GET_SYSFS_ATTR(attr_name, cb, ...)

Re: [libvirt] [PATCH v4 4/6] nodedev: Introduce the mdev capability to a PCI parent device

2017-05-18 Thread Erik Skultety
On Wed, May 17, 2017 at 05:22:45PM -0400, John Ferlan wrote: > > > On 05/15/2017 08:10 AM, Erik Skultety wrote: > > The parent device needs to report the generic stuff about the supported > > mediated devices types, like device API, available instances, type name, > > etc. Therefore this patch intr

Re: [libvirt] [RFC] Fixing a regression caused by recent CPU driver changes

2017-05-18 Thread Pavel Hrdina
On Thu, May 18, 2017 at 10:22:59AM +0200, Jiri Denemark wrote: > Hi all, > > when I was enhancing libvirt's guest CPU configuration code to be able > to really ensure stable guest CPU ABI, I added a new attribute > //cpu/@check which is nicely backward compatible... an old libvirt will > just igno

[libvirt] [PATCH 1/2] conf: add eim attribute to

2017-05-18 Thread Ján Tomko
Add an attribute to control extended interrupt mode. https://bugzilla.redhat.com/show_bug.cgi?id=1451282 --- docs/formatdomain.html.in | 10 +++ docs/schemas/domaincommon.rng | 5 src/conf/domain_conf.c | 20 +

[libvirt] [PATCH 0/2] Add eim attribute to iommu device

2017-05-18 Thread Ján Tomko
Extended interrupt mode allows >255 vCPUs with q35-based machine types. https://bugzilla.redhat.com/show_bug.cgi?id=1451282 Ján Tomko (2): conf: add eim attribute to qemu: format eim on intel-iommu command line docs/formatdomain.html.in | 10 +++ docs/schemas/d

[libvirt] [PATCH 2/2] qemu: format eim on intel-iommu command line

2017-05-18 Thread Ján Tomko
This option turns on extended interrupt mode, which allows more than 255 vCPUs. https://bugzilla.redhat.com/show_bug.cgi?id=1451282 --- src/qemu/qemu_capabilities.c | 2 ++ src/qemu/qemu_capabilities.h | 1 + src/qemu/qemu_command.c

[libvirt] [PATCH 6/8] apparmor: include local apparmor profiles

2017-05-18 Thread Stefan Bader
From: Felix Geyer Local overrides is a feature Debian/Ubuntu libvirt provided for a while. This allows the user to have a non-conffile that he can use to extend the package delivered rules with extra content matching his special case. This change adds the include directives to the apparmor profi

[libvirt] [PATCH 7/8] appmor, libvirt-qemu: Add 9p support

2017-05-18 Thread Stefan Bader
From: Serge Hallyn Add fowner and fsetid to libvirt-qemu profile. Bug-Ubuntu: https://bugs.launchpad.net/bugs/1378434 Signed-off-by: Christian Ehrhardt Signed-off-by: Stefan Bader --- examples/apparmor/libvirt-qemu | 4 1 file changed, 4 insertions(+) diff --git a/examples/apparmor/lib

[libvirt] [PATCH 1/8] virt-aa-helper: Ask for no deny rule for readonly disk elements

2017-05-18 Thread Stefan Bader
From: Serge Hallyn Just because a disk element only requests read access doesn't mean there may not be another readwrite request. Using 'R' when creating the apparmor rule will prevent an implicit write-deny rule to be created alongside. This does not mean write is allowed but it would cause a d

[libvirt] [PATCH 3/8] apparmor, virt-aa-helper: Allow aarch64 UEFI.

2017-05-18 Thread Stefan Bader
From: William Grant Allow access to aarch64 UEFI images. Signed-off-by: Christian Ehrhardt Signed-off-by: Stefan Bader Acked-by: Guido Günther --- examples/apparmor/libvirt-qemu | 2 ++ src/security/virt-aa-helper.c | 4 +++- tests/virt-aa-helper-test | 2 ++ 3 files changed, 7 inserti

[libvirt] [PATCH 8/8] apparmor, libvirt-qemu: Add ppc64el related changes

2017-05-18 Thread Stefan Bader
From: Serge Hallyn Updates profile to allow running on ppc64el. Bug-Ubuntu: https://bugs.launchpad.net/bugs/1374554 Signed-off-by: Christian Ehrhardt Signed-off-by: Stefan Bader --- examples/apparmor/libvirt-qemu | 7 +++ 1 file changed, 7 insertions(+) diff --git a/examples/apparmor/li

[libvirt] [PATCH 4/8] apparmor, virt-aa-helper: Allow access to libnl-3 config files

2017-05-18 Thread Stefan Bader
From: Felix Geyer Allow access to libnl-3 config files Signed-off-by: Christian Ehrhardt Signed-off-by: Stefan Bader Acked-by: Guido Günther --- examples/apparmor/usr.lib.libvirt.virt-aa-helper | 2 ++ 1 file changed, 2 insertions(+) diff --git a/examples/apparmor/usr.lib.libvirt.virt-aa-he

[libvirt] [PATCH 2/8] apparmor, virt-aa-helper: allow /usr/share/OVMF/ too

2017-05-18 Thread Stefan Bader
From: Simon McVittie The split firmware and variables files introduced by https://bugs.debian.org/764918 are in a different directory for some reason. Let the virtual machine read both. Extended by Christian Ehrhardt to generalize FW test (simplifies additional testing on firmware files in futur

[libvirt] [PATCH 5/8] apparmor, virt-aa-helper: Explicit denies for host devices

2017-05-18 Thread Stefan Bader
From: Felix Geyer Add explicit denies for disk devices to avoid cluttering dmesg with (acceptable) denials (merged with a second patch which added more disk device names). Signed-off-by: Christian Ehrhardt Signed-off-by: Stefan Bader Acked-by: Guido Günther --- examples/apparmor/usr.lib.libv

[libvirt] Various apparmor related changes (part 1), version 2

2017-05-18 Thread Stefan Bader
> Over the years there have been a bunch of changes to the > apparmor profiles and/or virt-aa-helper which have been > carried in Debian/Ubuntu but never made it upstream. > > In an attempt to clean this up and generally improve the > apparmor based environments, we (Christian and I) went > over t

Re: [libvirt] [PATCH] pci: fix link maximum speed detection

2017-05-18 Thread Michal Privoznik
On 05/16/2017 03:19 PM, Marek Marczykowski-Górecki wrote: > Commit 8e09663 "pci: recognize/report GEN4 (PCIe 4.0) card 16GT/s Link > speed" introduced another speed into enum, but mistakenly also altered > field width, so one bit of link width was included there. > > Signed-off-by: Marek Marczykow

[libvirt] [RFC] Fixing a regression caused by recent CPU driver changes

2017-05-18 Thread Jiri Denemark
Hi all, when I was enhancing libvirt's guest CPU configuration code to be able to really ensure stable guest CPU ABI, I added a new attribute //cpu/@check which is nicely backward compatible... an old libvirt will just ignore it. However, even if check='full' will be ignored, an old libvirt will s

Re: [libvirt] [PATCH] virDomainDefCheckABIStabilityFlags: Check for memoryBacking

2017-05-18 Thread Peter Krempa
On Thu, May 18, 2017 at 10:05:55 +0200, Michal Privoznik wrote: > https://bugzilla.redhat.com/show_bug.cgi?id=1450349 > > Problem is, memoryBacking is part of guest ABI. Therefore > changing it on migration/restore from an image can lead > qemu/guest to rejecting the image. > > At the same time,

[libvirt] [PATCH] virDomainDefCheckABIStabilityFlags: Check for memoryBacking

2017-05-18 Thread Michal Privoznik
https://bugzilla.redhat.com/show_bug.cgi?id=1450349 Problem is, memoryBacking is part of guest ABI. Therefore changing it on migration/restore from an image can lead qemu/guest to rejecting the image. At the same time, move other partial checks of virDomainMemtune into the same function: virDomai