[libvirt] [PATCH] Fix xmconfigtest

2014-06-19 Thread Jim Fehlig
Commit ac63014c introduced a regression in the conversion of Xen xm config to XML by emitting an empty cmdline. Prior to this commit, cmdline was omitted if the xm config was missing (or contained an empty) 'extra='. Signed-off-by: Jim Fehlig jfeh...@suse.com --- Pushing under the build breaker

Re: [libvirt] RFC: network interface tags vs. portgroups

2014-06-19 Thread Michal Privoznik
On 10.06.2014 12:01, Laine Stump wrote: A couple releases ago (commit 7d5bf484, first appeared in 1.2.2) I modified the domain interface status xml to show what resources are actually in use for an interface, superseding the interface config in the cases where they conflict with each other. In

Re: [libvirt] [PATCH libvirt] xen: handle root= in xen-xm configuration files.

2014-06-19 Thread Jim Fehlig
Eric Blake wrote: On 06/18/2014 11:46 AM, Jim Fehlig wrote: In addition to extra= xm supported a root= option which was supposed to be incorporated into the final command line. Handle that for virsh domxml-from-native xen-xm. Tested with the libxl backend. Signed-off-by: Ian Campbell

Re: [libvirt] [PATCH libvirt] xen: handle root= in xen-xm configuration files.

2014-06-19 Thread Jim Fehlig
Ian Campbell wrote: On Tue, 2014-06-17 at 16:24 +0100, Ian Campbell wrote: +if (xenXMConfigGetString(conf, extra, extra, NULL) 0) This was subtly broken. The default needs to be . Turns out, it wasn't :). Prior to this patch, def-os.cmdline was set to NULL if 'extra'

Re: [libvirt] [python PATCH 2/2] event-test: add missing events

2014-06-19 Thread Peter Krempa
On 06/19/14 00:44, Eric Blake wrote: Update the example to be able to trace all events. * examples/event-test.py (main): Match full list of domain events. (myDomainEventIOErrorReasonCallback) (myDomainEventControlErrorCallback) (myDomainEventBlockJobCallback, myDomainEventBlockJob2Callback)

Re: [libvirt] [python PATCH 1/2] blockjob: support new BLOCK_JOB_2 event

2014-06-19 Thread Peter Krempa
On 06/19/14 00:44, Eric Blake wrote: Libvirt 1.2.6 is introducing a new block job event that passes disk information by target device rather than host file name. At the python level, we are just a passthrough, so we can reuse all the existing code and just wire up the new enum value. *

Re: [libvirt] [PATCH v3] blockjob: use stable disk string in job event

2014-06-19 Thread Peter Krempa
On 06/19/14 00:41, Eric Blake wrote: When the block job event was first added, it was for block pull, where the active layer of the disk remains the same name. It was also in a day where we only cared about local files, and so we always had a canonical absolute file name. But two things have

Re: [libvirt] [PATCH V2 1/2] libxl: support interface type=network

2014-06-19 Thread Laine Stump
On 06/11/2014 12:25 AM, Jim Fehlig wrote: Add support for interface type='network' in the libxl driver. Signed-off-by: Jim Fehlig jfeh...@suse.com --- V2: Support both libvirt's traditional managed networks and libvirt networks that use an existing host bridge. src/libxl/libxl_conf.c |

Re: [libvirt] [PATCH V2 2/2] libxl: limit support for specifying an interface script

2014-06-19 Thread Laine Stump
On 06/11/2014 12:25 AM, Jim Fehlig wrote: Generally, interface ... script is only supported for type='ethernet'. Due to the long and pervasive use of interface type='bridge' ... script path='foo'/ /interface in Xen domain configuration, it was agreed to allow the use of

Re: [libvirt] [PATCH v3 1/5] blockjob: allow omitted arguments to QMP block-commit

2014-06-19 Thread Peter Krempa
On 06/19/14 01:22, Eric Blake wrote: We are about to turn on support for active block commit. Although qemu 2.0 was the first version to mostly support it, that version mis-handles 0-length files, and doesn't have anything available for easy probing. But qemu 2.1 fixed bugs, and made life

Re: [libvirt] [PATCH v3 2/5] blockjob: turn on qemu capability bit for active commit

2014-06-19 Thread Peter Krempa
On 06/19/14 01:22, Eric Blake wrote: Use the probing functionality added in the last patch to turn on a capability bit when active commit is present, and gate active commit on that capability. While at it, leave a few more bread-crumbs about what blockjob sync/async means, and enforce that

Re: [libvirt] [PATCH v3 3/5] virsh: expose new active commit controls

2014-06-19 Thread Peter Krempa
On 06/19/14 01:22, Eric Blake wrote: Add knobs to virsh to manage a 2-phase active commit of the top layer, similar to knobs already present on blockcopy. While this code will fail until later patches actually implement the new knobs in the qemu driver, doing it now proves that the API is

Re: [libvirt] [python PATCH] build: provide wrapper makefile

2014-06-19 Thread Michal Privoznik
On 18.06.2014 21:21, Eric Blake wrote: After years of finger training, I'm so used to 'make check' just working, that I lose quite a bit of time re-learning that in this project, it is spelled 'python setup.py build check'. A shim makefile bridges the gap. Same applies here. * Makefile:

Re: [libvirt] [PATCH v3 4/5] blockcommit: track job type in xml

2014-06-19 Thread Peter Krempa
On 06/19/14 01:22, Eric Blake wrote: A future patch is going to wire up qemu active block commit jobs; but as they have similar events and are canceled/pivoted in the same way as block copy jobs, it is easiest to track all bookkeeping for the commit job by reusing the mirror element. This

[libvirt] [PATCH 1/2] conf: only accept capabilities mode hostdev in LXC.

2014-06-19 Thread Jincheng Miao
hostdev has mode capabilities for LXC, from formatdomain.html: Block / character devices from the host can be passed through to the guest using the hostdev element. This is only possible with container based virtualization. since after 1.0.1 for LXC So forbid capabilities mode hostdev if domain

[libvirt] [PATCH 2/2] docs: fix some typos in formatdomain.html

2014-06-19 Thread Jincheng Miao
In section Block / character devices of Host device assignment, the description of hostdev element has some error: For a block device, the type should be storage, not block; For a character device, the type should be misc, not char. Signed-off-by: Jincheng Miao jm...@redhat.com ---

[libvirt] [PATCH 0/2] enhance capabilities mode hostdev process

2014-06-19 Thread Jincheng Miao
hostdev has mode capabilities for LXC, from formatdomain.html: Block / character devices from the host can be passed through to the guest using the hostdev element. This is only possible with container based virtualization. since after 1.0.1 for LXC So forbid capabilities mode hostdev if domain

Re: [libvirt] [PATCH v3 5/5] blockcommit: turn on active commit

2014-06-19 Thread Peter Krempa
On 06/19/14 01:22, Eric Blake wrote: With this in place, I can (finally!) now do: virsh blockcommit $dom vda --shallow --verbose --pivot and watch qemu shorten the backing chain by one, followed by libvirt automatically updating the dumpxml output, effectively undoing the work of virsh

Re: [libvirt] [PATCH 1/2] conf: only accept capabilities mode hostdev in LXC.

2014-06-19 Thread Daniel P. Berrange
On Thu, Jun 19, 2014 at 05:45:12PM +0800, Jincheng Miao wrote: hostdev has mode capabilities for LXC, from formatdomain.html: Block / character devices from the host can be passed through to the guest using the hostdev element. This is only possible with container based virtualization.

Re: [libvirt] [PATCH 1/2] conf: only accept capabilities mode hostdev in LXC.

2014-06-19 Thread Jincheng Miao
- Original Message - No, the parser code is not supposed to do semantic validation like this. This kind of check should be done exclusively in the driver code which forms the command line args for the hypervisors which don't support it. Oh, I just understand why there is no hypervisor

[libvirt] [PATCH 0/5] interface: clean up some things I noticed

2014-06-19 Thread Laine Stump
These clean up several issues I noticed when revisiting the interface parsing/formatting code as a result of Michal's addition of the link element. Laine Stump (5): interface: allow reordering of elements in xml interface: report link state for bonds and vlans too interface: move parsing of

[libvirt] [PATCH 4/5] interface: clean up virInterfaceDefParseXML

2014-06-19 Thread Laine Stump
the switch cases for the 4 different interface types had repetitive code which has now been pulled out as common. While touching those lines, some extra usage of != NULL etc has been eliminated to make things more compact and inline with current coding practices. NB: parentIfType ==

[libvirt] [PATCH 5/5] interface: clean up virInterfaceDefDevFormat

2014-06-19 Thread Laine Stump
This modifies the formatting function of virInterface to be a proper mirror of the parse function, including the addition of a parentIfType arg so that we can decide whether or not it is appropriate to emit the elements that are only in toplevel interfaces, as well as the link element (which isn't

[libvirt] [PATCH 1/5] interface: allow reordering of elements in xml

2014-06-19 Thread Laine Stump
The interface xml schema was written with strict rules about the ordering of the elements. This was never intentional, but just due to omission of interleave in the appropriate places. This patch just adds in interleave wherever there is more than one element, and re-indents everything else

[libvirt] [PATCH 3/5] interface: move parsing of bridge attributes into appropriate function

2014-06-19 Thread Laine Stump
For some reason the bridge stp mode and delay were put directly into the bridge case of the switch in virInterfaceDefParseXML(), although they are inside the bridge element, and so should be parsed in the function created for that purpose - virInterfaceBridgeDefFormat(). ---

[libvirt] [PATCH 2/5] interface: report link state for bonds and vlans too

2014-06-19 Thread Laine Stump
The interface state for bonds and vlans does seem to reflect the state of the underlying physical devices, at least in some cases, so it makes sense to allow reporting it (netcf now does). The link state/speed for bridge devices is meaningless though, so we don't even look for it. ---

Re: [libvirt] [PATCH v2 1/7] virnuma: Introduce virNumaNodeIsAvailable

2014-06-19 Thread Daniel P. Berrange
On Mon, Jun 16, 2014 at 05:08:24PM +0200, Michal Privoznik wrote: Not on all hosts the set of NUMA nodes IDs is continuous. This is critical, because our code currently assumes the set doesn't contain holes. For instance in nodeGetFreeMemory() we can see the following pattern: if

Re: [libvirt] [PATCH v2 2/7] nodeinfo: Rename nodeGetFreeMemory to nodeGetMemory

2014-06-19 Thread Daniel P. Berrange
On Mon, Jun 16, 2014 at 05:08:25PM +0200, Michal Privoznik wrote: For future work we want to info for not only the free memory but I presume you mean s/to info/to get info/ overall memory size too. That's why the function must have new signature too. Signed-off-by: Michal Privoznik

Re: [libvirt] [PATCH] qemu: parse -device virtio-balloon

2014-06-19 Thread Laine Stump
Ping? The meat of this is very small - most of the lines are just changes to test data. On 06/09/2014 01:29 PM, Laine Stump wrote: There are no options to parse here, and all three possible device names have the same prefix (virtio-balloon with -ccw, -pci, or -device appended), so it is

[libvirt] [PATCH V2 0/2] enhance capabilities mode hostdev process

2014-06-19 Thread Jincheng Miao
hostdev has mode capabilities for LXC, from formatdomain.html: Block / character devices from the host can be passed through to the guest using the hostdev element. This is only possible with container based virtualization. since after 1.0.1 for LXC So forbid capabilities mode hostdev if domain

[libvirt] [PATCH V2 1/2] qemu: forbid define a capabilities mode hostdev

2014-06-19 Thread Jincheng Miao
hostdev has mode capabilities for LXC, from formatdomain.html: Block / character devices from the host can be passed through to the guest using the hostdev element. This is only possible with container based virtualization. since after 1.0.1 for LXC So forbid capabilities mode hostdev if domain

[libvirt] [PATCH V2 2/2] docs: fix some typos in formatdomain.html

2014-06-19 Thread Jincheng Miao
In section Block / character devices of Host device assignment, the description of hostdev element has some error: For a block device, the type should be storage, not block; For a character device, the type should be misc, not char. Signed-off-by: Jincheng Miao jm...@redhat.com ---

Re: [libvirt] [PATCH v2 3/7] virnuma: Introduce pages helpers

2014-06-19 Thread Daniel P. Berrange
On Mon, Jun 16, 2014 at 05:08:26PM +0200, Michal Privoznik wrote: For future work we need two functions that fetches total number of pages and number of free pages for given NUMA node and page size (virNumaGetPageInfo()). Then we need to learn pages of what sizes are supported on given node

Re: [libvirt] [PATCH v2 4/7] virCaps: expose pages info

2014-06-19 Thread Daniel P. Berrange
On Mon, Jun 16, 2014 at 05:08:27PM +0200, Michal Privoznik wrote: There are two places where you'll find info on page sizes. The first one is under cpu/ element, where all supported pages sizes are listed. Then the second one is under each cell/ element which refers to concrete NUMA node. At

Re: [libvirt] [PATCH v2 5/7] Introduce virNodeGetFreePages

2014-06-19 Thread Daniel P. Berrange
On Mon, Jun 16, 2014 at 05:08:28PM +0200, Michal Privoznik wrote: The aim of the API is to get information on number of free pages on the system. The API behaves similar to the virNodeGetCellsFreeMemory(). User passes starting NUMA cell, the count of nodes that he's interested in, pages sizes

Re: [libvirt] [PATCH v2 6/7] virsh: Expose virNodeGetFreePages

2014-06-19 Thread Daniel P. Berrange
On Mon, Jun 16, 2014 at 05:08:29PM +0200, Michal Privoznik wrote: The new API is exposed under 'freepages' command. Signed-off-by: Michal Privoznik mpriv...@redhat.com --- tools/virsh-host.c | 167 + tools/virsh.pod| 8 +++ 2

Re: [libvirt] [PATCH v2 7/7] nodeinfo: Implement nodeGetFreePages

2014-06-19 Thread Daniel P. Berrange
On Mon, Jun 16, 2014 at 05:08:30PM +0200, Michal Privoznik wrote: And add stubs to other drivers like: lxc, qemu, uml and vbox. Signed-off-by: Michal Privoznik mpriv...@redhat.com --- src/libvirt_private.syms | 1 + src/lxc/lxc_driver.c | 19 +++ src/nodeinfo.c

Re: [libvirt] [PATCH v2 3/7] virnuma: Introduce pages helpers

2014-06-19 Thread Daniel P. Berrange
On Thu, Jun 19, 2014 at 12:06:44PM +0100, Daniel P. Berrange wrote: On Mon, Jun 16, 2014 at 05:08:26PM +0200, Michal Privoznik wrote: +int +virNumaGetPageInfo(int node, + unsigned int page_size, + unsigned int *page_avail, + unsigned

Re: [libvirt] [PATCH V2 1/2] qemu: forbid define a capabilities mode hostdev

2014-06-19 Thread Peter Krempa
On 06/19/14 13:05, Jincheng Miao wrote: hostdev has mode capabilities for LXC, from formatdomain.html: Block / character devices from the host can be passed through to the guest using the hostdev element. This is only possible with container based virtualization. since after 1.0.1 for LXC

Re: [libvirt] [PATCH v3] blockjob: use stable disk string in job event

2014-06-19 Thread Eric Blake
On 06/19/2014 02:32 AM, Peter Krempa wrote: On 06/19/14 00:41, Eric Blake wrote: When the block job event was first added, it was for block pull, where the active layer of the disk remains the same name. It was also in a day where we only cared about local files, and so we always had a

Re: [libvirt] [python PATCH] build: provide wrapper makefile

2014-06-19 Thread Eric Blake
On 06/19/2014 03:40 AM, Michal Privoznik wrote: On 18.06.2014 21:21, Eric Blake wrote: After years of finger training, I'm so used to 'make check' just working, that I lose quite a bit of time re-learning that in this project, it is spelled 'python setup.py build check'. A shim makefile

Re: [libvirt] [PATCH v3 3/5] virsh: expose new active commit controls

2014-06-19 Thread Eric Blake
On 06/19/2014 03:28 AM, Peter Krempa wrote: On 06/19/14 01:22, Eric Blake wrote: Add knobs to virsh to manage a 2-phase active commit of the top layer, similar to knobs already present on blockcopy. While this code will fail until later patches actually implement the new knobs in the qemu

Re: [libvirt] [PATCH v2 0/7] Expose host's huge pages capability

2014-06-19 Thread Michal Privoznik
On 16.06.2014 17:08, Michal Privoznik wrote: diff to v1: - Expose all page size not only huge ones Michal Privoznik (7): virnuma: Introduce virNumaNodeIsAvailable nodeinfo: Rename nodeGetFreeMemory to nodeGetMemory virnuma: Introduce pages helpers virCaps: expose pages info

Re: [libvirt] [PATCH v2 3/7] virnuma: Introduce pages helpers

2014-06-19 Thread Michal Privoznik
On 19.06.2014 13:14, Daniel P. Berrange wrote: On Thu, Jun 19, 2014 at 12:06:44PM +0100, Daniel P. Berrange wrote: On Mon, Jun 16, 2014 at 05:08:26PM +0200, Michal Privoznik wrote: +int +virNumaGetPageInfo(int node, + unsigned int page_size, + unsigned int

Re: [libvirt] [PATCH v2 4/7] virCaps: expose pages info

2014-06-19 Thread Michal Privoznik
On 19.06.2014 13:08, Daniel P. Berrange wrote: On Mon, Jun 16, 2014 at 05:08:27PM +0200, Michal Privoznik wrote: There are two places where you'll find info on page sizes. The first one is under cpu/ element, where all supported pages sizes are listed. Then the second one is under each cell/

Re: [libvirt] [PATCH v2 3/7] virnuma: Introduce pages helpers

2014-06-19 Thread Eric Blake
On 06/19/2014 07:14 AM, Michal Privoznik wrote: +#else +virReportError(VIR_ERR_ARGUMENT_UNSUPPORTED, %s, + _(system page size are not supported yet)); s/are/is/ -- Eric Blake eblake redhat com+1-919-301-3266 Libvirt virtualization library

Re: [libvirt] [PATCH python] Correct virDomainMigrateToURI3 definition

2014-06-19 Thread Eric Blake
On 06/05/2014 09:43 AM, Jason Andryuk wrote: dconnuri is a string, so update the definition to match. Without this, the generated python would fail when passed a string. --- libvirt-override-api.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[libvirt] [PATCH 00/10] Work In Progress: Refactor dealing with disk source data

2014-06-19 Thread Peter Krempa
This is a work in progress snapshot of my current state to get rid of a few very ugly places where we deal with storage source information while labelling images. The goal of this series will be to get rid of the ugly places and additionally fix problem when block-copying a networked disk which

[libvirt] [PATCH 05/10] util: storagefile: Add deep copy for struct virStorageSource

2014-06-19 Thread Peter Krempa
Now that we have pointers to store disk source information and thus can easily exchange the structs behind we need a function to copy all the data. --- src/libvirt_private.syms | 1 + src/util/virstoragefile.c | 143 ++ src/util/virstoragefile.h |

[libvirt] [PATCH 02/10] util: seclabel: Add deep copy function for device labels

2014-06-19 Thread Peter Krempa
--- src/util/virseclabel.c | 23 +++ src/util/virseclabel.h | 6 +- 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/src/util/virseclabel.c b/src/util/virseclabel.c index 5a4d78e..8f07de3 100644 --- a/src/util/virseclabel.c +++ b/src/util/virseclabel.c @@

[libvirt] [PATCH 03/10] util: storagefile: Introduce helper to free storage source perms

2014-06-19 Thread Peter Krempa
It will also be reused later. --- src/util/virstoragefile.c | 16 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/util/virstoragefile.c b/src/util/virstoragefile.c index 09b5d10..a23ac6a 100644 --- a/src/util/virstoragefile.c +++ b/src/util/virstoragefile.c @@

[libvirt] [PATCH 04/10] util: storagesource: Add helper to copy and free storage source seclabels

2014-06-19 Thread Peter Krempa
They will be reused to transfer disk labels from snapshotted disks to the new disk definitions. --- src/libvirt_private.syms | 1 + src/util/virstoragefile.c | 43 --- src/util/virstoragefile.h | 3 +++ 3 files changed, 40 insertions(+), 7 deletions(-)

[libvirt] [PATCH 08/10] security: Sanitize type of @migrated in virSecurityManagerRestoreAllLabel

2014-06-19 Thread Peter Krempa
Also remove one spurious ATTRIBUTE_UNUSED guarding the @migrated argument. --- src/qemu/qemu_process.c | 2 +- src/security/security_apparmor.c | 2 +- src/security/security_dac.c | 6 +++--- src/security/security_driver.h | 2 +- src/security/security_manager.c | 2 +-

[libvirt] [PATCH 07/10] util: Don't require full disk definition when getting imagelabels

2014-06-19 Thread Peter Krempa
The image labels are stored in the virStorageSource struct. Convert the virDomainDiskDefGetSecurityLabelDef helper not to use the full disk def and move it appropriately. --- src/conf/domain_conf.c | 14 -- src/conf/domain_conf.h | 3 --- src/libvirt_private.syms

[libvirt] [PATCH RFCv2 10/10] qemu: snapshot: Improve approach to deal with snapshot metadata

2014-06-19 Thread Peter Krempa
Until now we were changing information about the disk source via multiple steps of copying data. Now that we changed to a pointer to store the disk source we might use it to change the approach to track the data. Additionally this will allow proper tracking of the backing chain. --- Now the

[libvirt] [PATCH 06/10] qemu: cgroup: Add functions to set cgroup image stuff on individual imgs

2014-06-19 Thread Peter Krempa
Add functions that will allow to set all the required cgroup stuff on individual images taking a virStorageSourcePtr. Also convert functions designed to setup whole backing chain to take advantage of the chagne. --- src/qemu/qemu_cgroup.c | 92 +++---

[libvirt] [PATCH 09/10] security: Rename virSecurityManagerSetImageLabel to *Disk*

2014-06-19 Thread Peter Krempa
I'm going to add functions that will deal with individual image files rather than whole disks. Rename the security function to make room for the new one. --- src/libvirt_private.syms | 2 +- src/lxc/lxc_controller.c | 2 +- src/lxc/lxc_driver.c | 4 ++--

[libvirt] [PATCH 01/10] storage: encryption: Add deep copy function for storage encryption

2014-06-19 Thread Peter Krempa
--- src/util/virstorageencryption.c | 40 src/util/virstorageencryption.h | 3 +++ 2 files changed, 43 insertions(+) diff --git a/src/util/virstorageencryption.c b/src/util/virstorageencryption.c index 1306490..5a401b7 100644 ---

Re: [libvirt] [PATCH 2/2] docs: fix some typos in formatdomain.html

2014-06-19 Thread Eric Blake
On 06/19/2014 03:45 AM, Jincheng Miao wrote: In section Block / character devices of Host device assignment, the description of hostdev element has some error: For a block device, the type should be storage, not block; For a character device, the type should be misc, not char.

Re: [libvirt] [PATCH 1/5] interface: allow reordering of elements in xml

2014-06-19 Thread Eric Blake
On 06/19/2014 04:48 AM, Laine Stump wrote: The interface xml schema was written with strict rules about the ordering of the elements. This was never intentional, but just due to omission of interleave in the appropriate places. This patch just adds in interleave wherever there is more than one

[libvirt] [PATCHv5 02/19] util: storagefile: Introduce universal function to canonicalize paths

2014-06-19 Thread Peter Krempa
Introduce a common function that will take a callback to resolve links that will be used to canonicalize paths on various storage systems and add extensive tests. --- src/libvirt_private.syms | 1 + src/util/virstoragefile.c | 195 ++

[libvirt] [PATCHv5 00/19] block pull/commit on gluster volumes with relative backing

2014-06-19 Thread Peter Krempa
This version is based on Eric's [PATCH v3 0/5] Next round of active commit support. Otherwise I've fixed a few nits and just rebased it on top of the said series. Peter Krempa (19): util: string: Add helper to free non-NULL terminated string arrays util: storagefile: Introduce universal

[libvirt] [PATCHv5 05/19] tests: virstoragetest: Remove expBackingStore field

2014-06-19 Thread Peter Krempa
Now that we changed ordering of the stored metadata so that the backing store is described by the child element the test should reflect this change too. Remove the expected backing store field as it's actually described by the next element in the backing chain, so there's no need for duplication.

[libvirt] [PATCHv5 01/19] util: string: Add helper to free non-NULL terminated string arrays

2014-06-19 Thread Peter Krempa
Sometimes the length of the string list is known but the array isn't NULL terminated. Add helper to free the array in such cases. --- src/libvirt_private.syms | 1 + src/util/virstring.c | 20 src/util/virstring.h | 1 + 3 files changed, 22 insertions(+) diff --git

[libvirt] [PATCHv5 04/19] util: storage: Add helper to resolve relative path difference

2014-06-19 Thread Peter Krempa
This patch introduces a function that will allow us to resolve a relative difference between two elements of a disk backing chain. This fucntion will be used to allow relative block commit and block pull where we need to specify the new relative name of the image to qemu. This patch also adds

[libvirt] [PATCHv5 08/19] util: storage: Remove now redundant backingRelative from virStorageSource

2014-06-19 Thread Peter Krempa
Now that we store only relative names in virStorageSource's member relPath the backingRelative member is obsolete. Remove it and adapt the code to the removal. --- src/util/virstoragefile.c | 4 +--- src/util/virstoragefile.h | 2 -- tests/virstoragetest.c| 8 +--- 3 files changed, 2

[libvirt] [PATCHv5 03/19] storage: gluster: Add backend to return unique storage file path

2014-06-19 Thread Peter Krempa
Use virStorageFileSimplifyPathInternal to canonicalize gluster paths via a callback and use it for the unique volume path retrieval API. --- src/storage/storage_backend_gluster.c | 80 +++ 1 file changed, 80 insertions(+) diff --git

[libvirt] [PATCHv5 07/19] tests: virstoragetest: Remove now unused pathAbs

2014-06-19 Thread Peter Krempa
Separately remove the now unused variable. --- tests/virstoragetest.c | 15 --- 1 file changed, 15 deletions(-) diff --git a/tests/virstoragetest.c b/tests/virstoragetest.c index e2a06f2..2fd5459 100644 --- a/tests/virstoragetest.c +++ b/tests/virstoragetest.c @@ -283,7 +283,6 @@

[libvirt] [PATCHv5 06/19] storage: Store relative path only for relatively backed storage

2014-06-19 Thread Peter Krempa
Due to various refactors and compatibility with the virstoragetest the relPath field of the virStorageSource structure was always filled either with the relative name or the full path in case of abslutely backed storage. Return it's original purpose to store only the relative name of the disk if

[libvirt] [PATCHv5 16/19] lib: Introduce flag VIR_DOMAIN_BLOCK_COMMIT_RELATIVE

2014-06-19 Thread Peter Krempa
Introduce flag for the block commit API to allow the commit operation to leave the chain relatively addressed. Also adds a virsh switch to enable this behavior. --- include/libvirt/libvirt.h.in | 4 src/libvirt.c| 5 + tools/virsh-domain.c | 7 +++

[libvirt] [PATCHv5 11/19] storage: Don't canonicalize paths unnecessarily

2014-06-19 Thread Peter Krempa
Store backing chain paths as non-canonical. The canonicalization step will be already taken. This will allow to avoid storing unnecessary amounts of data. --- src/util/virstoragefile.c | 33 ++--- tests/virstoragetest.c| 10 +- 2 files changed, 11

[libvirt] [PATCHv5 13/19] qemu: caps: Add capability for change-backing-file command

2014-06-19 Thread Peter Krempa
This command allows to change the backing file name recorded in the metadata of a qcow (or other) image. The capability also notifies that the block-stream and block-commit commands understand the backing-file attribute. --- src/qemu/qemu_capabilities.c | 2 ++ src/qemu/qemu_capabilities.h | 1 +

[libvirt] [PATCHv5 15/19] qemu: monitor: Add support for backing name specification for block-stream

2014-06-19 Thread Peter Krempa
To allow changing the name that is recorded in the top of the current image chain used in a block pull/rebase operation, we need to specify the backing name to qemu. This is done via the backing-file attribute to the block-stream commad. --- src/qemu/qemu_driver.c | 8

[libvirt] [PATCHv5 12/19] storage: Don't store parent directory of an image explicitly

2014-06-19 Thread Peter Krempa
The parent directory doesn't necessarily need to be stored after we don't mangle the path stored in the image. Remove it and tweak the code to avoid using it. --- src/storage/storage_driver.c | 11 ++- src/util/virstoragefile.c| 68 ++--

[libvirt] [PATCHv5 17/19] lib: Introduce flag VIR_DOMAIN_BLOCK_REBASE_RELATIVE

2014-06-19 Thread Peter Krempa
Introduce flag for the block rebase API to allow the rebase operation to leave the chain relatively addressed. Also adds a virsh switch to enable this behavior. --- include/libvirt/libvirt.h.in | 2 ++ src/libvirt.c| 5 + tools/virsh-domain.c | 22

[libvirt] [PATCHv5 14/19] qemu: monitor: Add argument for specifying backing name for block commit

2014-06-19 Thread Peter Krempa
To allow changing the name that is recorded in the overlay of the TOP image used in a block commit operation, we need to specify the backing name to qemu. This is done via the backing-file attribute to the block-commit command. --- src/qemu/qemu_capabilities.c | 2 +- src/qemu/qemu_driver.c

[libvirt] [PATCHv5 10/19] tests: virstoragetest: Remove unneeded relative test plumbing

2014-06-19 Thread Peter Krempa
After we don't test relative paths, remove even more unnecessary cruft from the test code. --- tests/virstoragetest.c | 61 +++--- 1 file changed, 18 insertions(+), 43 deletions(-) diff --git a/tests/virstoragetest.c b/tests/virstoragetest.c index

[libvirt] [PATCHv5 09/19] tests: virstoragetest: Don't test relative start of backing chains

2014-06-19 Thread Peter Krempa
libvirt always uses an absolute path to address the top image of an image chain. Our storage test tests also the relative path which won't ever be used. Additionally it makes the test more complicated. --- tests/virstoragetest.c | 79 +- 1 file

[libvirt] [PATCHv5 18/19] qemu: Add support for networked disks for block commit

2014-06-19 Thread Peter Krempa
Now that we are able to select images from the backing chain via indexed access we should also convert possible network sources to qemu-compatible strings before passing them to qemu. --- src/qemu/qemu_driver.c | 39 ++- 1 file changed, 34 insertions(+), 5

[libvirt] [PATCHv5 19/19] qemu: Add support for networked disks for block pull/block rebase

2014-06-19 Thread Peter Krempa
Now that we are able to select images from the backing chain via indexed access we should also convert possible network sources to qemu-compatible strings before passing them to qemu. --- src/qemu/qemu_driver.c | 45 + 1 file changed, 41 insertions(+),

[libvirt] [PATCH] Fix cast error in virsh-host.c

2014-06-19 Thread Roman Bogorodskiy
Build with clang fails on virsh-host.c: virsh-host.c:323:53: error: cast from 'unsigned int *' to 'unsigned long long *' increases required alignment from 4 to 8 [-Werror,-Wcast-align] if (vshCommandOptScaledInt(cmd, pagesize, (unsigned long long *) pagesize, Fix that by casting

Re: [libvirt] [PATCH 2/5] interface: report link state for bonds and vlans too

2014-06-19 Thread Eric Blake
On 06/19/2014 04:48 AM, Laine Stump wrote: The interface state for bonds and vlans does seem to reflect the state of the underlying physical devices, at least in some cases, so it makes sense to allow reporting it (netcf now does). The link state/speed for bridge devices is meaningless

Re: [libvirt] [PATCH] Fix cast error in virsh-host.c

2014-06-19 Thread Eric Blake
On 06/19/2014 08:42 AM, Roman Bogorodskiy wrote: Build with clang fails on virsh-host.c: virsh-host.c:323:53: error: cast from 'unsigned int *' to 'unsigned long long *' increases required alignment from 4 to 8 [-Werror,-Wcast-align] if (vshCommandOptScaledInt(cmd, pagesize,

Re: [libvirt] [PATCH v2 6/7] virsh: Expose virNodeGetFreePages

2014-06-19 Thread Eric Blake
On 06/16/2014 09:08 AM, Michal Privoznik wrote: The new API is exposed under 'freepages' command. Signed-off-by: Michal Privoznik mpriv...@redhat.com --- tools/virsh-host.c | 167 + tools/virsh.pod| 8 +++ 2 files changed, 175

[libvirt] [PATCH v2] virsh: fix broken code in freepages

2014-06-19 Thread Eric Blake
Commit 9e3efe53 broke the build under valgrind or clang, by writing 8 bytes through an allocation of 4 bytes. It also risks multiplication overflow when mallocing (that's a pervasive problem that needs an audit in the rest of the code, but we might as well fix this one while we are here), and had

Re: [libvirt] [PATCH V2 1/2] qemu: forbid define a capabilities mode hostdev

2014-06-19 Thread Jincheng Miao
- Original Message - On 06/19/14 13:05, Jincheng Miao wrote: hostdev has mode capabilities for LXC, from formatdomain.html: Block / character devices from the host can be passed through to the guest using the hostdev element. This is only possible with container based

[libvirt] [PATCH V3] enhance capabilities mode hostdev process

2014-06-19 Thread Jincheng Miao
hostdev has mode capabilities for LXC, from formatdomain.html: Block / character devices from the host can be passed through to the guest using the hostdev element. This is only possible with container based virtualization. since after 1.0.1 for LXC So forbid capabilities mode hostdev if domain

Re: [libvirt] [PATCH 02/10] util: seclabel: Add deep copy function for device labels

2014-06-19 Thread Eric Blake
On 06/19/2014 07:46 AM, Peter Krempa wrote: --- src/util/virseclabel.c | 23 +++ src/util/virseclabel.h | 6 +- 2 files changed, 28 insertions(+), 1 deletion(-) ACK. -- Eric Blake eblake redhat com+1-919-301-3266 Libvirt virtualization library

Re: [libvirt] [PATCH 01/10] storage: encryption: Add deep copy function for storage encryption

2014-06-19 Thread Eric Blake
On 06/19/2014 07:46 AM, Peter Krempa wrote: --- src/util/virstorageencryption.c | 40 src/util/virstorageencryption.h | 3 +++ 2 files changed, 43 insertions(+) ACK. While the overall series might not be in a polished shape yet, you may want to

Re: [libvirt] [PATCH 03/10] util: storagefile: Introduce helper to free storage source perms

2014-06-19 Thread Eric Blake
On 06/19/2014 07:46 AM, Peter Krempa wrote: It will also be reused later. --- src/util/virstoragefile.c | 16 1 file changed, 12 insertions(+), 4 deletions(-) ACK. -- Eric Blake eblake redhat com+1-919-301-3266 Libvirt virtualization library http://libvirt.org

Re: [libvirt] [PATCH 04/10] util: storagesource: Add helper to copy and free storage source seclabels

2014-06-19 Thread Eric Blake
On 06/19/2014 07:46 AM, Peter Krempa wrote: They will be reused to transfer disk labels from snapshotted disks to the new disk definitions. --- src/libvirt_private.syms | 1 + src/util/virstoragefile.c | 43 --- src/util/virstoragefile.h | 3 +++

Re: [libvirt] [PATCH 04/10] util: storagesource: Add helper to copy and free storage source seclabels

2014-06-19 Thread Eric Blake
On 06/19/2014 07:46 AM, Peter Krempa wrote: They will be reused to transfer disk labels from snapshotted disks to the new disk definitions. --- src/libvirt_private.syms | 1 + src/util/virstoragefile.c | 43 --- src/util/virstoragefile.h | 3 +++

Re: [libvirt] [PATCH 03/10] util: storagefile: Introduce helper to free storage source perms

2014-06-19 Thread John Ferlan
On 06/19/2014 09:46 AM, Peter Krempa wrote: It will also be reused later. --- src/util/virstoragefile.c | 16 1 file changed, 12 insertions(+), 4 deletions(-) Why is it that patches 1-3 do not update libvirt_private.syms to add new src/util/vir* APIs, but some of the

Re: [libvirt] [PATCH 05/10] util: storagefile: Add deep copy for struct virStorageSource

2014-06-19 Thread Eric Blake
On 06/19/2014 07:46 AM, Peter Krempa wrote: Now that we have pointers to store disk source information and thus can easily exchange the structs behind we need a function to copy all the data. --- src/libvirt_private.syms | 1 + src/util/virstoragefile.c | 143

Re: [libvirt] [PATCH 06/10] qemu: cgroup: Add functions to set cgroup image stuff on individual imgs

2014-06-19 Thread Eric Blake
On 06/19/2014 07:46 AM, Peter Krempa wrote: Add functions that will allow to set all the required cgroup stuff on s/to set/setting/ individual images taking a virStorageSourcePtr. Also convert functions s/taking/by taking/ designed to setup whole backing chain to take advantage of the

Re: [libvirt] [PATCH 07/10] util: Don't require full disk definition when getting imagelabels

2014-06-19 Thread Eric Blake
On 06/19/2014 07:46 AM, Peter Krempa wrote: The image labels are stored in the virStorageSource struct. Convert the virDomainDiskDefGetSecurityLabelDef helper not to use the full disk def and move it appropriately. --- src/conf/domain_conf.c | 14 --

Re: [libvirt] [PATCH 08/10] security: Sanitize type of @migrated in virSecurityManagerRestoreAllLabel

2014-06-19 Thread Eric Blake
On 06/19/2014 07:46 AM, Peter Krempa wrote: Also remove one spurious ATTRIBUTE_UNUSED guarding the @migrated argument. --- src/qemu/qemu_process.c | 2 +- src/security/security_apparmor.c | 2 +- src/security/security_dac.c | 6 +++--- src/security/security_driver.h | 2 +-

Re: [libvirt] [PATCH 09/10] security: Rename virSecurityManagerSetImageLabel to *Disk*

2014-06-19 Thread Eric Blake
On 06/19/2014 07:46 AM, Peter Krempa wrote: I'm going to add functions that will deal with individual image files rather than whole disks. Rename the security function to make room for the new one. --- src/libvirt_private.syms | 2 +- src/lxc/lxc_controller.c | 2 +-

Re: [libvirt] [PATCH RFCv2 10/10] qemu: snapshot: Improve approach to deal with snapshot metadata

2014-06-19 Thread Eric Blake
On 06/19/2014 07:46 AM, Peter Krempa wrote: Until now we were changing information about the disk source via multiple steps of copying data. Now that we changed to a pointer to store the disk source we might use it to change the approach to track the data. Additionally this will allow

Re: [libvirt] [PATCH V2 1/2] libxl: support interface type=network

2014-06-19 Thread Jim Fehlig
Laine Stump wrote: On 06/11/2014 12:25 AM, Jim Fehlig wrote: Add support for interface type='network' in the libxl driver. Signed-off-by: Jim Fehlig jfeh...@suse.com --- V2: Support both libvirt's traditional managed networks and libvirt networks that use an existing host bridge.

  1   2   >