[libvirt] [PATCH RESEND 0/4] Pre-create storage on live migration

2013-09-12 Thread Michal Privoznik
[Resending due to some list difficulties] Currently users are required to pre-create storage on their own upon migration. This patch set implements the feature for RAW, QCOW and QCOW2 images. While for the RAW fallocate() is used (so we are guaranteed subsequent write() won't fail with ENOSPC, for

[libvirt] [PATCH RESEND 1/4] qemu: Expose file opening functions

2013-09-12 Thread Michal Privoznik
The qemuOpenFileAs and qemuOpenFile functions are gonna be needed in later patches. However, they are static now. Signed-off-by: Michal Privoznik --- src/qemu/qemu_domain.c | 146 ++ src/qemu/qemu_domain.h | 10 src/qemu/qemu_driver.c | 155 -

Re: [libvirt] [RESEND][PATCHv5 0/4] write separate module for hostdev passthrough

2013-09-12 Thread Chunyan Liu
2013/9/12 Eric Blake > On 09/11/2013 09:25 PM, Chunyan Liu wrote: > > [rebased to latest libvirt code for applying and reviewing the patches] > > > > These patches implements a separate module for hostdev passthrough so > that it > > could be shared by different drivers and can maintain a global

[libvirt] [RESEND][PATCHv5 4/4] change lxc driver to use hostdev common library

2013-09-12 Thread Chunyan Liu
Change lxc driver to use hostdev common library instead of its own APIs in lxc_hostdev.[ch] Signed-off-by: Chunyan Liu --- po/POTFILES.in|1 - src/Makefile.am |1 - src/lxc/lxc_conf.h|4 - src/lxc/lxc_driver.c | 45 +++--- src/lxc/lxc_hostdev.c | 413 ---

[libvirt] [RESEND][PATCHv5 0/4] write separate module for hostdev passthrough

2013-09-12 Thread Chunyan Liu
[rebased to latest libvirt code for applying and reviewing the patches] These patches implements a separate module for hostdev passthrough so that it could be shared by different drivers and can maintain a global state of a host device. Plus, add passthrough to libxl driver, and change qemu driver

[libvirt] [RESEND][PATCHv5 2/4] add pci passthrough to libxl driver

2013-09-12 Thread Chunyan Liu
Add pci passthrough to libxl driver, support attach-device, detach-device and start a vm with pci hostdev specified. Signed-off-by: Chunyan Liu --- po/POTFILES.in |2 +- src/libxl/libxl_conf.c | 63 +++ src/libxl/libxl_conf.h |4 + src/libxl/libxl_driver.c | 443

[libvirt] [PATCHv2 0/4] Introduce APIs to extract DHCP leases info

2013-09-12 Thread Nehal J Wani
This API returns the information stored in the DHCP leases file created by dnsmasq for a given virtual network. It contacts the bridge network driver, which parses the leases file. It supports two methods: 1. Return info for all network interfaces connected to a given virtual network 2. Return

[libvirt] [PATCH] docs: mention hostname subtlety

2013-09-12 Thread Eric Blake
An off-list bug report mentioned some confusion where the public documentation of libvirt.c:virConnectGetHostname did not match the private documentation of util/virutil.c:virGetHostname. * src/libvirt.c (virConnectGetHostname): Tweak docs. Signed-off-by: Eric Blake --- src/libvirt.c | 7 --

[libvirt] [PATCHv2 4/4] net-dhcp-leases: Add virsh support

2013-09-12 Thread Nehal J Wani
Use virNetworkGetDHCPLeases and virNetworkGetDHCPLeasesForMAC in virsh. The new feature supports the follwing methods: 1. Retrieve leases info for a given virtual network 2. Retrieve leases info for given network interface tools/virsh-domain-monitor.c * Introduce new command : net-dhcp-lease

[libvirt] [PATCHv2 1/4] net-dhcp-leases: Implement the public APIs

2013-09-12 Thread Nehal J Wani
Introduce 3 new APIs, virNetworkGetDHCPLeases, virNetworkGetDHCPLeasesForMAC and virNetworkDHCPLeaseFree. * virNetworkGetDHCPLeases: returns the dhcp leases information for a given virtual network. The information includes lease expirytime, MAC Address, IP Address, hostname and clientid.

Re: [libvirt] [PATCH] Allow root users to have their own configuration file

2013-09-12 Thread Doug Goldstein
On Thu, Sep 12, 2013 at 6:30 AM, Martin Kletzander wrote: > On Thu 12 Sep 2013 12:12:22 PM CEST, Daniel P. Berrange wrote: >> On Thu, Sep 12, 2013 at 12:07:54PM +0200, Martin Kletzander wrote: >>> On 09/12/2013 12:00 PM, Daniel P. Berrange wrote: On Thu, Sep 12, 2013 at 11:53:32AM +0200, Mart

Re: [libvirt] [PATCH v2] Add some notes about security considerations when using LXC

2013-09-12 Thread Chen Hanxiao
> -Original Message- > From: Daniel P. Berrange [mailto:berra...@redhat.com] > Sent: Thursday, September 12, 2013 6:46 PM > To: Chen Hanxiao > Cc: libvir-list@redhat.com; 'Gao feng' > Subject: Re: [PATCH v2] Add some notes about security considerations when > using LXC > > On Thu, Sep 12

Re: [libvirt] [PATCH] tools: fix a judgment of equalling zero about an array's length

2013-09-12 Thread Eric Blake
On 09/12/2013 08:00 PM, lawrancejing wrote: > There is no need to go on executing code when the array's length is zero. > --- > tools/virsh-snapshot.c |2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/tools/virsh-snapshot.c b/tools/virsh-snapshot.c > index e37a5b3..d7

[libvirt] [PATCH] tools: fix a judgment of equalling zero about an array's length

2013-09-12 Thread lawrancejing
There is no need to go on executing code when the array's length is zero. --- tools/virsh-snapshot.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/tools/virsh-snapshot.c b/tools/virsh-snapshot.c index e37a5b3..d7a4c7b 100644 --- a/tools/virsh-snapshot.c +++ b/tools/virs

Re: [libvirt] [PATCH] Fix naming of permission for detecting storage pools

2013-09-12 Thread Eric Blake
On 09/12/2013 07:37 AM, Daniel P. Berrange wrote: > From: "Daniel P. Berrange" > > The VIR_ACCESS_PERM_CONNECT_DETECT_STORAGE_POOLS enum > constant had its string format be 'detect_storage_pool', > note the missing trailing 's'. This prevent the ACL > check from ever succeeding. Fix this and add

Re: [libvirt] [PATCH] rbd: Use rbd_create3 to create RBD format 2 images by default

2013-09-12 Thread Wido den Hollander
On 09/12/2013 04:12 PM, Daniel P. Berrange wrote: On Thu, Sep 12, 2013 at 11:27:10AM +0200, Wido den Hollander wrote: This new RBD format supports snapshotting and cloning. By having libvirt create images in format 2 end-users of the created images can benefit of the new RBD format. What's t

[libvirt] [PATCHv2 2/4] net-dhcp-leases: Implement the remote protocol

2013-09-12 Thread Nehal J Wani
Implement RPC calls for virNetworkGetDHCPLeases, virNetworkGetDHCPLeasesForMAC daemon/remote.c * Define remoteSerializeNetworkDHCPLeases, remoteDispatchNetworkGetDHCPLeases * Define remoteDispatchNetworkGetDHCPLeasesForMAC src/remote/remote_driver.c * Define remoteNetworkGetD

[libvirt] USB: USB Passthrough Device Autoconnect Feature

2013-09-12 Thread Gonglei (Arei)
Hi, all Qemu upstream had achieved USB Passthrough Device Autoconnect Feature for the guest. Such as a USB device is unplugged from the host then plugged back in to the same USB physical port. the patch was: https://lists.gnu.org/archive/html/qemu-devel/2011-05/msg02341.html However, Libvirt

Re: [libvirt] [PATCH] Fix naming of permission for detecting storage pools

2013-09-12 Thread Eric Blake
On 09/12/2013 07:37 AM, Daniel P. Berrange wrote: > From: "Daniel P. Berrange" > > The VIR_ACCESS_PERM_CONNECT_DETECT_STORAGE_POOLS enum > constant had its string format be 'detect_storage_pool', > note the missing trailing 's'. This prevent the ACL > check from ever succeeding. Fix this and add

Re: [libvirt] rpmbuild libvirt 1.1.2 problem

2013-09-12 Thread Nehal J Wani
The issue is being fixed by the patch: https://www.redhat.com/archives/libvir-list/2013-September/msg00703.html On Thu, Sep 12, 2013 at 8:35 PM, Alex Jia wrote: > Hi Martin, > BTW, I met the same question, and I ran 'make check' under root. > > -- > Regards, > Alex > > > - Original Message

Re: [libvirt] [PATCH 2/2] tests: Don't test user config file if ran as root

2013-09-12 Thread Eric Blake
On 09/12/2013 06:47 AM, Daniel P. Berrange wrote: >>> ACK if you can answer the question either way. >>> >> >> Thanks, should I wait for ACK on 1/2 before pushing or have you seen >> that in the archives? > > Odd, I've not see any cover letter or 1/2 patch arrive. My inbox is also having dreadfu

Re: [libvirt] [v0.9.12-maint v2 00/12] Debian's 0.9.12 patches

2013-09-12 Thread Doug Goldstein
On Thu, Sep 12, 2013 at 3:18 AM, Guido Günther wrote: > These are the patches Debian is currently carrying on 0.9.12. Most are > straight cherry-picks. Since we're maintaining 0.9.12 for our current > stable release I'm happy to push these to v0.9.12-maint. I think that's perfectly reasonable an

[libvirt] [PATCH] Fix naming of permission for detecting storage pools

2013-09-12 Thread Daniel P. Berrange
From: "Daniel P. Berrange" The VIR_ACCESS_PERM_CONNECT_DETECT_STORAGE_POOLS enum constant had its string format be 'detect_storage_pool', note the missing trailing 's'. This prevent the ACL check from ever succeeding. Fix this and add a simple test script to validate this problem of matching name

Re: [libvirt] [PATCH] qemu: Fix checking of guest ABI compatibility when reverting snapshots

2013-09-12 Thread Peter Krempa
On 09/12/13 15:10, Jiri Denemark wrote: > On Thu, Sep 12, 2013 at 11:50:28 +0200, Peter Krempa wrote: >> When reverting a live internal snapshot with a live guest the ABI >> compatiblity check was comparing a "migratable" definition with a normal >> one. This resulted in the check failing with: >>

[libvirt] Doc: How to use NPIV in libvirt

2013-09-12 Thread Osier Yang
Before posting it to WIKI or somewhere, I want to see if there is any suggestions on it, or if I missed something. How to use NPIV in libvirt I planned to wrote a document about how to use NPIV in libvirt after more features are

Re: [libvirt] [PATCHv6 1/5] domifaddr: Implement the public APIs

2013-09-12 Thread Daniel P. Berrange
On Sun, Sep 08, 2013 at 02:43:09PM +0800, Osier Yang wrote: > On 06/09/13 23:18, Nehal J Wani wrote: > > > The documentation for virDomainInterfaceAddresses is removed in this > version. > > >Define helper function virDomainInterfaceFree, which allows > >the upper layer application to free the d

Re: [libvirt] [PATCHv6 1/5] domifaddr: Implement the public APIs

2013-09-12 Thread Nehal J Wani
Eric, could you please share your views on the discussion? On Sun, Sep 8, 2013 at 2:42 PM, Osier Yang wrote: > [..] > > > >>> + * + * If 0 is passed as @flags, libvirt will choose the best way, and won't + * include agent in it. >>> >>> I'm thinking if we don't need to

Re: [libvirt] [PATCH 2/2] tests: Don't test user config file if ran as root

2013-09-12 Thread Daniel P. Berrange
On Thu, Sep 12, 2013 at 01:48:31PM +0200, Martin Kletzander wrote: > On 09/12/2013 01:35 PM, Daniel P. Berrange wrote: > > On Thu, Sep 12, 2013 at 01:28:45PM +0200, Martin Kletzander wrote: > >> Signed-off-by: Martin Kletzander > >> --- > >> tests/virsh-uriprecedence | 6 +- > >> 1 file chang

Re: [libvirt] [v0.9.12-maint 08/11] Make sure regree is called close to it's usage

2013-09-12 Thread Eric Blake
On 09/12/2013 03:35 AM, Luca Tettamanti wrote: > Hi Eric, > I wasn't aware that my patch had been posted upstream. Yeah, my unfortunate email addressing was due to a glitch in the way Guido posted the existing Debian patch queue for 0.9.12 to upstream, such that my usual 'reply-to-all' sent to the

Re: [libvirt] [RESEND][PATCHv5 0/4] write separate module for hostdev passthrough

2013-09-12 Thread Eric Blake
On 09/11/2013 09:25 PM, Chunyan Liu wrote: > [rebased to latest libvirt code for applying and reviewing the patches] > > These patches implements a separate module for hostdev passthrough so that it > could be shared by different drivers and can maintain a global state of a host > device. Plus, ad

Re: [libvirt] [PATCH 2/2] tests: Don't test user config file if ran as root

2013-09-12 Thread Daniel P. Berrange
On Thu, Sep 12, 2013 at 01:28:45PM +0200, Martin Kletzander wrote: > Signed-off-by: Martin Kletzander > --- > tests/virsh-uriprecedence | 6 +- > 1 file changed, 5 insertions(+), 1 deletion(-) > > diff --git a/tests/virsh-uriprecedence b/tests/virsh-uriprecedence > index f4d84a4..aa90efe 100

Re: [libvirt] [PATCH] Allow root users to have their own configuration file

2013-09-12 Thread Martin Kletzander
On Thu 12 Sep 2013 12:12:22 PM CEST, Daniel P. Berrange wrote: > On Thu, Sep 12, 2013 at 12:07:54PM +0200, Martin Kletzander wrote: >> On 09/12/2013 12:00 PM, Daniel P. Berrange wrote: >>> On Thu, Sep 12, 2013 at 11:53:32AM +0200, Martin Kletzander wrote: Currently, we have two configuration f

[libvirt] [PATCH 2/2] tests: Don't test user config file if ran as root

2013-09-12 Thread Martin Kletzander
Signed-off-by: Martin Kletzander --- tests/virsh-uriprecedence | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/virsh-uriprecedence b/tests/virsh-uriprecedence index f4d84a4..aa90efe 100755 --- a/tests/virsh-uriprecedence +++ b/tests/virsh-uriprecedence @@ -56,7 +56,

Re: [libvirt] [PATCH] Fix virsystemdtest for previous commit

2013-09-12 Thread John Ferlan
On 09/11/2013 10:31 AM, Daniel P. Berrange wrote: > From: "Daniel P. Berrange" > > The change to query org.freedesktop.DBus.ListActivatableNames > to detect systemd broke the test suite, since we did not have > stubs to respond to this dbus call. > > Signed-off-by: Daniel P. Berrange > --- > t

[libvirt] [PATCH 1/4] qemu: Expose file opening functions

2013-09-12 Thread Michal Privoznik
The qemuOpenFileAs and qemuOpenFile functions are gonna be needed in later patches. However, they are static now. Signed-off-by: Michal Privoznik --- src/qemu/qemu_domain.c | 146 ++ src/qemu/qemu_domain.h | 10 src/qemu/qemu_driver.c | 155 -

Re: [libvirt] [PATCH] Allow root users to have their own configuration file

2013-09-12 Thread Martin Kletzander
On 09/12/2013 12:00 PM, Daniel P. Berrange wrote: > On Thu, Sep 12, 2013 at 11:53:32AM +0200, Martin Kletzander wrote: >> Currently, we have two configuration file paths, one global (where >> "global" means root-only and we're probably not changing this in near >> future) and one per-user. Unfortu

Re: [libvirt] [PATCH] Allow root users to have their own configuration file

2013-09-12 Thread Martin Kletzander
On 09/12/2013 11:53 AM, Martin Kletzander wrote: > Currently, we have two configuration file paths, one global (where > "global" means root-only and we're probably not changing this in near > future) and one per-user. Unfortunately root user cannot use the > second option because until now we were

Re: [libvirt] [PATCH] Allow root users to have their own configuration file

2013-09-12 Thread Daniel P. Berrange
On Thu, Sep 12, 2013 at 11:53:32AM +0200, Martin Kletzander wrote: > Currently, we have two configuration file paths, one global (where > "global" means root-only and we're probably not changing this in near > future) and one per-user. Unfortunately root user cannot use the > second option because

[libvirt] [PATCH] Allow root users to have their own configuration file

2013-09-12 Thread Martin Kletzander
Currently, we have two configuration file paths, one global (where "global" means root-only and we're probably not changing this in near future) and one per-user. Unfortunately root user cannot use the second option because until now we were choosing the file path depending only on whether the use

[libvirt] [PATCH] qemu: Fix checking of guest ABI compatibility when reverting snapshots

2013-09-12 Thread Peter Krempa
When reverting a live internal snapshot with a live guest the ABI compatiblity check was comparing a "migratable" definition with a normal one. This resulted in the check failing with: revert requires force: Target device address type none does not match source pci This patch generates a "migrata

Re: [libvirt] [PATCH] virsh domjobinfo: Do not return 1 if job is NONE

2013-09-12 Thread Jiri Denemark
On Wed, Sep 11, 2013 at 16:54:21 +0200, Jano Tomko wrote: > On 09/11/2013 04:16 PM, Jiri Denemark wrote: > > Commit 38ab1225 changed the default value of ret from true to false but > > forgot to set ret = true when job is NONE. Thus, virsh domjobinfo > > returned 1 when there was no job running for

[libvirt] [PATCH] rbd: Use rbd_create3 to create RBD format 2 images by default

2013-09-12 Thread Wido den Hollander
This new RBD format supports snapshotting and cloning. By having libvirt create images in format 2 end-users of the created images can benefit of the new RBD format. Signed-off-by: Wido den Hollander --- src/storage/storage_backend_rbd.c | 23 +-- 1 file changed, 21 inserti

Re: [libvirt] [PATCHv2 RESEND] Add forwarders attribute to element.

2013-09-12 Thread Ján Tomko
On 09/12/2013 01:07 AM, Diego Woitasen wrote: > On Wed, Sep 11, 2013 at 11:05 AM, Ján Tomko wrote: >> On 09/11/2013 03:36 PM, Laine Stump wrote: >>> On 09/10/2013 04:26 PM, Diego Woitasen wrote: +

Re: [libvirt] [PATCH] rbd: Use different formatter to display disk format

2013-09-12 Thread Wido den Hollander
On 08/30/2013 12:30 PM, Wido den Hollander wrote: RBD images are always in RAW format and should be displayed that way Did anyone get the chance yet to review it? Thanks! Wido Signed-off-by: Wido den Hollander --- src/conf/storage_conf.c |3 ++- src/storage/storage_backen

Re: [libvirt] rpmbuild libvirt 1.1.2 problem

2013-09-12 Thread Martin Kletzander
On 09/11/2013 07:18 PM, Nehal J Wani wrote: > On Wed, Sep 11, 2013 at 10:17 AM, wrote: >> hi: >> i build rpm in centos 6.2, libvirt version 1.1.2,i found an error >> FAIL: virsh-uriprecedence >> >> Details in the attachment,thanks !Wait for a response >> > > Reproducible on Cent OS

[libvirt] [v0.9.12-maint v2 12/12] Fix race condition when destroying guests

2013-09-12 Thread Guido Günther
From: "Daniel P. Berrange" When running virDomainDestroy, we need to make sure that no other background thread cleans up the domain while we're doing our work. This can happen if we release the domain object while in the middle of work, because the monitor might detect EOF in this window. For thi

[libvirt] [v0.9.12-maint v2 10/12] conf: Remove console stream callback only when freeing console helper

2013-09-12 Thread Guido Günther
From: Peter Krempa Commit ba226d334acbc49f6751b430e0c4e00f69eef6bf tried to fix crash of the daemon when a domain with an open console was destroyed. The fix was wrong as it tried to remove the callback also when the stream was aborted, where at that point the fd stream driver was already freed a

[libvirt] [v0.9.12-maint v2 07/12] qemu: Add support for -no-user-config

2013-09-12 Thread Guido Günther
From: Jiri Denemark Thanks to this new option we are now able to use modern CPU models (such as Westmere) defined in external configuration file. The qemu-1.1{,-device} data files for qemuhelptest are filled in with qemu-1.1-rc2 output for now. I will update those files with real qemu-1.1 output

[libvirt] [v0.9.12-maint v2 11/12] Don't ignore return value of qemuProcessKill

2013-09-12 Thread Guido Günther
From: "Daniel P. Berrange" When calling qemuProcessKill from the virDomainDestroy impl in QEMU, do not ignore the return value. This ensures that if QEMU fails to respond to SIGKILL, the caller will know about the failure. Signed-off-by: Daniel P. Berrange (cherry picked from commit f1b4021b38f

[libvirt] [v0.9.12-maint v2 09/12] conf: Remove callback from stream when freeing entries in console hash

2013-09-12 Thread Guido Günther
From: Peter Krempa When a domain has a active console connection and is destroyed the callback is called on private data that no longer exist causing a segfault. (cherry picked from commit ba226d334acbc49f6751b430e0c4e00f69eef6bf) --- src/conf/virconsole.c | 3 +++ 1 file changed, 3 insertions(

[libvirt] [v0.9.12-maint v2 02/12] security: Fix libvirtd crash possibility

2013-09-12 Thread Guido Günther
From: Martin Kletzander Fix for CVE-2012-4423. When generating RPC protocol messages, it's strictly needed to have a continuous line of numbers or RPC messages. However in case anyone tries backporting some functionality and will skip a number, there is a possibility to make the daemon segfault

[libvirt] [v0.9.12-maint v2 04/12] Revert "rpc: Discard non-blocking calls only when necessary"

2013-09-12 Thread Guido Günther
From: Jiri Denemark This reverts commit b1e374a7ac56927cfe62435179bf0bba1e08b372, which was rather bad since I failed to consider all sides of the issue. The main things I didn't consider properly are: - a thread which sends a non-blocking call waits for the thread with the buck to process the

[libvirt] [v0.9.12-maint v2 08/12] Make sure regfree is called close to it's usage

2013-09-12 Thread Guido Günther
From: Luca Tettamanti This is a backport of 71da3b66a8455faf8019effe3cf504a31f91f54a. --- src/storage/storage_backend_logical.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/storage/storage_backend_logical.c b/src/storage/storage_backend_logical.c index 9a91dd9..7a

[libvirt] [v0.9.12-maint v2 05/12] qemu: Fix off-by-one error while unescaping monitor strings

2013-09-12 Thread Guido Günther
From: Peter Krempa While unescaping the commands the commands passed through to the monitor function qemuMonitorUnescapeArg() initialized lenght of the input string to strlen()+1 which is fine for alloc but not for iteration of the string. This patch fixes the off-by-one error and drops the poin

[libvirt] [v0.9.12-maint v2 00/12] Debian's 0.9.12 patches

2013-09-12 Thread Guido Günther
These are the patches Debian is currently carrying on 0.9.12. Most are straight cherry-picks. Since we're maintaining 0.9.12 for our current stable release I'm happy to push these to v0.9.12-maint. Daniel P. Berrange (2): Don't ignore return value of qemuProcessKill Fix race condition when de

Re: [libvirt] [fedora-virt] Sanlock + libvirt

2013-09-12 Thread Ján ONDREJ (SAL)
Hello, On Mon, Sep 09, 2013 at 01:51:19PM +0100, Daniel P. Berrange wrote: > On Mon, Sep 09, 2013 at 08:43:39AM -0400, Cole Robinson wrote: > > cc-ing libvir-list > > > > On 09/09/2013 08:20 AM, Ján ONDREJ (SAL) wrote: > > > in sanlock docs (https://fedorahosted.org/sanlock/) there is described