[libvirt] [PATCH v2 1/2] security_manager: Don't manipulate domain XML in virDomainDefGetSecurityLabelDef

2013-03-21 Thread Michal Privoznik
The virDomainDefGetSecurityLabelDef was modifying the domain XML. It tried to find a seclabel corresponding to given sec driver. If the label wasn't found, the function created one which is wrong. In fact it's security manager which should modify this part of domain XML. ---

[libvirt] [PATCH v2 2/2] security: Don't add seclabel of type none if there's already a seclabel

2013-03-21 Thread Michal Privoznik
https://bugzilla.redhat.com/show_bug.cgi?id=923946 The seclabel type='none'/ should be added iff there is no other seclabel defined within a domain. This bug can be easily reproduced: 1) configure selinux seclabel for a domain 2) disable system's selinux and restart libvirtd 3) observe seclabel

[libvirt] [PATCH v5 1/3] virFile: Add APIs for extended attributes handling

2013-03-21 Thread Michal Privoznik
Currently, only three wrappers are being implemented: virFileSetAttr for setting attributes virFileGetAttr for querying attributes (note we need to call it twice, first time to get length of attribute value, second to get actual value) virFileRemoveAttr for removing attributes --- diff to v4:

[libvirt] [PATCH v5 3/3] security_dac: Favour ACLs over chown()

2013-03-21 Thread Michal Privoznik
On filesystems supporting ACLs we don't need to do a chown but we can just set ACLs to gain access for qemu. However, since we are setting these on too low level, where we don't know if disk is just a read only or read write, we set read write access unconditionally. From implementation POV, a

[libvirt] [PATCH v5 0/3] Keep original file label

2013-03-21 Thread Michal Privoznik
Yet another rework of $subj. I am still not solving atomicity problem for now. See diff to the patches if you want to know what's changed. Michal Privoznik (3): virFile: Add APIs for extended attributes handling virfile: Introduce internal API for managing ACL security_dac: Favour ACLs

[libvirt] [PATCH v5 2/3] virfile: Introduce internal API for managing ACL

2013-03-21 Thread Michal Privoznik
For now, only three APIs are implemented: virFileGetACL to retrieve permission for a specific user virFileSetACL for setting requested permissions for a specific user, virFileRemoveACL to remove those permissions. --- diff to v4: -drop errno setting diff to v3: -set errno=ENOSYS when building

[libvirt] [PATCH] viralloc: Export virAllocTest*

2013-03-22 Thread Michal Privoznik
If users build with --enable-test-oom configure option, they get this error saying, virAllocTest* functions are not defined within tests/testutils.c. --- src/libvirt_private.syms | 4 src/util/viralloc.c | 24 src/util/viralloc.h | 7 ---

Re: [libvirt] [libvirt-designer] Add GvirDesignerDomain::osinfo-db

2013-03-22 Thread Michal Privoznik
On 22.03.2013 11:11, Christophe Fergeau wrote: virtxml was doing its own loading of the libosinfo database, and gvir_designer_init() was loading it a second time. By adding a GVirDesignerDomain::osinfo_db property, applications can share the same OsinfoDb as libvirt-designer. The association

[libvirt] [PATCH RFC 0/2] Report OOM on VIR_ALLOC failure

2013-03-22 Thread Michal Privoznik
/: 30 files changed, 81 insertions(+), 221 deletions(-) Michal Privoznik (2): viralloc: Report OOM error on failure util: Don't report OOM twice src/util/iohelper.c | 4 +--- src/util/viralloc.c | 23 ++- src/util/viralloc.h | 13

[libvirt] [PATCH RFC 2/2] util: Don't report OOM twice

2013-03-22 Thread Michal Privoznik
Adapt code under src/util/ to fact, that VIR_ALLOC* now reports OOM error. There is no need to report it twice now. --- src/util/iohelper.c | 4 +--- src/util/virauthconfig.c | 8 ++-- src/util/vircommand.c| 13 +++-- src/util/virconf.c

[libvirt] [PATCH RFC 1/2] viralloc: Report OOM error on failure

2013-03-22 Thread Michal Privoznik
In nearly all cases of calling VIR_ALLOC*, VIR_REALLOC_N, VIR_EXPAND_N, VIR_RESIZE_N, VIR_*_ELEMENT etc. we want to report OOM error, so our source code base is full of: if (VIR_ALLOC(somePtr) 0) { virReportOOMError(); goto cleanup; } or similar. Moreover, for those few cases

Re: [libvirt] [PATCH] virsh: don't print --(null) in vol-name and vol-pool

2013-03-22 Thread Michal Privoznik
On 22.03.2013 12:51, Ján Tomko wrote: Don't print the pool option name if it's null. Before: virsh # vol-name vol error: failed to get vol 'vol', specifying --(null) might help error: Storage volume not found: no storage vol with matching path vol After: virsh # vol-name vol error:

Re: [libvirt] [PATCH] Remove bogus filtering from virDomainGetRootFilesystem

2013-03-22 Thread Michal Privoznik
On 22.03.2013 13:10, Daniel P. Berrange wrote: From: Daniel P. Berrange berra...@redhat.com The virDomainGetRootFilesystem was only returning filesystems with type=mount. This is bogus - any type of filesystem is valid as the root, if dst=/. Signed-off-by: Daniel P. Berrange

Re: [libvirt] [PATCH] Fix thread safety in LXC callback handling

2013-03-22 Thread Michal Privoznik
On 22.03.2013 13:11, Daniel P. Berrange wrote: From: Daniel P. Berrange berra...@redhat.com Some of the LXC callbacks did not lock the virDomainObjPtr instance. This caused transient errors like error: Failed to start domain busy-mount error: cannot rename file

Re: [libvirt] Schedule for the next release suggestions

2013-03-22 Thread Michal Privoznik
On 22.03.2013 14:36, Daniel Veillard wrote: The 1.0.3 release was on the 5th March, and right now we have accumulated 'only' 150 commits since the release. Based on this I would suggest to wait a couple of weeks before to enter a freeze for the following release. This mean we drift from the

Re: [libvirt] [PATCH] Mount temporary devpts on /var/lib/libvirt/lxc/$NAME.devpts

2013-03-22 Thread Michal Privoznik
On 22.03.2013 15:24, Daniel P. Berrange wrote: From: Daniel P. Berrange berra...@redhat.com Currently the lxc controller sets up the devpts instance on $rootfsdef-src, but this only works if $rootfsdef is using type=mount. To support type=block or type=file for the root filesystem, we must

Re: [libvirt] [PATCH] Move FUSE mount to /var/lib/libvirt/lxc/$NAME.fuse

2013-03-22 Thread Michal Privoznik
On 22.03.2013 15:24, Daniel P. Berrange wrote: From: Daniel P. Berrange berra...@redhat.com Instead of using /var/lib/libvirt/lxc/$NAME for the FUSE filesystem, use /var/lib/libvirt/lxc/$NAME.fuse. This allows room for other temporary mounts in the same directory ---

Re: [libvirt] [PATCH] Ensure root filesystem is mounted if a file/block mount.

2013-03-22 Thread Michal Privoznik
On 22.03.2013 15:24, Daniel P. Berrange wrote: From: Daniel P. Berrange berra...@redhat.com For a root filesystem with type=file or type=block, the LXC container was forgetting to actually mount it, before doing the pivot root step. Signed-off-by: Daniel P. Berrange berra...@redhat.com

Re: [libvirt] Schedule for the next release suggestions

2013-03-22 Thread Michal Privoznik
On 22.03.2013 15:38, Daniel Veillard wrote: On Fri, Mar 22, 2013 at 02:23:34PM +, Daniel P. Berrange wrote: On Fri, Mar 22, 2013 at 10:17:07PM +0800, Daniel Veillard wrote: On Fri, Mar 22, 2013 at 02:07:05PM +, Daniel P. Berrange wrote: On Fri, Mar 22, 2013 at 09:36:03PM +0800, Daniel

Re: [libvirt] [PATCH RFC 2/2] util: Don't report OOM twice

2013-03-22 Thread Michal Privoznik
On 22.03.2013 18:32, Stefan Berger wrote: On 03/22/2013 07:44 AM, Michal Privoznik wrote: Adapt code under src/util/ to fact, that VIR_ALLOC* now reports OOM error. There is no need to report it twice now. --- Maybe an sed script could help here at least in removing the virReportOOMError

Re: [libvirt] [PATCH v2 0/2] Correctly treat seclabel of type none

2013-03-26 Thread Michal Privoznik
On 21.03.2013 16:35, Michal Privoznik wrote: Don't forget other seclabels when adding a seclabel type='none'/. Michal Privoznik (2): security_manager: Don't manipulate domain XML in virDomainDefGetSecurityLabelDef security: Don't add seclabel of type none if there's already

[libvirt] [PATCH] qemu: Set migration FD blocking

2013-03-26 Thread Michal Privoznik
Since we switched from direct host migration scheme to the one, where we connect to the destination and then just pass a FD to a qemu, we have uncovered a qemu bug. Qemu expects migration FD to block. However, we are passing a nonblocking one which results in cryptic error messages like: qemu:

Re: [libvirt] [PATCH] conf: fix a failure when detaching a usb device

2013-03-26 Thread Michal Privoznik
On 26.03.2013 15:17, Guannan Ren wrote: #virsh detach-device $guest usb.xml error: Failed to detach device from usb2.xml error: operation failed: host usb device vendor=0x0951 \ product=0x1625 not found This regresstion is due to a typo in matching function. The first argument is

Re: [libvirt] [PATCH] qemu: Set migration FD blocking

2013-03-26 Thread Michal Privoznik
On 26.03.2013 17:08, Eric Blake wrote: On 03/26/2013 08:55 AM, Michal Privoznik wrote: Since we switched from direct host migration scheme to the one, where we connect to the destination and then just pass a FD to a qemu, we have uncovered a qemu bug. Qemu expects migration FD to block

Re: [libvirt] [PATCH v2 0/2] Correctly treat seclabel of type none

2013-03-28 Thread Michal Privoznik
On 27.03.2013 22:50, Eric Blake wrote: On 03/21/2013 09:35 AM, Michal Privoznik wrote: Don't forget other seclabels when adding a seclabel type='none'/. Michal Privoznik (2): security_manager: Don't manipulate domain XML in virDomainDefGetSecurityLabelDef security: Don't add

Re: [libvirt] [PATCH v2 1/2] security_manager: Don't manipulate domain XML in virDomainDefGetSecurityLabelDef

2013-03-28 Thread Michal Privoznik
On 28.03.2013 10:15, Daniel P. Berrange wrote: On Thu, Mar 21, 2013 at 04:35:10PM +0100, Michal Privoznik wrote: The virDomainDefGetSecurityLabelDef was modifying the domain XML. It tried to find a seclabel corresponding to given sec driver. If the label wasn't found, the function created one

Re: [libvirt] [PATCH v5 3/3] security_dac: Favour ACLs over chown()

2013-03-28 Thread Michal Privoznik
On 28.03.2013 10:46, Daniel P. Berrange wrote: On Thu, Mar 21, 2013 at 05:50:49PM +0100, Michal Privoznik wrote: #define VIR_FROM_THIS VIR_FROM_SECURITY #define SECURITY_DAC_NAME dac +#define SECURITY_DAC_XATTR_OLD_ACL trusted.libvirt.dac.oldACL +#define SECURITY_DAC_XATTR_OLD_OWNER

Re: [libvirt] [PATCH v5 3/3] security_dac: Favour ACLs over chown()

2013-03-28 Thread Michal Privoznik
On 28.03.2013 12:12, Daniel P. Berrange wrote: On Thu, Mar 28, 2013 at 11:38:04AM +0100, Michal Privoznik wrote: On 28.03.2013 10:46, Daniel P. Berrange wrote: On Thu, Mar 21, 2013 at 05:50:49PM +0100, Michal Privoznik wrote: #define VIR_FROM_THIS VIR_FROM_SECURITY #define SECURITY_DAC_NAME

Re: [libvirt] [PATCH v5 3/3] security_dac: Favour ACLs over chown()

2013-03-28 Thread Michal Privoznik
On 28.03.2013 12:52, Daniel P. Berrange wrote: On Thu, Mar 28, 2013 at 12:47:25PM +0100, Michal Privoznik wrote: On 28.03.2013 12:12, Daniel P. Berrange wrote: On Thu, Mar 28, 2013 at 11:38:04AM +0100, Michal Privoznik wrote: On 28.03.2013 10:46, Daniel P. Berrange wrote: On Thu, Mar 21, 2013

[libvirt] [PATCH] virutil: Fix compilation on non-linux platforms

2013-03-28 Thread Michal Privoznik
There has been a typo in virIsCapbleVport function name. --- Pushed under build breaker rule. src/util/virutil.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/util/virutil.c b/src/util/virutil.c index d5f122f..87a97c9 100644 --- a/src/util/virutil.c +++

[libvirt] [PATCH] security_manager.c: Append seclabel iff generated

2013-03-28 Thread Michal Privoznik
With my previous patches, we unconditionally appended a seclabel, even if it wasn't generated but found in array of defined seclabels. This resulted in double free later when doing virDomainDefFree and iterating over the array of defined seclabels. Moreover, there was another possibility of

Re: [libvirt] [PATCH] storage: Avoid double virCommandFree in virStorageBackendLogicalDeletePool

2013-03-28 Thread Michal Privoznik
On 28.03.2013 17:06, Martin Kletzander wrote: When logical pool has no PVs associated with itself (user-created), virCommandFree(cmd) is called twice with the same pointer and that causes a segfault in daemon. Signed-off-by: Martin Kletzander mklet...@redhat.com --- Worth v1.0.4 IMHO. ---

Re: [libvirt] [libvirt-designer] Fix various memory leaks of libosinfo data

2013-03-28 Thread Michal Privoznik
On 28.03.2013 17:41, Christophe Fergeau wrote: --- libvirt-designer/libvirt-designer-domain.c | 8 1 file changed, 8 insertions(+) diff --git a/libvirt-designer/libvirt-designer-domain.c b/libvirt-designer/libvirt-designer-domain.c index 9dc1d7d..b1aa838 100644 ---

Re: [libvirt] [libvirt-designer 2/2] Fix leaks of libosinfo data

2013-03-29 Thread Michal Privoznik
On 28.03.2013 12:16, Christophe Fergeau wrote: --- examples/virtxml.c | 3 +++ libvirt-designer/libvirt-designer-domain.c | 2 ++ 2 files changed, 5 insertions(+) ACK series. Michal -- libvir-list mailing list libvir-list@redhat.com

[libvirt] [PATCH] test: Return Libvirt logo as domain screenshot

2013-03-29 Thread Michal Privoznik
This is just a bare Easter Egg. Whenever user run virDomainScreenshot over a domain in test driver, he'll get the Libvirt PNG logo in return. --- docs/Makefile.am | 1 + src/test/test_driver.c | 22 ++ 2 files changed, 23 insertions(+) diff --git a/docs/Makefile.am

[libvirt] [PATCH v2] test: Return Libvirt logo as domain screenshot

2013-03-31 Thread Michal Privoznik
This is just a bare Easter Egg. Whenever user run virDomainScreenshot over a domain in test driver, he'll get the Libvirt PNG logo in return. --- docs/Makefile.am | 1 + src/test/test_driver.c | 24 2 files changed, 25 insertions(+) diff --git a/docs/Makefile.am

Re: [libvirt] [PATCH 1/1] Fix the crash when seclable is freed

2013-04-02 Thread Michal Privoznik
On 02.04.2013 07:58, Li Zhang wrote: From: Li Zhang zhlci...@linux.vnet.ibm.com When seclabel's type is VIR_DOMAIN_SECLABEL_NONE, virSecurityLabelDefPtr's members are not allocated. So it will cause crash when calling VIR_FREE. This problem is found when running autotest on PPC.

[libvirt] [PATCH v3] test: Return Libvirt logo as domain screenshot

2013-04-02 Thread Michal Privoznik
This is just a bare Easter Egg. Whenever a user runs virDomainScreenshot over a domain in test driver, he'll get the Libvirt PNG logo in return. --- docs/Makefile.am | 1 + libvirt.spec.in| 1 + src/test/test_driver.c | 24 3 files changed, 26

Re: [libvirt] [PATCH v3] test: Return Libvirt logo as domain screenshot

2013-04-02 Thread Michal Privoznik
On 02.04.2013 13:56, Daniel P. Berrange wrote: On Tue, Apr 02, 2013 at 01:52:39PM +0200, Michal Privoznik wrote: This is just a bare Easter Egg. Whenever a user runs virDomainScreenshot over a domain in test driver, he'll get the Libvirt PNG logo in return. --- docs/Makefile.am | 1

[libvirt] [PATCH 2/5] Introduce VIR_STRDUP to replace strdup

2013-04-02 Thread Michal Privoznik
--- WARNING: THIS PATCH IS NOT COMPLETE !!! For full patch see the cover letter. I've trimmed the patch and left only interesting parts. HACKING | 5 ++ cfg.mk| 8 ++ daemon/libvirtd-config.c | 24 ++---

[libvirt] [PATCH 3/5] virstring: Introduce virVasprintfNOOM and make virVasprintf report OOM

2013-04-02 Thread Michal Privoznik
--- src/libvirt_private.syms | 1 + src/qemu/qemu_domain.c | 4 +--- src/util/viraudit.c | 2 +- src/util/vircommand.c| 4 ++-- src/util/virerror.c | 2 +- src/util/virlog.c| 2 +- src/util/virstring.c | 22 -- src/util/virstring.h | 3

[libvirt] [PATCH 4/5] viralloc: Introduce OOM error reporting to VIR_ALLOC and friends

2013-04-02 Thread Michal Privoznik
--- HACKING | 4 ++ docs/hacking.html.in| 4 ++ po/POTFILES.in | 1 + python/libvirt-override.c | 102 ++-- src/esx/esx_vi.c| 5 +-- src/util/viralloc.c | 91

[libvirt] [PATCH 0/5] Drop virReportOOMReport from almost everywhere

2013-04-02 Thread Michal Privoznik
You can find these patches applied on: git://gitorious.org/~zippy2/libvirt/michal-staging.git branch is called 'oom'. The patch 2/5 is totally mechaninc: s/strdup/VIR_STRDUP/ (not for all files, obviously). That's why I've trimmed it before sending. Michal Privoznik (5): virutil: Move

[libvirt] [PATCH] virsh: Call virDomainFree in cmdDomFSTrim

2013-04-02 Thread Michal Privoznik
The virsh domfstrim command was not freeing allocated domain, leaving leaked references behind. --- tools/virsh-domain.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c index 5ddcedc..5fbfeee 100644 --- a/tools/virsh-domain.c +++

Re: [libvirt] [PATCH] virsh: Call virDomainFree in cmdDomFSTrim

2013-04-02 Thread Michal Privoznik
On 02.04.2013 17:32, Martin Kletzander wrote: On 04/02/2013 05:20 PM, Michal Privoznik wrote: The virsh domfstrim command was not freeing allocated domain, leaving leaked references behind. --- tools/virsh-domain.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/virsh-domain.c

[libvirt] [PATCH] sec_manager: Refuse to start domain with unsupported seclabel

2013-04-02 Thread Michal Privoznik
https://bugzilla.redhat.com/show_bug.cgi?id=947387 If a user configures a domain to use a seclabel of a specific type, but the appropriate driver is not accessible, we should refuse to start the domain. For instance, if user requires selinux, but it is either non present in the system, or is just

Re: [libvirt] [PATCH] sec_manager: Refuse to start domain with unsupported seclabel

2013-04-03 Thread Michal Privoznik
On 02.04.2013 18:38, Eric Blake wrote: On 04/02/2013 10:07 AM, Michal Privoznik wrote: https://bugzilla.redhat.com/show_bug.cgi?id=947387 If a user configures a domain to use a seclabel of a specific type, but the appropriate driver is not accessible, we should refuse to start the domain

Re: [libvirt] [PATCH 1/1] Fix the crash when seclable is freed

2013-04-03 Thread Michal Privoznik
On 03.04.2013 04:24, Li Zhang wrote: On 2013年04月02日 19:29, Michal Privoznik wrote: On 02.04.2013 07:58, Li Zhang wrote: From: Li Zhang zhlci...@linux.vnet.ibm.com When seclabel's type is VIR_DOMAIN_SECLABEL_NONE, virSecurityLabelDefPtr's members are not allocated. So it will cause crash

Re: [libvirt] [PATCH 0/7] Fix multiple compiler warnings on ARMv7

2013-04-05 Thread Michal Privoznik
On 03.04.2013 17:06, Daniel P. Berrange wrote: The ARMv7 builds of libvirt generate a number of warnings, mostly about cast alignment http://arm.koji.fedoraproject.org/packages/libvirt/1.0.4/1.fc19/data/logs/armv7hl/build.log this patch series fixes as many as possible, and then disables

Re: [libvirt] [PATCH 1/7] Rewrite keycode map to avoid a struct

2013-04-05 Thread Michal Privoznik
On 03.04.2013 17:06, Daniel P. Berrange wrote: From: Daniel P. Berrange berra...@redhat.com Playing games with field offsets in a struct causes all sorts of alignment warnings on ARM platforms util/virkeycode.c: In function '__virKeycodeValueFromString': util/virkeycode.c:26:7: warning:

Re: [libvirt] [PATCH 6/7] Disable of unused sysinfotest functions

2013-04-05 Thread Michal Privoznik
On 03.04.2013 17:06, Daniel P. Berrange wrote: From: Daniel P. Berrange berra...@redhat.com Certain functions in the sysinfotest.c are not used unless a whitelisted architecture is being built. Disable those functions unless required to avoid warnings about unused functions.

Re: [libvirt] [PATCH 3/5] virstring: Introduce virVasprintfNOOM and make virVasprintf report OOM

2013-04-05 Thread Michal Privoznik
On 05.04.2013 12:45, Daniel P. Berrange wrote: On Tue, Apr 02, 2013 at 04:22:56PM +0200, Michal Privoznik wrote: --- src/libvirt_private.syms | 1 + src/qemu/qemu_domain.c | 4 +--- src/util/viraudit.c | 2 +- src/util/vircommand.c| 4 ++-- src/util/virerror.c | 2

Re: [libvirt] 1.4.0 memballoon bug?

2013-04-08 Thread Michal Privoznik
On 05.04.2013 21:22, Serge Hallyn wrote: Hi, When I run virsh -c qemu:///system domxml-to-native qemu-argv /tmp/qatest.xml from 1.4.0 with the qatest.xml below (which has no memballoon device specified), I get an 'unspecified error'. Some printf debugging shows that

Re: [libvirt] [PATCH glib] Auto-generate AUTHORS file from GIT logs during make dist

2013-04-08 Thread Michal Privoznik
On 08.04.2013 17:40, Daniel P. Berrange wrote: From: Daniel P. Berrange berra...@redhat.com Instead of manually keeping the AUTHORS file in sync with GIT, auto-generate it during make dist phase Signed-off-by: Daniel P. Berrange berra...@redhat.com --- AUTHORS = AUTHORS.in | 9

Re: [libvirt] [PATCH designer] Auto-generate AUTHORS file from GIT logs

2013-04-08 Thread Michal Privoznik
On 08.04.2013 17:46, Daniel P. Berrange wrote: From: Daniel P. Berrange berra...@redhat.com Rather than trying to manually keep track of authors, just auto-generate the list from GIT logs Signed-off-by: Daniel P. Berrange berra...@redhat.com --- .gitignore| 2 ++ AUTHORS =

[libvirt] [PATCH] qemu: Generate agent socket path if missing

2013-04-09 Thread Michal Privoznik
It's not desired to force users imagine path for a socket they are not even supposed to connect to. On the other hand, we already have a release where the qemu agent socket path is exposed to XML, so we cannot silently drop it from there. The new path is generated in form:

Re: [libvirt] [Qemu-devel] GSoC 2013, Introduce API to query IP addresses for given domain Libvirt project

2013-04-10 Thread Michal Privoznik
On 10.04.2013 11:12, Stefan Hajnoczi wrote: On Wed, Apr 10, 2013 at 04:46:45AM +0200, Tabibel Sami wrote: I am doing master degree of Cryptology and information security I have good C and Python skills, and i am interested to work on Introduce API to query IP addresses for given domain Libvirt

Re: [libvirt] [PATCH] qemu: Set correct migrate host in client_migrate_info

2013-04-10 Thread Michal Privoznik
On 10.04.2013 17:57, Daniel P. Berrange wrote: On Wed, Apr 10, 2013 at 05:52:26PM +0200, Michal Privoznik wrote: https://bugzilla.redhat.com/show_bug.cgi?id=920441 Currently, we are discarding listen attribute from qemu cookie even though we strive to gather it. This result in not so cool bug

[libvirt] [PATCH] qemu: Set correct migrate host in client_migrate_info

2013-04-10 Thread Michal Privoznik
https://bugzilla.redhat.com/show_bug.cgi?id=920441 Currently, we are discarding listen attribute from qemu cookie even though we strive to gather it. This result in not so cool bug: if user have different networks, one for management/migration, and one for VNC/SPICE we pass incorrect host to the

[libvirt] [PATCH v2] qemu: Set correct migrate host in client_migrate_info

2013-04-10 Thread Michal Privoznik
https://bugzilla.redhat.com/show_bug.cgi?id=920441 Currently, we are discarding listen attribute from qemu cookie even though we strive to gather it. This result in not so cool bug: if user have different networks, one for management/migration, and one for VNC/SPICE we pass incorrect host to the

Re: [libvirt] [PATCH v3 02/16] Store a virCgroupPtr instance in qemuDomainObjPrivatePtr

2013-04-10 Thread Michal Privoznik
On 10.04.2013 12:08, Daniel P. Berrange wrote: From: Daniel P. Berrange berra...@redhat.com Instead of calling virCgroupForDomain every time we need the virCgrouPtr instance, just do it once at Vm startup and cache a reference to the object in qemuDomainObjPrivatePtr until shutdown of the

Re: [libvirt] [PATCH v3 01/16] Introduce a virFileDeleteTree method

2013-04-10 Thread Michal Privoznik
On 10.04.2013 12:08, Daniel P. Berrange wrote: From: Daniel P. Berrange berra...@redhat.com Introduce a method virFileDeleteTree for recursively deleting an entire directory tree Signed-off-by: Daniel P. Berrange berra...@redhat.com --- src/libvirt_private.syms | 1 +

Re: [libvirt] [PATCH v3 03/16] Store a virCgroupPtr instance in virLXCDomainObjPrivatePtr

2013-04-10 Thread Michal Privoznik
On 10.04.2013 12:08, Daniel P. Berrange wrote: From: Daniel P. Berrange berra...@redhat.com Instead of calling virCgroupForDomain every time we need the virCgrouPtr instance, just do it once at Vm startup and cache a reference to the object in virLXCDomainObjPrivatePtr until shutdown of the

[libvirt] [PATCH v3] qemu: Set correct migrate host in client_migrate_info

2013-04-11 Thread Michal Privoznik
https://bugzilla.redhat.com/show_bug.cgi?id=920441 Currently, we are discarding listen attribute from qemu cookie even though we strive to gather it. This result in not so cool bug: if user have different networks, one for management/migration, and one for VNC/SPICE we pass incorrect host to the

Re: [libvirt] [PATCH v3 07/16] Refactor cgroups internal data structures

2013-04-11 Thread Michal Privoznik
On 10.04.2013 12:08, Daniel P. Berrange wrote: From: Daniel P. Berrange berra...@redhat.com Currently the virCgroupPtr struct contains 3 pieces of information - path - path of the cgroup, relative to current process' cgroup placement - placement - current process' placement in each

Re: [libvirt] [PATCH v3 08/16] Add misc extra debugging into cgroups code

2013-04-11 Thread Michal Privoznik
On 10.04.2013 12:08, Daniel P. Berrange wrote: From: Daniel P. Berrange berra...@redhat.com Signed-off-by: Daniel P. Berrange berra...@redhat.com --- src/util/vircgroup.c | 16 ++-- 1 file changed, 14 insertions(+), 2 deletions(-) ACK Michal -- libvir-list mailing list

Re: [libvirt] [PATCH v3 11/16] Add XML config for resource partitions

2013-04-11 Thread Michal Privoznik
On 10.04.2013 12:08, Daniel P. Berrange wrote: From: Daniel P. Berrange berra...@redhat.com Signed-off-by: Daniel P. Berrange berra...@redhat.com --- docs/formatdomain.html.in| 26 ++ docs/schemas/domaincommon.rng| 12 +

Re: [libvirt] [PATCH v3 12/16] Change default cgroup layout for QEMU/LXC and honour XML config

2013-04-11 Thread Michal Privoznik
On 10.04.2013 12:08, Daniel P. Berrange wrote: From: Daniel P. Berrange berra...@redhat.com Historically QEMU/LXC guests have been placed in a cgroup layout that is $LOCATION-OF-LIBVIRTD/libvirt/{qemu,lxc}/$VMNAME This is bad for a number of reasons - The cgroup hierarchy gets

Re: [libvirt] [PATCH v3 16/16] Replace LXC cgroup mount code with call to virCgroupIsolateMount

2013-04-11 Thread Michal Privoznik
On 10.04.2013 12:08, Daniel P. Berrange wrote: From: Daniel P. Berrange berra...@redhat.com The LXC driver currently has code to detect cgroups mounts and then re-mount them inside the new root filesystem. Replace this fragile code with a call to virCgroupIsolateMount. Signed-off-by:

Re: [libvirt] [PATCH v3 14/16] Track symlinks for co-mounted cgroup controllers

2013-04-11 Thread Michal Privoznik
On 10.04.2013 12:08, Daniel P. Berrange wrote: From: Daniel P. Berrange berra...@redhat.com If a cgroup controller is co-mounted with another, eg /sys/fs/cgroup/cpu,cpuacct Then it is a requirement that there exist symlinks at /sys/fs/cgroup/cpu /sys/fs/cgroup/cpuacct

Re: [libvirt] [PATCH v3 09/16] Cleanup if creating cgroup directories fails

2013-04-11 Thread Michal Privoznik
On 10.04.2013 12:08, Daniel P. Berrange wrote: From: Daniel P. Berrange berra...@redhat.com Currently if virCgroupMakeGroup fails, we can get in a situation where some controllers have been setup, but others not. Ensure we call virCgroupRemove to remove what we've done upon failure

Re: [libvirt] [PATCH v3 13/16] Remove non-functional code for setting up non-root cgroups

2013-04-11 Thread Michal Privoznik
On 10.04.2013 12:08, Daniel P. Berrange wrote: From: Daniel P. Berrange berra...@redhat.com The virCgroupNewDriver method had a 'bool privileged' param. If a false value was ever passed in, it would simply not work, since non-root users don't have any privileges to create new cgroups. Just

Re: [libvirt] [PATCH v3 15/16] Add an API for re-mounting cgroups, to isolate the process location

2013-04-11 Thread Michal Privoznik
On 10.04.2013 12:08, Daniel P. Berrange wrote: From: Daniel P. Berrange berra...@redhat.com Add a virCgroupIsolateMount method which looks at where the current process is place in the cgroups (eg /system/demo.lxc.libvirt) and then remounts the cgroups such that this sub-directory becomes

[libvirt] [PATCH] virsh: Update list of shutdown/reboot modes

2013-04-11 Thread Michal Privoznik
As of 76d9f65644 we are supporting two new modes: initctl and signal. However, these are missing in help listing. --- tools/virsh-domain.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c index c088468..bd6192e 100644 ---

[libvirt] [libvirt-designer][PATCH] Don't redefine _FORTIFY_SOURCE macro

2013-04-11 Thread Michal Privoznik
If the _FORTIFY_SOURCE has been already defined, we unconditionally redefine it, leaving us with warning/error thrown at compilation time. --- m4/virt-compile-warnings.m4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/m4/virt-compile-warnings.m4 b/m4/virt-compile-warnings.m4

Re: [libvirt] [libvirt-designer 3/3] Rework disk bus type handling

2013-04-11 Thread Michal Privoznik
On 03.04.2013 11:20, Christophe Fergeau wrote: The current handling of bus types has some issues: - it assumes that if the design uses a disk controller hanging off a PCI bus, then it can use virtio, which is not true for Windows for example unless an additional driver is installed - it

[libvirt] [libvirt-designer][PATCH] test: Adapt to new gvir_designer_domain_new signature

2013-04-11 Thread Michal Privoznik
After 46be1aed the signature of gvir_designer_domain_new has changed. The OsinfoDb parameter appeared there. However, the test suite hasn't been adapted. --- libvirt-designer/test-designer-domain.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git

Re: [libvirt] [libvirt-designer][PATCH] Don't redefine _FORTIFY_SOURCE macro

2013-04-11 Thread Michal Privoznik
On 11.04.2013 14:07, Zeeshan Ali (Khattak) wrote: On Thu, Apr 11, 2013 at 2:31 PM, Michal Privoznik mpriv...@redhat.com wrote: If the _FORTIFY_SOURCE has been already defined, we unconditionally redefine it, leaving us with warning/error thrown at compilation time. --- ACK Pushed, thanks

Re: [libvirt] [libvirt-designer][PATCH] test: Adapt to new gvir_designer_domain_new signature

2013-04-11 Thread Michal Privoznik
On 11.04.2013 14:10, Zeeshan Ali (Khattak) wrote: On Thu, Apr 11, 2013 at 3:01 PM, Michal Privoznik mpriv...@redhat.com wrote: After 46be1aed the signature of gvir_designer_domain_new has changed. The OsinfoDb parameter appeared there. However, the test suite hasn't been adapted. --- ACK

Re: [libvirt] [RFC] virCommandRun return error number

2013-04-11 Thread Michal Privoznik
On 11.04.2013 15:33, harryxiyou wrote: Hi all, I copy portions of libvirt/src/storage/storage_backend_sheepdog.c [...] 125 ret = virCommandRun(cmd, NULL); 126 if (ret == 0) 127 ret = virStorageBackendSheepdogParseNodeInfo(pool-def, output); [...] I found virCommandRun

Re: [libvirt] [RFC] virCommandRun return error number

2013-04-11 Thread Michal Privoznik
On 11.04.2013 15:48, harryxiyou wrote: On Thu, Apr 11, 2013 at 9:38 PM, Michal Privoznik mpriv...@redhat.com wrote: [...] Maybe you've pasted wrong code snippet, but the one you've pasted is correct. If virCommandRun() fails and returns -1; we return that value to the caller

Re: [libvirt] Google Summer of Code 2013 ideas wiki open

2013-04-12 Thread Michal Privoznik
On 10.04.2013 15:13, harryxiyou wrote: Hi all, I've also got some ideas like following for GSOC 2013. Storage driver jobs. Currently, there is no Libvirt storage API to rename storage volume, storage pool, snapshot, etc. There is also no Libvirt API to move volume from one pool to

Re: [libvirt] Shared desktop: grant permission to start/stop/pause/resume guests only

2013-04-12 Thread Michal Privoznik
On 12.04.2013 13:24, Thorsten Hesemeyer wrote: Hi all, for a shared desktop configuration, is there an option to grant the permission to start, stop, pause or resume the kvm guest only? Short answer: No. Long answer: No. This question pops up from time to time. Last time it emerged just two

Re: [libvirt] Google Summer of Code 2013 ideas wiki open

2013-04-15 Thread Michal Privoznik
On 15.04.2013 04:43, harryxiyou wrote: On Fri, Apr 12, 2013 at 11:29 PM, Stefan Hajnoczi stefa...@gmail.com wrote: On Fri, Apr 12, 2013 at 10:58 AM, Daniel P. Berrange berra...@redhat.com wrote: On Fri, Apr 12, 2013 at 08:34:18AM +0200, Michal Privoznik wrote: On 10.04.2013 15:13, harryxiyou

Re: [libvirt] [libvirt-designer PATCHv2] Add support for floppies and CDROMs

2013-04-18 Thread Michal Privoznik
On 03.04.2013 13:35, Christophe Fergeau wrote: This mirrors disk_file/disk_device API so that it's possible to add CDROMs and floppies to a GVirDesignerDomain. This also adds the corresponding -C/-F options to virtxml --- Here is a reworked version of my patch to add support for CDROMs

Re: [libvirt] [libvirt-designer 3/3] Rework disk bus type handling

2013-04-18 Thread Michal Privoznik
On 11.04.2013 14:36, Christophe Fergeau wrote: Hi, On Thu, Apr 11, 2013 at 01:33:50PM +0200, Michal Privoznik wrote: For some reason this patch cannot be applied cleanly: Applying: Rework disk bus type handling error: patch failed: libvirt-designer/libvirt-designer-domain.c:992 error

Re: [libvirt] [libvirt-designer 0/9] Handle more devices in GVirDesignerDomain

2013-04-18 Thread Michal Privoznik
On 17.04.2013 10:37, Christophe Fergeau wrote: Apart from danpb's comment in patch #3 which I've fixed locally, any more feedback/review on this series? Christophe Same applies here. I am unable to apply the patchset cleanly. Could you repost please? Michal -- libvir-list mailing list

[libvirt] [libvirt-designer][PATCH 1/2] cfg.mk: Update list of syntax-check exceptions

2013-04-19 Thread Michal Privoznik
The bindtextdomain syntax-check macro is doing some dumb checking: each file containing '\main *(' must call bindtextdomain. Even if it's mentioned inside a comment block, which we do as of e71ad8e13e7. --- Or shall we drop bindtextdomain rule instead? cfg.mk | 6 +++--- 1 file changed, 3

[libvirt] [libvirt-designer][PATCH 2/2] libvirt-designer-main.c: Re-indent function headers

2013-04-19 Thread Michal Privoznik
--- libvirt-designer/libvirt-designer-main.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libvirt-designer/libvirt-designer-main.c b/libvirt-designer/libvirt-designer-main.c index ce69024..07de8c1 100644 --- a/libvirt-designer/libvirt-designer-main.c +++

Re: [libvirt] [libvirt-designer PATCHv2 1/3] Add driver handling methods to GVirDesignerDomain

2013-04-19 Thread Michal Privoznik
On 18.04.2013 18:08, Christophe Fergeau wrote: They are useful to tell libvirt-designer about which drivers are install/will be installed in the OS associated with the domain. This in turns allows libvirt-designer code to use these devices when it's making some guesses about what to enable/not

Re: [libvirt] [libvirt-designer PATCHv2 3/3] Rework disk bus type handling

2013-04-19 Thread Michal Privoznik
On 18.04.2013 18:08, Christophe Fergeau wrote: The current handling of bus types has some issues: - it assumes that if the design uses a disk controller hanging off a PCI bus, then it can use virtio, which is not true for Windows for example unless an additional driver is installed - it

Re: [libvirt] [libvirt-designer PATCHv2 2/3] Add gvir_designer_domain_get_supported_devices()

2013-04-19 Thread Michal Privoznik
On 18.04.2013 18:08, Christophe Fergeau wrote: This method gathers the list of devices supported by the hypervisor, and intersects this list with the list of devices supported by the OS, natively or using a driver (added with gvir_designer_domain_add_driver()). The lists can be filtered if

[libvirt] [libvirt-designer][PATCH] test: Add new SimpleDisk test

2013-04-19 Thread Michal Privoznik
This test is meant for adding CDROM, floppy and disk to a domain. For now, each method has _file and _device variant, which are tested for now. --- libvirt-designer/test-designer-domain.c | 101 1 file changed, 101 insertions(+) diff --git

[libvirt] [PATCH v1 08/12] qemu: Rework qemuNetworkIfaceConnect

2013-04-22 Thread Michal Privoznik
For future work it's better, if tapfd is passed as pointer. Moreover, we need to be able to return multiple values now. --- src/qemu/qemu_command.c | 70 + src/qemu/qemu_command.h | 4 ++- src/qemu/qemu_hotplug.c | 4 +-- 3 files changed, 41

[libvirt] [PATCH v1 04/12] qemu: Make qemuMonitorAddHostNetwork to pass multiple FDs

2013-04-22 Thread Michal Privoznik
Currently, only one tapfd and one vhostfd could be passed. However, multiqueue network requires several FDs to be passed to qemu so we must adapt out monitor handling functions to cope with that. --- src/qemu/qemu_hotplug.c | 7 +-- src/qemu/qemu_monitor.c | 39

[libvirt] [PATCH v1 03/12] qemu: Make qemuMonitorAddHostNetwork to pass multiple FDs

2013-04-22 Thread Michal Privoznik
Currently, only one tapfd and one vhostfd could be passed. However, multiqueue network requires several FDs to be passed to qemu so we must adapt out monitor handling functions to cope with that. --- src/qemu/qemu_hotplug.c | 7 +-- src/qemu/qemu_monitor.c | 39

[libvirt] [PATCH v1 01/12] Introduce /domain/devices/interface/driver/@queues attribute

2013-04-22 Thread Michal Privoznik
This attribute is going to represent number of queues for multique vhost network interface. This commit implements XML extension part of the feature and add one test as well. For now, we can only do xml2xml test as qemu command line generation code is not adapted yet. ---

[libvirt] [PATCH v1 12/12] qemu: Enable multiqueue network

2013-04-22 Thread Michal Privoznik
--- src/qemu/qemu_command.c | 10 ++ src/qemu/qemu_hotplug.c | 5 +++-- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 60873c7..a7d422a 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -5887,12

[libvirt] [PATCH v1 06/12] util: Learn virNetDevTapCreate multiqueue network

2013-04-22 Thread Michal Privoznik
Currently, the function knows how to open a TAP device for a single time. However, in case of multiqueue network we need to open it multiple times. Moreover, when doing TUNSETIFF ioctl, the IFF_MULTI_QUEUE flag shall be requested. This commit changes a behaviour slightly as well. Till now it was

[libvirt] [PATCH v1 02/12] qemu: Move interface cmd line construction into a separate function

2013-04-22 Thread Michal Privoznik
Currently, we have one huge function to construct qemu command line. This is very ineffective esp. if there's a fault somewhere. --- src/qemu/qemu_command.c | 323 +--- 1 file changed, 171 insertions(+), 152 deletions(-) diff --git

<    1   2   3   4   5   6   7   8   9   10   >