[libvirt] [PATCHv2 0/9] network: properly support openvswitch in

2012-08-14 Thread Laine Stump
This is mainly a refresh of the initial version of the patch to rebase, but there have also been a couple of small bugs fixed. In particular, if not is specified in the domain's interface element, connection of the interface to an ovs switch won't fail because of a missing interfaceid (see http://

[libvirt] [PATCHv2 1/9] util: make return value of virUUIDFormat and virMacAddrFormat useful

2012-08-14 Thread Laine Stump
Both of these functions returned void, but it's convenient for them to return a const char* of the char* that is passed in. This was you can call the function and use the result in the same expression/arg. --- src/util/uuid.c | 6 -- src/util/uuid.h | 6 +++--- src/util/virmacadd

[libvirt] [PATCHv2 6/9] conf: make error returns from virDomainActualNetDefFormat consistent

2012-08-14 Thread Laine Stump
There was an error: label that simply did "return ret", but ret was defaulted to -1, and was never used other than setting it manually to 0 just before a non-error return. Aside from this, some of the error return paths used "goto error" and others used "return ret". This patch removes ret and the

[libvirt] [PATCHv2 2/9] util: eliminate union in virNetDevVPortProfile

2012-08-14 Thread Laine Stump
virNetDevVPortProfile has (had) a type field that can be set to one of several values, and a union of several structs, one for each type. When a domain's interface object is of type "network", the domain config may not know beforehand which type of virtualport is going to be provided in the actual

[libvirt] [PATCHv2 4/9] util: utility functions for virNetDevVPortProfile

2012-08-14 Thread Laine Stump
This patch adds three utility functions that operate on virNetDevVPortProfile objects. * virNetDevVPortProfileCheckComplete() - verifies that all attributes required for the type of the given virtport are specified. * virNetDevVPortProfileCheckNoExtras() - verifies that there are no attri

[libvirt] [PATCHv2 5/9] conf: move virtPortProfile out of unions in virDomainNetDef

2012-08-14 Thread Laine Stump
virtPortProfile is now used by 4 different types of network devices (NETWORK, BRIDGE, DIRECT, and HOSTDEV), and it's getting cumbersome to replicate so much code in 4 different places just because each type has the virtPortProfile in a slightly different place. This patch puts a single virtPortProf

[libvirt] [PATCHv2 8/9] conf: support partially-specified in parser and formatter

2012-08-14 Thread Laine Stump
Until now, all attributes in a parameter list that were acceptable for a particular type, were also required. There were no optional attributes. One of the aims of supporting in libvirt's virtual networks and portgroups is to allow specifying the group-wide parameters in the network's virtualpor

[libvirt] [PATCHv2 9/9] network: merge relevant virtualports rather than choosing one

2012-08-14 Thread Laine Stump
One of the original ideas behind allowing a in an interface definition as well as in the definition *and*one or more s within the network, was that guest-specific parameteres (like instanceid and interfaceid) could be given in the interface's virtualport, and more general things (portid, manageri

[libvirt] [PATCHv2 3/5] conf: output forward device connections count in network XML

2012-08-14 Thread Laine Stump
It may be useful for management applications to know which physical network devices are in use by guests. This information is already available in the network objects, but wasn't output in the XML. This patch outputs it whan the INACTIVE flag isn't set (and if it's non-0). --- src/conf/network_con

[libvirt] [PATCHv2 0/5] network: report #connections in network xml

2012-08-14 Thread Laine Stump
This repost of an unreviewed patchset from last week is purely to rebase - the "openvswitch in 9 patch series is a prerequisite of this, and this is a prerequisite of the vlan patch series resend coming up. These are all fairly short and simple, so shouldn't require too much hair pulling to revie

[libvirt] [PATCHv2 1/5] conf: use a unique data type for PF array in virDomainNetDef

2012-08-14 Thread Laine Stump
This array was originally defined using the existing virNetworkForwardIfDef, but that struct has a UsageCount field that isn't used in the case of PFs. This patch just copies that struct and removes UsageCount. It ends up being a struct with a single field, but I left it as a struct in case we need

[libvirt] [PATCHv2 5/5] network: add connections counter to networks

2012-08-14 Thread Laine Stump
Just as each physical device used by a network has a connections counter, now each network has a connections counter which is incremented once for each guest interface that connects using this network. The count is output in the live network XML, like this: ... It is read-only, and fo

[libvirt] [PATCHv2 3/9] util: add openvswitch case to virNetDevVPortProfileEqual

2012-08-14 Thread Laine Stump
This function was overlooked when openvswitch support was added. Fortunately it's only use for update-device, which is relatively new and seldom-used. --- src/util/virnetdevvportprofile.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/src/util/virnetdevvportprofile.c b/src/util/virnetde

[libvirt] [PATCHv2 7/9] conf: simplify Buffer Indentation in virDomainNetDefFormat

2012-08-14 Thread Laine Stump
This function has several calls to increase the buffer indent by 6, then decrease it again, then increase, then decrease. Additionally, there were several printfs that had 6 spaces at the beginning of the line. virDomainActualNetDefFormat, which is called by virDomainNetDefFormat, had similar ugli

[libvirt] [PATCHv2 2/5] conf: rename interface "usageCount" to "connections"

2012-08-14 Thread Laine Stump
I want to include this count in the xml output of networks, but calling it "connections" in the XML sounds better than "usageCount", and it would be better if the name in the XML matched the variable name. In a few places, usageCount was being initialized to 0, but this is unnecessary, because VIR

[libvirt] [PATCHv2 2/4] util: add virNetDevVlanType

2012-08-14 Thread Laine Stump
To allow for the possibility of vlan "trunks", which have more than one vlan tag associated with them, we need a vlan struct. Since it will be used by multiple files in src/util, src/conf, src/network, and src/qemu, it must be defined in src/util. Unfortunately there isn't currently a common file f

[libvirt] [PATCHv2 0/4] support element for interfaces and networks

2012-08-14 Thread Laine Stump
danpb raised a (valid) objection about the XML format in the first version of these patches, so I've redone it to be like this: The downside is that for a single vlan tag, it's more verbose: On the other hand, it's more consistent. The rest of the patches in

[libvirt] [PATCHv2 1/4] schema: fix some problems in network/interface schemas

2012-08-14 Thread Laine Stump
allows a element, but the schema didn't have this. Since this makes for multiple elements in portgroup, they must be interleaved. needs to allow elements for openvswitch, but the schema didn't allow this. --- docs/schemas/domaincommon.rng | 3 +++ docs/schemas/network.rng | 11 -

Re: [libvirt] [PATCH 0/9] network: properly support openvswitch in

2012-08-14 Thread Laine Stump
I've fixed some bugs in these patches, rebased, and reposted: http://www.redhat.com/archives/libvir-list/2012-August/msg00891.html Consider this set obsolete. -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list

[libvirt] [PATCHv2 3/4] conf: add element to network and domain interface elements

2012-08-14 Thread Laine Stump
The following config elements now support a subelements: within a domain: , and the subelement of within a network: the toplevel, as well as any Each vlan element must have one or more subelements. If there is more than one tag, it is assumed that vlan trunking is being requested. If trunki

[libvirt] [PATCHv2 4/4] network: make network driver vlan-aware

2012-08-14 Thread Laine Stump
The network driver now looks for the vlan element in network and portgroup objects, and logs an error at network define time if a vlan is requested for a network type that doesn't support it. (Currently vlan configuration is only supported for openvswitch networks, and networks used to do hostdev a

Re: [libvirt] [PATCH 0/5] network: report #connections in network xml

2012-08-14 Thread Laine Stump
I've rebased and reposted these patches: http://www.redhat.com/archives/libvir-list/2012-August/msg00901.html Consider this set obsolete. On 08/06/2012 08:19 PM, Laine Stump wrote: > The forward devices in direct mode (aka macvtap) networks already have > a counter to keep track of how many g

[libvirt] [PATCHv2 4/5] network: change cleanup: to error: in network*() functions

2012-08-14 Thread Laine Stump
A later patch will be adding a counter that will be incremented/decremented each time an guest interface starts/stops using a particular network. For this to work, all types of networks need to go through a common return sequence rather than returning early. To setup for this, the existing cleanup:

Re: [libvirt] [PATCH 0/4] support element for interfaces and networks

2012-08-14 Thread Laine Stump
I've modified the XML as suggested by danpb, rebased, and reposted the entire series: http://www.redhat.com/archives/libvir-list/2012-August/msg00907.html Consider this set obsolete. -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list

[libvirt] [PATCH v2]virsh: Add helper to avoid the strcase check for virsh-*.c

2012-08-14 Thread Osier Yang
* tools/virsh.c: New macro vshStrcasecmp * tools/virsh-domain-monitor.c: Use vshStrcasecmp instead of strcasecmp * tools/virsh-snapshot.c: Likewise * cfg.mk: Only avoid doing strcase checking for virsh.c --- cfg.mk |2 +- tools/virsh-domain

Re: [libvirt] [PATCH] * configura.ac, spec file: firewalld now defaults to enabled, depends on dbus * fixed comment for with_firewalld define * bridge_driver, nwfilter_driver: new dbus filters to get

2012-08-14 Thread Daniel P. Berrange
On Mon, Aug 13, 2012 at 04:24:04PM -0400, Laine Stump wrote: > We can then decide at runtime whether or not to actually use the > commands. You had mentioned on IRC the possibility of firewalld starting > up after libvirt, or shutting down while libvirt is still running. The > issue I see with that

Re: [libvirt] [PATCH 02/48] Destroy virdomainlist.[ch]

2012-08-14 Thread Osier Yang
On 2012年08月14日 07:53, Eric Blake wrote: On 08/03/2012 09:48 AM, Osier Yang wrote: As the consensus in: https://www.redhat.com/archives/libvir-list/2012-July/msg01692.html, this patch is to destroy conf/virdomainlist.[ch], foldering the s/foldering/folding/ helpers into conf/domain_conf.[ch].

Re: [libvirt] [PATCH v3 1/4] qemu: Unify port-wise SPICE and VNC behavior

2012-08-14 Thread Daniel P. Berrange
On Mon, Aug 13, 2012 at 03:21:22PM +0200, Martin Kletzander wrote: > Port allocations for SPICE and VNC behave almost the same (with > default ports), but there is some mess in the code. This patch clears > these inconsistencies and makes sure the same behavior will be used > when ports for remote

Re: [libvirt] [PATCH v3 3/4] qemu: modify 3 error messages

2012-08-14 Thread Daniel P. Berrange
On Mon, Aug 13, 2012 at 03:21:24PM +0200, Martin Kletzander wrote: > After the cleanup of remote display port allocation, I noticed some > messages that didn't make a lot of sense the way they were written. So > I rephrased them. > --- > src/qemu/qemu_process.c |6 +++--- > 1 files changed, 3

Re: [libvirt] [PATCH v3 2/4] qemu: configurable remote display port boundaries

2012-08-14 Thread Daniel P. Berrange
On Mon, Aug 13, 2012 at 03:21:23PM +0200, Martin Kletzander wrote: > The defines QEMU_REMOTE_PORT_MIN and QEMU_REMOTE_PORT_MAX were used to > find free port when starting domains. As this was hard-coded to the > same ports as default VNC servers, there were races with these other > programs. This p

Re: [libvirt] [PATCH v3 4/4] qemu: allow searching for all open ports

2012-08-14 Thread Daniel P. Berrange
On Mon, Aug 13, 2012 at 03:21:25PM +0200, Martin Kletzander wrote: > This patch allows to specify a flag 'rotate' saying that the search > for next port should not be limited from the 'startPort' upwards. > > This is subsequently used in the search for open SPICE TLS port when > none is specified

[libvirt] [PATCH] util: typos in fallback code fo virDoubleToStr

2012-08-14 Thread Martin Kletzander
Fixes for some typos that somehow didn't get to the final push of the commit 43bfa23e6f968be9a8c134a4b5c3cfb6da3816d9. --- Pushing as a build-breaker. src/util/util.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/util/util.c b/src/util/util.c index 4a720d8..9068e

Re: [libvirt] [PATCH v3 1/4] qemu: Unify port-wise SPICE and VNC behavior

2012-08-14 Thread Martin Kletzander
On 08/14/2012 11:42 AM, Daniel P. Berrange wrote: > On Mon, Aug 13, 2012 at 03:21:22PM +0200, Martin Kletzander wrote: >> Port allocations for SPICE and VNC behave almost the same (with >> default ports), but there is some mess in the code. This patch clears >> these inconsistencies and makes sure

Re: [libvirt] [Qemu-devel] [PATCH v10 0/7] file descriptor passing using fd sets

2012-08-14 Thread Kevin Wolf
Am 13.08.2012 20:39, schrieb Corey Bryant: > > > On 08/13/2012 02:02 PM, Eric Blake wrote: >> On 08/13/2012 08:08 AM, Corey Bryant wrote: >>> libvirt's sVirt security driver provides SELinux MAC isolation for >>> Qemu guest processes and their corresponding image files. In other >>> words, sVirt

[libvirt] [PATCH] openvz: unlock virDomainObj objects in openvzOpen

2012-08-14 Thread Dmitry Guryanov
openvzOpen fucntion must leave unlocked virDomainObj objects in driver->domains. Now even simple commands like list or domain lookup hang, for example virsh -c openvz:///system list --all. Signed-off-by: Dmitry Guryanov --- src/openvz/openvz_conf.c |1 + 1 files changed, 1 insertions(+), 0

[libvirt] [PATCH v2] Add virRandom() API to generate numbers with non-power-of-2 limit

2012-08-14 Thread Daniel P. Berrange
From: "Daniel P. Berrange" The current virRandomBits() API is only usable if the caller wants a random number in the range [0, (n-1)] where n is a power of two. This adds a virRandom() API which generates a double in the range [0.0,1.0] with 48 bits of entropy. It then also adds a virRandomInt(ui

Re: [libvirt] [PATCH v2]virsh: Add helper to avoid the strcase check for virsh-*.c

2012-08-14 Thread Eric Blake
On 08/14/2012 01:21 AM, Osier Yang wrote: > * tools/virsh.c: New macro vshStrcasecmp > * tools/virsh-domain-monitor.c: Use vshStrcasecmp instead of > strcasecmp > * tools/virsh-snapshot.c: Likewise > * cfg.mk: Only avoid doing strcase checking for virsh.c > --- > cf

Re: [libvirt] [PATCH 02/48] Destroy virdomainlist.[ch]

2012-08-14 Thread Eric Blake
On 08/14/2012 03:28 AM, Osier Yang wrote: >> for (i = 0; i< count; i++) { >> if (data.domains[i]) >> -virUnrefDomain(data.domains[i]); > > Not sure if it will cause conflicts to you, but the "if" is removed > for "avoid_if_before_free". Nah, 'make syntax-

Re: [libvirt] [PATCH v10 6/7] block: Enable qemu_open/close to work with fd sets

2012-08-14 Thread Kevin Wolf
Am 13.08.2012 16:08, schrieb Corey Bryant: > When qemu_open is passed a filename of the "/dev/fdset/nnn" > format (where nnn is the fdset ID), an fd with matching access > mode flags will be searched for within the specified monitor > fd set. If the fd is found, a dup of the fd will be returned >

[libvirt] [PATCH v4] qemu: Unify port-wise SPICE and VNC behavior

2012-08-14 Thread Martin Kletzander
Port allocations for SPICE and VNC behave almost the same (with default ports), but there is some mess in the code. This patch clears these inconsistencies and makes sure the same behavior will be used when ports for remote displays are changed. Changes: - hard-coded number 5900 removed (handled

Re: [libvirt] [PATCHv2 0/4] support element for interfaces and networks

2012-08-14 Thread Dennis Jenkins
On Tue, Aug 14, 2012 at 2:15 AM, Laine Stump wrote: > danpb raised a (valid) objection about the XML format in the first > version of these patches, so I've redone it to be like this: > > > > > > > The downside is that for a single vlan tag, it's more verbose: > > >

Re: [libvirt] [PATCHv2 1/9] util: make return value of virUUIDFormat and virMacAddrFormat useful

2012-08-14 Thread Kyle Mestery (kmestery)
This looks good to me. Acked-by: Kyle Mestery On Aug 14, 2012, at 2:04 AM, Laine Stump wrote: > Both of these functions returned void, but it's convenient for them to > return a const char* of the char* that is passed in. This was you can > call the function and use the result in the same expre

Re: [libvirt] [PATCHv2 3/9] util: add openvswitch case to virNetDevVPortProfileEqual

2012-08-14 Thread Kyle Mestery (kmestery)
This looks good to me. Acked-by: Kyle Mestery On Aug 14, 2012, at 2:04 AM, Laine Stump wrote: > This function was overlooked when openvswitch support was > added. Fortunately it's only use for update-device, which is > relatively new and seldom-used. > --- > src/util/virnetdevvportprofile.c | 6

Re: [libvirt] [PATCHv2 2/9] util: eliminate union in virNetDevVPortProfile

2012-08-14 Thread Kyle Mestery (kmestery)
This looks good to me. Acked-by: Kyle Mestery On Aug 14, 2012, at 2:04 AM, Laine Stump wrote: > virNetDevVPortProfile has (had) a type field that can be set to one of > several values, and a union of several structs, one for each > type. When a domain's interface object is of type "network", th

Re: [libvirt] [PATCH v2] Add virRandom() API to generate numbers with non-power-of-2 limit

2012-08-14 Thread Eric Blake
On 08/14/2012 05:13 AM, Daniel P. Berrange wrote: > From: "Daniel P. Berrange" > > The current virRandomBits() API is only usable if the caller wants > a random number in the range [0, (n-1)] where n is a power of two. This one is correct (it could also be written '[0, n)'). > This adds a virRa

Re: [libvirt] [PATCHv2 5/9] conf: move virtPortProfile out of unions in virDomainNetDef

2012-08-14 Thread Kyle Mestery (kmestery)
This looks good to me. Acked-by: Kyle Mestery On Aug 14, 2012, at 2:04 AM, Laine Stump wrote: > virtPortProfile is now used by 4 different types of network devices > (NETWORK, BRIDGE, DIRECT, and HOSTDEV), and it's getting cumbersome to > replicate so much code in 4 different places just becaus

Re: [libvirt] [PATCHv2 6/9] conf: make error returns from virDomainActualNetDefFormat consistent

2012-08-14 Thread Kyle Mestery (kmestery)
Nice cleanup here, this looks good to me. Acked-by: Kyle Mestery On Aug 14, 2012, at 2:04 AM, Laine Stump wrote: > There was an error: label that simply did "return ret", but ret was > defaulted to -1, and was never used other than setting it manually to > 0 just before a non-error return. Asid

Re: [libvirt] [PATCHv2 4/9] util: utility functions for virNetDevVPortProfile

2012-08-14 Thread Kyle Mestery (kmestery)
This looks good to me. Acked-by: Kyle Mestery On Aug 14, 2012, at 2:04 AM, Laine Stump wrote: > This patch adds three utility functions that operate on > virNetDevVPortProfile objects. > > * virNetDevVPortProfileCheckComplete() - verifies that all attributes >required for the type of the g

Re: [libvirt] [PATCHv2 7/9] conf: simplify Buffer Indentation in virDomainNetDefFormat

2012-08-14 Thread Kyle Mestery (kmestery)
This looks good to me. Acked-by: Kyle Mestery On Aug 14, 2012, at 2:04 AM, Laine Stump wrote: > This function has several calls to increase the buffer indent by 6, > then decrease it again, then increase, then decrease. Additionally, > there were several printfs that had 6 spaces at the beginni

Re: [libvirt] [PATCHv2 8/9] conf: support partially-specified in parser and formatter

2012-08-14 Thread Kyle Mestery (kmestery)
This looks good to me. Acked-by: Kyle Mestery On Aug 14, 2012, at 2:04 AM, Laine Stump wrote: > Until now, all attributes in a parameter list that were > acceptable for a particular type, were also required. There were no > optional attributes. > > One of the aims of supporting in libvirt's

Re: [libvirt] [PATCHv2 9/9] network: merge relevant virtualports rather than choosing one

2012-08-14 Thread Kyle Mestery (kmestery)
This looks good to me, with some minor nits below. Acked-by: Kyle Mestery On Aug 14, 2012, at 2:04 AM, Laine Stump wrote: > One of the original ideas behind allowing a in an > interface definition as well as in the definition *and*one > or more s within the network, was that guest-specific >

Re: [libvirt] QEMU 1.2 Test Day - August 16 2012

2012-08-14 Thread Stefan Hajnoczi
On Thu, Aug 2, 2012 at 1:22 PM, Stefan Hajnoczi wrote: > I have set up the QEMU 1.2 Testing wiki page and suggest August 16 as > the Test Day: > > http://wiki.qemu.org/Planning/1.2/Testing QEMU 1.2 Test Day is only 2 days away! Please help test QEMU 1.2-rc and add yourself to the wiki: http://wi

Re: [libvirt] [PATCHv2 1/9] util: make return value of virUUIDFormat and virMacAddrFormat useful

2012-08-14 Thread Daniel P. Berrange
On Tue, Aug 14, 2012 at 01:21:14PM +, Kyle Mestery (kmestery) wrote: > This looks good to me. > > Acked-by: Kyle Mestery Thanks for taking the time to review this series. We're always happy to see new community members joining in with patch reviews, since we have far more patches needing rev

Re: [libvirt] [PATCHv2 1/5] conf: use a unique data type for PF array in virDomainNetDef

2012-08-14 Thread Eric Blake
On 08/14/2012 01:10 AM, Laine Stump wrote: > This array was originally defined using the existing > virNetworkForwardIfDef, but that struct has a UsageCount field that > isn't used in the case of PFs. This patch just copies that struct and > removes UsageCount. It ends up being a struct with a sing

Re: [libvirt] [PATCHv2 2/5] conf: rename interface "usageCount" to "connections"

2012-08-14 Thread Eric Blake
On 08/14/2012 01:10 AM, Laine Stump wrote: > I want to include this count in the xml output of networks, but > calling it "connections" in the XML sounds better than "usageCount", and it > would be better if the name in the XML matched the variable name. > > In a few places, usageCount was being i

Re: [libvirt] [PATCH v10 6/7] block: Enable qemu_open/close to work with fd sets

2012-08-14 Thread Corey Bryant
On 08/14/2012 08:07 AM, Kevin Wolf wrote: Am 13.08.2012 16:08, schrieb Corey Bryant: When qemu_open is passed a filename of the "/dev/fdset/nnn" format (where nnn is the fdset ID), an fd with matching access mode flags will be searched for within the specified monitor fd set. If the fd is fou

Re: [libvirt] [PATCHv2 3/5] conf: output forward device connections count in network XML

2012-08-14 Thread Eric Blake
On 08/14/2012 01:10 AM, Laine Stump wrote: > It may be useful for management applications to know which physical > network devices are in use by guests. This information is already > available in the network objects, but wasn't output in the XML. This > patch outputs it whan the INACTIVE flag isn't

Re: [libvirt] [PATCH 5/8] Honour current user and role in SELinux label generation

2012-08-14 Thread Daniel P. Berrange
On Fri, Aug 10, 2012 at 02:55:24PM -0600, Eric Blake wrote: > On 08/10/2012 07:48 AM, Daniel P. Berrange wrote: > > From: "Daniel P. Berrange" > > > > When generating an SELinux context for a VM from the template > > "system_u:system_r:svirt_t:s0", copy the role + user from the > > current proces

Re: [libvirt] [PATCH 6/8] Pull code which finds a free MCS label out into its own method

2012-08-14 Thread Daniel P. Berrange
On Fri, Aug 10, 2012 at 03:02:24PM -0600, Eric Blake wrote: > On 08/10/2012 07:48 AM, Daniel P. Berrange wrote: > > From: "Daniel P. Berrange" > > > > The code for picking a MCS label is about to get significantly > > more complicated, so it deserves to be in a standlone method, > > instead of a

Re: [libvirt] [PATCH 7/8] Honour current sensitivity and category ranges in SELinux label generation

2012-08-14 Thread Daniel P. Berrange
On Fri, Aug 10, 2012 at 03:20:58PM -0600, Eric Blake wrote: > On 08/10/2012 07:48 AM, Daniel P. Berrange wrote: > > + > > +if (getcon(&curseccontext) < 0) { > > +virReportSystemError(errno, "%s", > > + _("Unable to get current process SELinux > > context"));

Re: [libvirt] [PATCH 8/8] Add test case for SELinux label generation

2012-08-14 Thread Daniel P. Berrange
On Fri, Aug 10, 2012 at 03:50:25PM -0600, Eric Blake wrote: > On 08/10/2012 07:48 AM, Daniel P. Berrange wrote: > > +++ b/tests/securityselinuxhelper.c > > @@ -0,0 +1,65 @@ > > +/* > > + * Copyright (C) 2011-2012 Red Hat, Inc. > > + * > > + * This library is free software; you can redistribute it a

[libvirt] [PATCH v2 1/2] Honour current sensitivity and category ranges in SELinux label generation

2012-08-14 Thread Daniel P. Berrange
From: "Daniel P. Berrange" Currently the dynamic label generation code will create labels with a sensitivity of s0, and a category pair in the range 0-1023. This is fine when running a standard MCS policy because libvirtd will run with a label system_u:system_r:virtd_t:s0-s0:c0.c1023 With cus

[libvirt] [PATCH v2 2/2] Add test case for SELinux label generation

2012-08-14 Thread Daniel P. Berrange
From: "Daniel P. Berrange" This test case validates the correct generation of SELinux labels for VMs, wrt the current process label. Since we can't actually change the label of the test program process, we create a shared library libsecurityselinuxhelper.so which overrides the getcon() and setcon

Re: [libvirt] [PATCHv2 4/5] network: change cleanup: to error: in network*() functions

2012-08-14 Thread Eric Blake
On 08/14/2012 01:10 AM, Laine Stump wrote: > A later patch will be adding a counter that will be > incremented/decremented each time an guest interface starts/stops > using a particular network. For this to work, all types of networks > need to go through a common return sequence rather than return

Re: [libvirt] [PATCH v2] Add virRandom() API to generate numbers with non-power-of-2 limit

2012-08-14 Thread Eric Blake
On 08/14/2012 05:13 AM, Daniel P. Berrange wrote: > From: "Daniel P. Berrange" > > The current virRandomBits() API is only usable if the caller wants > a random number in the range [0, (n-1)] where n is a power of two. > This adds a virRandom() API which generates a double in the > range [0.0,1.0

[libvirt] [PATCH] conf: log error when encountering multiple filterrefs in interface

2012-08-14 Thread Laine Stump
Each interface has a single pointer to a filterref object. That filterref can itself point to multiple other filterrefs, but at the toplevel there is only one. The parser had previously just silently overwritten earlier filterrefs when a new one was encountered, so the interface was left with whic

Re: [libvirt] [PATCHv2 2/5] conf: rename interface "usageCount" to "connections"

2012-08-14 Thread Kyle Mestery (kmestery)
Looks good to me. Acked-by: Kyle Mestery On Aug 14, 2012, at 2:10 AM, Laine Stump wrote: > I want to include this count in the xml output of networks, but > calling it "connections" in the XML sounds better than "usageCount", and it > would be better if the name in the XML matched the variable

Re: [libvirt] [PATCHv2 4/5] network: change cleanup: to error: in network*() functions

2012-08-14 Thread Kyle Mestery (kmestery)
Looks good. Acked-by: Kyle Mestery On Aug 14, 2012, at 2:10 AM, Laine Stump wrote: > A later patch will be adding a counter that will be > incremented/decremented each time an guest interface starts/stops > using a particular network. For this to work, all types of networks > need to go through

Re: [libvirt] [PATCHv2 1/5] conf: use a unique data type for PF array in virDomainNetDef

2012-08-14 Thread Kyle Mestery (kmestery)
Looks good to me. Acked-by: Kyle Mestery On Aug 14, 2012, at 2:10 AM, Laine Stump wrote: > This array was originally defined using the existing > virNetworkForwardIfDef, but that struct has a UsageCount field that > isn't used in the case of PFs. This patch just copies that struct and > removes

Re: [libvirt] [PATCHv2 3/5] conf: output forward device connections count in network XML

2012-08-14 Thread Kyle Mestery (kmestery)
Looks good to me. Acked-by: Kyle Mestery On Aug 14, 2012, at 2:10 AM, Laine Stump wrote: > It may be useful for management applications to know which physical > network devices are in use by guests. This information is already > available in the network objects, but wasn't output in the XML. Th

Re: [libvirt] [PATCHv2 5/5] network: add connections counter to networks

2012-08-14 Thread Kyle Mestery (kmestery)
Looks good to me. Acked-by: Kyle Mestery On Aug 14, 2012, at 2:10 AM, Laine Stump wrote: > Just as each physical device used by a network has a connections > counter, now each network has a connections counter which is > incremented once for each guest interface that connects using this > netwo

[libvirt] the arguments of qemudDispatchServerEvent

2012-08-14 Thread mzawdx wang
Hi all: I am now reading the source codes of libvirt with version 0.9.2 , and be stuck by the function "qemudDispatchServerEvent". as you can see: static void qemudDispatchServerEvent(int watch, int fd, int events, void *opaque) { ... } My question is : except for the argument "void *opaque

Re: [libvirt] [PATCHv2 5/5] network: add connections counter to networks

2012-08-14 Thread Eric Blake
On 08/14/2012 01:10 AM, Laine Stump wrote: > Just as each physical device used by a network has a connections > counter, now each network has a connections counter which is > incremented once for each guest interface that connects using this > network. > > The count is output in the live network X

Re: [libvirt] [PATCH] openvz: unlock virDomainObj objects in openvzOpen

2012-08-14 Thread Eric Blake
On 08/14/2012 04:58 AM, Dmitry Guryanov wrote: > openvzOpen fucntion must leave unlocked virDomainObj objects in > driver->domains. > > Now even simple commands like list or domain lookup hang, > for example virsh -c openvz:///system list --all. > > Signed-off-by: Dmitry Guryanov > --- > src/op

Re: [libvirt] the arguments of qemudDispatchServerEvent

2012-08-14 Thread Eric Blake
On 08/14/2012 09:35 AM, mzawdx wang wrote: > Hi all: >I am now reading the source codes of libvirt with version 0.9.2 , You'd be better off investigating the source code of libvirt.git (the current development is working towards 0.10.0 as the successor to the released 0.9.13); 0.9.2 is qui

[libvirt] stateless drivers and stored lists of virDomainObjs

2012-08-14 Thread Dmitry Guryanov
Hello, vmware, openvz and parallels driver, which was written with first two ones as an example, get list of domains in virConnectOpen and then use it for lookups and even for listing sometimes. This is not correct, because you can make several connections to the same driver and changes, made in o

Re: [libvirt] [PATCHv2 5/5] network: add connections counter to networks

2012-08-14 Thread Laine Stump
On 08/14/2012 11:55 AM, Eric Blake wrote: > On 08/14/2012 01:10 AM, Laine Stump wrote: >> Just as each physical device used by a network has a connections >> counter, now each network has a connections counter which is >> incremented once for each guest interface that connects using this >> network

Re: [libvirt] [PATCH v2 1/2] Honour current sensitivity and category ranges in SELinux label generation

2012-08-14 Thread Eric Blake
On 08/14/2012 08:36 AM, Daniel P. Berrange wrote: > From: "Daniel P. Berrange" > > Currently the dynamic label generation code will create labels > with a sensitivity of s0, and a category pair in the range > 0-1023. This is fine when running a standard MCS policy because > libvirtd will run with

Re: [libvirt] stateless drivers and stored lists of virDomainObjs

2012-08-14 Thread Eric Blake
On 08/14/2012 10:59 AM, Dmitry Guryanov wrote: > Hello, > > vmware, openvz and parallels driver, which was written with first two ones > as an example, get list of domains in virConnectOpen and then use it for > lookups and even for listing sometimes. This is not correct, because you > can make se

Re: [libvirt] [PATCH v2 2/2] Add test case for SELinux label generation

2012-08-14 Thread Eric Blake
On 08/14/2012 08:36 AM, Daniel P. Berrange wrote: > From: "Daniel P. Berrange" > > This test case validates the correct generation of SELinux labels > for VMs, wrt the current process label. Since we can't actually > change the label of the test program process, we create a shared > library libse

[libvirt] [PATCH] maint: drop a leftover comment line

2012-08-14 Thread Eric Blake
* tests/viratomictest.c: Fix copy-and-paste bug. --- Pushing under the trivial rule. tests/viratomictest.c | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/viratomictest.c b/tests/viratomictest.c index 772fbfe..4250329 100644 --- a/tests/viratomictest.c +++ b/tests/viratomictest.c @@ -12

[libvirt] [PATCH] build: fix link error with appArmor

2012-08-14 Thread Eric Blake
Commit bb705e25 missed that the appArmor helper file also needs to resolve the new symbols dragged in by domain_conf.c. * src/Makefile.am (SECURITY_DRIVER_APPARMOR_HELPER_SOURCES): Pull in datatypes.c. --- Pushing under the build-breaker rule. src/Makefile.am | 1 + 1 file changed, 1 insertion(

Re: [libvirt] [PATCH 0/9] network: properly support openvswitch in

2012-08-14 Thread Ansis Atteka
On Mon, Aug 13, 2012 at 2:28 PM, Laine Stump wrote: > On 08/08/2012 09:35 PM, Kyle Mestery (kmestery) wrote: > > On Aug 8, 2012, at 7:06 PM, Ansis Atteka wrote: > >> On Wed, Aug 8, 2012 at 2:18 PM, Laine Stump wrote: > >> On 08/08/2012 03:43 PM, Ansis Atteka wrote: > >>> If I understand correctl

Re: [libvirt] [PATCH 0/9] network: properly support openvswitch in

2012-08-14 Thread Laine Stump
On 08/14/2012 02:39 PM, Ansis Atteka wrote: > > > On Mon, Aug 13, 2012 at 2:28 PM, Laine Stump > wrote: > > On 08/08/2012 09:35 PM, Kyle Mestery (kmestery) wrote: > > On Aug 8, 2012, at 7:06 PM, Ansis Atteka wrote: > >> On Wed, Aug 8, 2012 at 2:18 PM, Laine Stum

[libvirt] [firewalld PATCHv3] firewalld PATCH v3

2012-08-14 Thread Thomas Woerner
* configura.ac, spec file: firewalld now defaults to enabled, depends on dbus * fixed comment for with_firewalld define * bridge_driver, nwfilter_driver: new dbus filters to get FirewallD1.Reloaded signal and DBus.NameOwnerChanged on org.fedoraproject.FirewallD1 * iptables, ebtables, nwfilter_e

[libvirt] [PATCH] random: link with -lm when needed

2012-08-14 Thread Eric Blake
Use of ldexp() requires -lm on some platforms; use gnulib to determine this for our makefile. Also, optimize virRandomInt() for the case of a power-of-two limit (actually rather common, given that Daniel has a pending patch to replace virRandomBis(10) with code that will default to virRandomInt(10

Re: [libvirt] [PATCHv2 0/9] network: properly support openvswitch in

2012-08-14 Thread Laine Stump
On 08/14/2012 03:04 AM, Laine Stump wrote: > This patch series enhances the functionality of > elements, to allow omitting some attributes (and even the type), and > to merge the interface, network, and portgroup virtualports rather > than simply picking one. This not only makes openvswitch s > mo

Re: [libvirt] [PATCH] random: link with -lm when needed

2012-08-14 Thread Eric Blake
On 08/14/2012 01:44 PM, Eric Blake wrote: oops, hit send too soon > Use of ldexp() requires -lm on some platforms; use gnulib to determine > this for our makefile. Also, optimize virRandomInt() for the case > of a power-of-two limit (actually rather common, given that Daniel > has a pending patc

Re: [libvirt] [PATCH] random: link with -lm when needed

2012-08-14 Thread Laine Stump
On 08/14/2012 03:44 PM, Eric Blake wrote: > Use of ldexp() requires -lm on some platforms; use gnulib to determine > this for our makefile. Also, optimize virRandomInt() for the case > of a power-of-two limit (actually rather common, given that Daniel > has a pending patch to replace virRandomBis(

Re: [libvirt] [PATCH v3 2/5] Multiple security drivers in XML data

2012-08-14 Thread Marcelo Cerri
Hi Michal, Comments below. On 08/06/2012 10:30 AM, Michal Privoznik wrote: On 03.08.2012 16:18, Marcelo Cerri wrote: ... @@ -148,18 +148,32 @@ - - no - + + + + + +

Re: [libvirt] [PATCH v3 5/5] Update the remote API

2012-08-14 Thread Marcelo Cerri
Hi Michal, I'm updating the patch series, but I have a few questions below: On 08/06/2012 10:29 AM, Michal Privoznik wrote: On 03.08.2012 16:18, Marcelo Cerri wrote: ... +LIBVIRT_0.10.1{ +global: +virDomainGetSecurityLabelList; +} LIBVIRT_0.10.0; + Since 0.10.0 is not out yet,

Re: [libvirt] [PATCH] random: link with -lm when needed

2012-08-14 Thread Eric Blake
On 08/14/2012 02:02 PM, Laine Stump wrote: > On 08/14/2012 03:44 PM, Eric Blake wrote: >> Use of ldexp() requires -lm on some platforms; use gnulib to determine >> this for our makefile. Also, optimize virRandomInt() for the case >> of a power-of-two limit (actually rather common, given that Danie

Re: [libvirt] [PATCH v3 5/5] Update the remote API

2012-08-14 Thread Eric Blake
On 08/14/2012 02:19 PM, Marcelo Cerri wrote: > Hi Michal, > > I'm updating the patch series, but I have a few questions below: > > On 08/06/2012 10:29 AM, Michal Privoznik wrote: >> On 03.08.2012 16:18, Marcelo Cerri wrote: >>> ... >>> +LIBVIRT_0.10.1{ >>> +global: >>> +virDomainGet

[libvirt] [PATCH v11 2/7] qapi: Introduce add-fd, remove-fd, query-fdsets

2012-08-14 Thread Corey Bryant
This patch adds support that enables passing of file descriptors to the QEMU monitor where they will be stored in specified file descriptor sets. A file descriptor set can be used by a client like libvirt to store file descriptors for the same file. This allows the client to open a file with diff

[libvirt] [PATCH v11 7/7] monitor: Clean up fd sets on monitor disconnect

2012-08-14 Thread Corey Bryant
Fd sets are shared by all monitor connections. Fd sets are considered to be in use while at least one monitor is connected. When the last monitor disconnects, all fds that are members of an fd set with no outstanding dup references are closed. This prevents any fd leakage associated with a clien

[libvirt] [PATCH v11 4/7] block: Convert open calls to qemu_open

2012-08-14 Thread Corey Bryant
This patch converts all block layer open calls to qemu_open. Note that this adds the O_CLOEXEC flag to the changed open paths when the O_CLOEXEC macro is defined. Signed-off-by: Corey Bryant --- v2: -Convert calls to qemu_open instead of file_open (kw...@redhat.com) -Mention introduction of O_

[libvirt] [PATCH v11 0/7] file descriptor passing using fd sets

2012-08-14 Thread Corey Bryant
libvirt's sVirt security driver provides SELinux MAC isolation for Qemu guest processes and their corresponding image files. In other words, sVirt uses SELinux to prevent a QEMU process from opening files that do not belong to it. sVirt provides this support by labeling guests and resources with

[libvirt] [PATCH v11 5/7] block: Convert close calls to qemu_close

2012-08-14 Thread Corey Bryant
This patch converts all block layer close calls, that correspond to qemu_open calls, to qemu_close. Signed-off-by: Corey Bryant --- v5: -This patch is new in v5. (kw...@redhat.com, ebl...@redhat.com) v6-v9: -No changes v10: -Don't use underscore prefix on functions. (blauwir...@gmail.com) v

[libvirt] [PATCH v11 6/7] block: Enable qemu_open/close to work with fd sets

2012-08-14 Thread Corey Bryant
When qemu_open is passed a filename of the "/dev/fdset/nnn" format (where nnn is the fdset ID), an fd with matching access mode flags will be searched for within the specified monitor fd set. If the fd is found, a dup of the fd will be returned from qemu_open. Signed-off-by: Corey Bryant --- v2:

[libvirt] [PATCH v11 1/7] qemu-char: Add MSG_CMSG_CLOEXEC flag to recvmsg

2012-08-14 Thread Corey Bryant
Set the close-on-exec flag for the file descriptor received via SCM_RIGHTS. Signed-off-by: Corey Bryant --- v4 -This patch is new in v4 (ebl...@redhat.com) v5 -Fallback to FD_CLOEXEC if MSG_CMSG_CLOEXEC is not available (ebl...@redhat.com, stefa...@linux.vnet.ibm.com) v6 -Set cloexec on co

  1   2   >