Re: [libvirt] how to control usb read write perm

2013-04-25 Thread Guannan Ren
On 04/25/2013 11:15 AM, yue wrote: hi,all i have 2 questions. both is related to spice usb redirect. 1. if i can control RW perm of usb device which is producted via spice ? in order to control user's rw operation in guestVM . AFAIK currently, there is no such control on Read and

[libvirt] [PATCH v6 1/1] qemu: Add command line builder and parser for NVRAM.

2013-04-25 Thread Li Zhang
From: Li Zhang zhlci...@linux.vnet.ibm.com This patch is to add command line builder and parser for NVRAM device, and add test cases. Signed-off-by: Li Zhang zhlci...@linux.vnet.ibm.com --- v6 - v5: * Add test cases data files. src/qemu/qemu_capabilities.c | 3 +

Re: [libvirt] [PATCHv2] doc: Clarify usage of SELinux baselabel

2013-04-25 Thread Peter Krempa
On 04/25/13 00:22, Eric Blake wrote: On 04/24/2013 12:02 PM, Peter Krempa wrote: State what fields are used when generating SELinux labels from a baselabel. --- Notes: Version 2: - add reference to example docs/formatdomain.html.in | 12 ++-- 1 file changed, 10

Re: [libvirt] [PATCH v6 1/1] qemu: Add command line builder and parser for NVRAM.

2013-04-25 Thread Osier Yang
On 25/04/13 16:46, Li Zhang wrote: From: Li Zhangzhlci...@linux.vnet.ibm.com This patch is to add command line builder and parser for NVRAM device, and add test cases. Signed-off-by: Li Zhangzhlci...@linux.vnet.ibm.com --- v6 - v5: * Add test cases data files. Pushed with 1/2 together,

[libvirt] Virtual machine using the encrypted image fail to migrate by libvirt

2013-04-25 Thread yongcheng . wu
The qemu-kvm and libvirt migration process is as follows: e.g: migrate from VM1 to VM2 (1)virtual machine migration process by qemu-kvm (qemu-kvm-0.12.1.2-2.209.el6)is as follows: ==VM1 1.set password 2.continue ==VM2 3.start and wait for migration(--incoming) ==VM1 4.migrating

Re: [libvirt] [PATCHv4 5/5] qemu: auto-add bridges and allow using them

2013-04-25 Thread Ján Tomko
On 04/25/2013 02:39 AM, Eric Blake wrote: On 04/23/2013 06:47 AM, Ján Tomko wrote: @@ -1326,15 +1368,53 @@ qemuDomainAssignPCIAddresses(virDomainDefPtr def, qemuDomainObjPrivatePtr priv = NULL; if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE)) { +int max_idx = -1; So

Re: [libvirt] [PATCH v6 1/1] qemu: Add command line builder and parser for NVRAM.

2013-04-25 Thread Li Zhang
On 2013年04月25日 16:59, Osier Yang wrote: On 25/04/13 16:46, Li Zhang wrote: From: Li Zhangzhlci...@linux.vnet.ibm.com This patch is to add command line builder and parser for NVRAM device, and add test cases. Signed-off-by: Li Zhangzhlci...@linux.vnet.ibm.com --- v6 - v5: * Add test cases

Re: [libvirt] [PATCH] test: Add JSON test for query-tpm-types

2013-04-25 Thread Stefan Berger
On 04/22/2013 08:53 AM, Stefan Berger wrote: Add a test case for query-tpm-models QMP command. Signed-off-by: Stefan Berger stef...@linux.vnet.ibm.com Any comments on this patch? Stefan -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [PATCH v3 2/5] conf: add PCI controllers

2013-04-25 Thread Ján Tomko
On 04/22/2013 10:11 PM, Laine Stump wrote: On 04/22/2013 02:43 PM, Ján Tomko wrote: --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -2124,7 +2124,7 @@ p Each controller has a mandatory attribute codetype/code, which must be one of ide, fdc, scsi, sata,

Re: [libvirt] [PATCH v3 4/5] qemu: auto-add pci-root controller for pc machine types

2013-04-25 Thread Ján Tomko
On 04/22/2013 10:37 PM, Laine Stump wrote: On 04/22/2013 02:43 PM, Ján Tomko wrote: diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index a7aabdf..ab99538 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -673,6 +673,37 @@ qemuDomainDefPostParse(virDomainDefPtr

[libvirt] [PATCH] Fix usb master startport parsing

2013-04-25 Thread Martin Kletzander
When all usb controllers connected to the same bus have master startport='x'/ specified, none of them have 'id=usb' assigned and thus qemu fails due to invalid masterport specification (we use 'usb' for that purpose). Adding a check that at least one of the controllers is specified without master

Re: [libvirt] [PATCH] test: Add JSON test for query-tpm-types

2013-04-25 Thread Daniel P. Berrange
On Mon, Apr 22, 2013 at 08:53:24AM -0400, Stefan Berger wrote: Add a test case for query-tpm-models QMP command. Signed-off-by: Stefan Berger stef...@linux.vnet.ibm.com --- tests/qemumonitorjsontest.c | 55 1 file changed, 55 insertions(+)

Re: [libvirt] [PATCH] Fix usb master startport parsing

2013-04-25 Thread Daniel P. Berrange
On Thu, Apr 25, 2013 at 01:05:49PM +0200, Martin Kletzander wrote: When all usb controllers connected to the same bus have master startport='x'/ specified, none of them have 'id=usb' assigned and thus qemu fails due to invalid masterport specification (we use 'usb' for that purpose). Adding a

[libvirt] [PATCH] qemu_conf: Don't discard strdup OOM error

2013-04-25 Thread Michal Privoznik
After 78d7c3c5 we are strdup()-ing path to qemu-bridge-helper. However, the check for its return value is missing. So it is possible we've ignored the OOM error silently. --- src/qemu/qemu_conf.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_conf.c

[libvirt] [PATCH] conf: reject controllers with duplicate indexes

2013-04-25 Thread Ján Tomko
Reject multiple controllers with the same index, except for USB controllers. Multi-function USB controllers can have the same index. --- src/conf/domain_conf.c | 59 ++ 1 file changed, 59 insertions(+) diff --git a/src/conf/domain_conf.c

Re: [libvirt] [PATCH v3 0/5] qemu: add PCI bridge support

2013-04-25 Thread Ján Tomko
On 04/22/2013 08:43 PM, Ján Tomko wrote: Add new 'pci' controller type with two models: pci-root - auto-added to machines with implicit pci bus pci-bridge - auto-added if the devices would not leave at least one slot empty on bus 0 or bus 0 is specified v3: moved the implicit PCI root

Re: [libvirt] [PATCH] qemu_conf: Don't discard strdup OOM error

2013-04-25 Thread Osier Yang
On 25/04/13 19:37, Michal Privoznik wrote: After 78d7c3c5 we are strdup()-ing path to qemu-bridge-helper. However, the check for its return value is missing. So it is possible we've ignored the OOM error silently. --- src/qemu/qemu_conf.c | 3 ++- 1 file changed, 2 insertions(+), 1

[libvirt] Build failed in Jenkins: libvirt-syntax-check #905

2013-04-25 Thread Jenkins CI
See http://honk.sigxcpu.org:8001/job/libvirt-syntax-check/905/ -- Started by upstream project libvirt-build build number 1011 Building in workspace http://honk.sigxcpu.org:8001/job/libvirt-syntax-check/ws/ [workspace] $ /bin/sh -xe

[libvirt] [PATCH] qemu_command.c: Fix whitespacing within for()

2013-04-25 Thread Michal Privoznik
After 9d6e56db the syntax-check was unhappy due to wrong whitespacing: src/qemu/qemu_command.c:1637: for ( ; a.slot QEMU_PCI_ADDRESS_SLOT_LAST; a.slot++) { maint.mk: incorrect whitespace around brackets, see HACKING for rules make: *** [bracket-spacing-check] Error 1 --- Pushed under

[libvirt] [PATCH v2] Fix usb master startport parsing

2013-04-25 Thread Martin Kletzander
When all usb controllers connected to the same bus have master startport='x'/ specified, none of them have 'id=usb' assigned and thus qemu fails due to invalid masterport specification (we use 'usb' for that purpose). Adding a check that at least one of the controllers is specified without master

Re: [libvirt] [PATCH v3 5/5] qemu: auto-add bridges and allow using them

2013-04-25 Thread Michal Privoznik
On 22.04.2013 20:43, Ján Tomko wrote: Add a dry run address allocation to figure out how many bridges will be needed for all the devices without explicit addresses. Auto-add just enough bridges to put all the devices on, or up to the bridge with the largest specified index. ---

Re: [libvirt] [PATCH 2/7] qemu: Split out code to generate VNC command line

2013-04-25 Thread Christophe Fergeau
On Tue, Apr 23, 2013 at 03:46:09PM +0200, Peter Krempa wrote: Decrease size of qemuBuildGraphicsCommandLine() by splitting out spice-related code into qemuBuildGraphicsVNCCommandLine(). I guess you mean VNC-related code here. Christophe This patch also fixes 2 possible memory leaks on

[libvirt] Jenkins build is back to normal : libvirt-syntax-check #906

2013-04-25 Thread Jenkins CI
See http://honk.sigxcpu.org:8001/job/libvirt-syntax-check/906/ -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list

[libvirt] [PATCH] fix typo introduced by 90430791

2013-04-25 Thread Bamvor Jian Zhang
From: Bamvor Jian Zhang bamv2...@gmail.com Signed-off-by: Bamvor Jian Zhang bjzh...@suse.com --- src/node_device/node_device_hal.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/node_device/node_device_hal.c b/src/node_device/node_device_hal.c index 4a430dc..63245a9

[libvirt] [RFC] New CPU hotplug APIs

2013-04-25 Thread Peter Krempa
Hi upstream, I'd like to discuss the design of CPU modification related APIs before I start working on them. Qemu recently added support for modification of the state of the cpu using the guest agent and is also doing work on hot plug of cpus and possibly even hot unplug. This stuff will

Re: [libvirt] [PATCH 2/7] qemu: Split out code to generate VNC command line

2013-04-25 Thread Peter Krempa
On 04/25/13 12:34, Christophe Fergeau wrote: On Tue, Apr 23, 2013 at 03:46:09PM +0200, Peter Krempa wrote: Decrease size of qemuBuildGraphicsCommandLine() by splitting out spice-related code into qemuBuildGraphicsVNCCommandLine(). I guess you mean VNC-related code here. Ah, yes. I borrowed

Re: [libvirt] [PATCH v2] Fix usb master startport parsing

2013-04-25 Thread Daniel P. Berrange
On Thu, Apr 25, 2013 at 01:59:04PM +0200, Martin Kletzander wrote: When all usb controllers connected to the same bus have master startport='x'/ specified, none of them have 'id=usb' assigned and thus qemu fails due to invalid masterport specification (we use 'usb' for that purpose). Adding a

Re: [libvirt] [PATCH] test: Add JSON test for query-tpm-types

2013-04-25 Thread Stefan Berger
On 04/25/2013 07:06 AM, Daniel P. Berrange wrote: On Mon, Apr 22, 2013 at 08:53:24AM -0400, Stefan Berger wrote: Add a test case for query-tpm-models QMP command. Signed-off-by: Stefan Berger stef...@linux.vnet.ibm.com --- tests/qemumonitorjsontest.c | 55

Re: [libvirt] [PATCH v2] Fix usb master startport parsing

2013-04-25 Thread Martin Kletzander
On 04/25/2013 02:45 PM, Daniel P. Berrange wrote: On Thu, Apr 25, 2013 at 01:59:04PM +0200, Martin Kletzander wrote: When all usb controllers connected to the same bus have master startport='x'/ specified, none of them have 'id=usb' assigned and thus qemu fails due to invalid masterport

Re: [libvirt] [PATCH] test: Add JSON test for query-tpm-types

2013-04-25 Thread Daniel P. Berrange
On Thu, Apr 25, 2013 at 08:52:40AM -0400, Stefan Berger wrote: On 04/25/2013 07:06 AM, Daniel P. Berrange wrote: On Mon, Apr 22, 2013 at 08:53:24AM -0400, Stefan Berger wrote: Add a test case for query-tpm-models QMP command. Signed-off-by: Stefan Berger stef...@linux.vnet.ibm.com ---

[libvirt] [PATCH] qemu: auto-add pci-root to 'pc-i440*' machines too

2013-04-25 Thread Ján Tomko
Commit b33eb0d missed this machine type. --- src/qemu/qemu_domain.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 98ac56f..4e88eaf 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -687,6 +687,7 @@

Re: [libvirt] [PATCH] qemu: New XML to disable memory merge at guest startup

2013-04-25 Thread Eric Blake
On 04/17/2013 08:54 AM, Eric Blake wrote: On 04/17/2013 08:22 AM, Osier Yang wrote: QEMU introduced command line -mem-merge=on|off (defaults to on) to enable/disable the memory merge (KSM) at guest startup. This exposes it by new XML: memoryBacking nosharepages/ /memoryBacking The

Re: [libvirt] [PATCH] fix typo introduced by 90430791

2013-04-25 Thread Eric Blake
On 04/25/2013 06:17 AM, Bamvor Jian Zhang wrote: From: Bamvor Jian Zhang bamv2...@gmail.com Signed-off-by: Bamvor Jian Zhang bjzh...@suse.com --- src/node_device/node_device_hal.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) ACK and pushed. diff --git

Re: [libvirt] [PATCH] qemu: auto-add pci-root to 'pc-i440*' machines too

2013-04-25 Thread Eric Blake
On 04/25/2013 07:25 AM, Ján Tomko wrote: Commit b33eb0d missed this machine type. --- src/qemu/qemu_domain.c | 1 + 1 file changed, 1 insertion(+) ACK. diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 98ac56f..4e88eaf 100644 --- a/src/qemu/qemu_domain.c +++

Re: [libvirt] [PATCH] conf: reject controllers with duplicate indexes

2013-04-25 Thread Eric Blake
On 04/25/2013 05:41 AM, Ján Tomko wrote: Reject multiple controllers with the same index, except for USB controllers. Multi-function USB controllers can have the same index. --- Compared to the earlier version you posted as patch 6/5 on the pci patches, you changed to a stack allocation of

Re: [libvirt] [PATCH] qemu: New XML to disable memory merge at guest startup

2013-04-25 Thread Osier Yang
On 25/04/13 22:14, Eric Blake wrote: On 04/17/2013 08:54 AM, Eric Blake wrote: On 04/17/2013 08:22 AM, Osier Yang wrote: QEMU introduced command line -mem-merge=on|off (defaults to on) to enable/disable the memory merge (KSM) at guest startup. This exposes it by new XML: memoryBacking

Re: [libvirt] [PATCH] qemu: auto-add pci-root to 'pc-i440*' machines too

2013-04-25 Thread Ján Tomko
On 04/25/2013 04:19 PM, Eric Blake wrote: On 04/25/2013 07:25 AM, Ján Tomko wrote: Commit b33eb0d missed this machine type. --- src/qemu/qemu_domain.c | 1 + 1 file changed, 1 insertion(+) ACK. Thank you, I've pushed it now. Jan -- libvir-list mailing list libvir-list@redhat.com

Re: [libvirt] [PATCH] conf: reject controllers with duplicate indexes

2013-04-25 Thread Ján Tomko
On 04/25/2013 04:36 PM, Eric Blake wrote: On 04/25/2013 05:41 AM, Ján Tomko wrote: Reject multiple controllers with the same index, except for USB controllers. Multi-function USB controllers can have the same index. --- Compared to the earlier version you posted as patch 6/5 on the pci

[libvirt] libvirt_lxc start problem when selinux enbale

2013-04-25 Thread Huang,Chaochang
Hi,all: the problem came out when selinux was enforced in targeted+MCS I start lxc through virsh――“virsh -c lxc:/// start instance-4bd6” 1. When selinux is Permissive,lxc start is ok The result of “Ps auxZ” is: system_u:system_r:virtd_lxc_t:s0-s0:c0.c1023 root 19218

[libvirt] 答复: libvirt_lxc start problem when selinux enbale

2013-04-25 Thread Huang,Chaochang
Sorry “There is avc error messages in dmesg ……” ――should be “There is no avc error……” 发件人: Huang,Chaochang 发送时间: 2013年4月25日 15:41 收件人: 'libvir-list@redhat.com'; 'libvirt-us...@redhat.com' 主题: libvirt_lxc start problem when selinux enbale Hi,all: the problem came out when

[libvirt] Error in documentation about memory ballon

2013-04-25 Thread Alexandre Laurent
Hello, In Memory Ballon ( http://www.libvirt.org/formatdomain.html#elementsMemBalloon ) section, the second XML exemple has an error. Effectively, the documentation shows the following : ... devices watchdog model='virtio'/ address type='pci' domain='0x' bus='0x00' slot='0x02'

[libvirt] [PATCH] docs: fix memballoon examples

2013-04-25 Thread Ján Tomko
Use a pair of 'memballoon' tags instead of single 'watchdog' one. Add a few missing colons. --- Pushed under the trivial rule. docs/formatdomain.html.in | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index

[libvirt] [PATCH] qemu: fix build error with older glibc

2013-04-25 Thread Eric Blake
Jim Fehlig reported on IRC that older glibc triggers this warning: cc1: warnings being treated as errors qemu/qemu_domain.c: In function 'qemuDomainDefFormatBuf': qemu/qemu_domain.c:1297: error: declaration of 'remove' shadows a global declaration [-Wshadow] /usr/include/stdio.h:157: error:

Re: [libvirt] Error in documentation about memory ballon

2013-04-25 Thread Ján Tomko
On 04/25/2013 11:39 AM, Alexandre Laurent wrote: Hello, In Memory Ballon ( http://www.libvirt.org/formatdomain.html#elementsMemBalloon ) section, the second XML exemple has an error. Effectively, the documentation shows the following : ... devices watchdog model='virtio'/

[libvirt] [PATCH 8/8] qemu: set qemu process' RLIMIT_MEMLOCK when VFIO is used

2013-04-25 Thread Laine Stump
VFIO requires all of the guest's memory and IO space to be lockable in RAM. The domain's max_balloon is the maximum amount of memory the domain can have (in KiB). We add a generous 1GiB to that for IO space (still much better than KVM device assignment, where the KVM module actually *ignores* the

[libvirt] [PATCH 2/8] security: update hostdev labelling functions for VFIO

2013-04-25 Thread Laine Stump
Legacy kvm style pci device assignment requires changes to the labelling of several sysfs files for each device, but for vfio device assignment, the only thing that needs to be relabelled/chowned is the group device for the group that contains the device to be assigned. ---

[libvirt] [PATCH 5/8] qemu: use vfio-pci on commandline when appropriate

2013-04-25 Thread Laine Stump
The device option for vfio-pci is nearly identical to that for pci-assign - only the configfd parameter isn't supported (or needed). Checking for presence of the bootindex parameter is done separately from constructing the commandline, similar to how it is done for pci-assign. ---

[libvirt] [PATCH 0/8] VDIO support part 3

2013-04-25 Thread Laine Stump
This *almost* completes VFIO support. I still need to add a couple of xml/args test cases. Laine Stump (8): util: new function virPCIDeviceGetVFIOGroupDev security: update hostdev labelling functions for VFIO qemu: add VFIO devices to cgroup ACL qemu: add QEMU_CAPS_VFIO_PCI_BOOTINDEX

[libvirt] [PATCH 7/8] qemu: use new virCommandSetMax(Processes|Files)

2013-04-25 Thread Laine Stump
These were previously being set in a custom hook function, but now that virCommand directly supports setting them, we can eliminate that part of the hook and call the APIs directly. --- src/qemu/qemu_process.c | 38 ++ 1 file changed, 2 insertions(+), 36

[libvirt] [PATCH 3/8] qemu: add VFIO devices to cgroup ACL

2013-04-25 Thread Laine Stump
We don't know exactly the names of the VFIO devices that will be needed (and due to hotplug, we can't ever assume we won't need them at all), so we just add an ACL to allow any vfio device - they all have the major number 244 (/dev/vfio/vfio is 244,0, and the /dev/vfio/n devices are up from

[libvirt] [PATCH 1/8] util: new function virPCIDeviceGetVFIOGroupDev

2013-04-25 Thread Laine Stump
Given a virPCIDevice, this function returns the path for the device that controls the vfio group the device belongs to, e.g. /dev/vfio/15. --- src/libvirt_private.syms | 1 + src/util/virpci.c| 34 ++ src/util/virpci.h| 2 ++ 3 files changed, 37

[libvirt] [PATCH 6/8] util: new virCommandSetMax(MemLock|Processes|Files)

2013-04-25 Thread Laine Stump
This patch adds two sets of functions: 1) lower level functions that will immediately set the RLIMIT_MEMLOCK. RLIMIT_NPROC, or RLIMIT_NOFILE of either the current process (using setrlimit()) or any other process (using prlimit()). 2) functions for virCommand* that will setup a virCommand object

[libvirt] [PATCH 4/8] qemu: add QEMU_CAPS_VFIO_PCI_BOOTINDEX

2013-04-25 Thread Laine Stump
For some reason, the bootindex parameter wasn't included in early versions of vfio support (qemu 1.4) so we have to check for it separately from vfio itself. --- src/qemu/qemu_capabilities.c | 7 +++ src/qemu/qemu_capabilities.h | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff

[libvirt] [PATCH 9/8] qemu: xml/args tests for VFIO hostdev and interface type='hostdev'/

2013-04-25 Thread Laine Stump
These should be squashed in with the patch that adds commandline handling of vfio (they would fail at any earlier time). --- .../qemuxml2argv-hostdev-vfio.args | 5 +++ .../qemuxml2argvdata/qemuxml2argv-hostdev-vfio.xml | 33 +

Re: [libvirt] [PATCH-v4 2/2] Support for static routes on a virtual bridge

2013-04-25 Thread Gene Czarcinski
On 04/22/2013 11:59 AM, Laine Stump wrote: address should be optional unless prefix or netmask is non-0, although I've now noticed that won't be handled properly due to virSocketAddrGetIpPrefix returning -1 when there is no address or prefix or netmask (I'm fixing that before I push that patch,

Re: [libvirt] [PATCH 6/8] util: new virCommandSetMax(MemLock|Processes|Files)

2013-04-25 Thread Daniel P. Berrange
On Thu, Apr 25, 2013 at 01:57:56PM -0400, Laine Stump wrote: diff --git a/src/util/virutil.c b/src/util/virutil.c index b9de33c..058a069 100644 --- a/src/util/virutil.c +++ b/src/util/virutil.c @@ -38,6 +38,10 @@ #include sys/types.h #include sys/ioctl.h #include sys/wait.h +#if

[libvirt] [PATCH 1/2] Improve /domainsnapshot/disks/disk@snapshot doc

2013-04-25 Thread Christophe Fergeau
The previous description was a bit confusing. --- docs/formatsnapshot.html.in | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/formatsnapshot.html.in b/docs/formatsnapshot.html.in index 8fcc04c..b1e259f 100644 --- a/docs/formatsnapshot.html.in +++

[libvirt] Two trivial doc patches

2013-04-25 Thread Christophe Fergeau
Hey, I've just pushed these 2 patches under the trivial/doc rule. Christophe -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [PATCH 1/8] util: new function virPCIDeviceGetVFIOGroupDev

2013-04-25 Thread Eric Blake
On 04/25/2013 11:57 AM, Laine Stump wrote: Given a virPCIDevice, this function returns the path for the device that controls the vfio group the device belongs to, e.g. /dev/vfio/15. --- +if (virAsprintf(groupDev, /dev/vfio/%s, basename(groupPath)) 0) { We shouldn't be using basename()

Re: [libvirt] [PATCH 6/8] util: new virCommandSetMax(MemLock|Processes|Files)

2013-04-25 Thread Laine Stump
On 04/25/2013 03:27 PM, Daniel P. Berrange wrote: Since these functions all take pid_t as their first arg, they should all be named virProcessX and be located in virprocess.{c,h} rather than virutil.{c,h} Yes, of course! The thought Move it somewhere else! was trying to come to my mind

Re: [libvirt] [PATCH-v4 2/2] Support for static routes on a virtual bridge

2013-04-25 Thread Gene Czarcinski
On 04/25/2013 03:13 PM, Gene Czarcinski wrote: On 04/22/2013 11:59 AM, Laine Stump wrote: address should be optional unless prefix or netmask is non-0, although I've now noticed that won't be handled properly due to virSocketAddrGetIpPrefix returning -1 when there is no address or prefix or

[libvirt] [PATCH] build: avoid unsafe functions in libgen.h

2013-04-25 Thread Eric Blake
POSIX says that both basename() and dirname() may return static storage (aka they are not thread-safe); and that they may but not must modify their input argument. Furthermore, libgen.h is not available on all platforms. For these reasons, you should never use these functions in a multi-threaded

Re: [libvirt] [PATCH-v4 2/2] Support for static routes on a virtual bridge

2013-04-25 Thread Eric Blake
On 04/25/2013 02:13 PM, Gene Czarcinski wrote: It is getting real close and it should be ready real soon now ;)) AAGH With IPv4 using address='0.0.0.0' and netmask='0.0.0.0' things work just fine but with prefix not so much. The problem is that with prefix=0, it is not in the xml

Re: [libvirt] [PATCH-v4 2/2] Support for static routes on a virtual bridge

2013-04-25 Thread Laine Stump
On 04/25/2013 04:13 PM, Gene Czarcinski wrote: On 04/25/2013 03:13 PM, Gene Czarcinski wrote: On 04/22/2013 11:59 AM, Laine Stump wrote: address should be optional unless prefix or netmask is non-0, although I've now noticed that won't be handled properly due to virSocketAddrGetIpPrefix

Re: [libvirt] [PATCH] build: avoid unsafe functions in libgen.h

2013-04-25 Thread Laine Stump
On 04/25/2013 04:30 PM, Eric Blake wrote: POSIX says that both basename() and dirname() may return static storage (aka they are not thread-safe); and that they may but not must modify their input argument. Furthermore, libgen.h is not available on all platforms. For these reasons, you should

Re: [libvirt] [PATCH 3/8] qemu: add VFIO devices to cgroup ACL

2013-04-25 Thread Eric Blake
On 04/25/2013 11:57 AM, Laine Stump wrote: We don't know exactly the names of the VFIO devices that will be needed (and due to hotplug, we can't ever assume we won't need them at all), so we just add an ACL to allow any vfio device - they all have the major number 244 (/dev/vfio/vfio is 244,0,

Re: [libvirt] [PATCH 4/8] qemu: add QEMU_CAPS_VFIO_PCI_BOOTINDEX

2013-04-25 Thread Eric Blake
On 04/25/2013 11:57 AM, Laine Stump wrote: For some reason, the bootindex parameter wasn't included in early versions of vfio support (qemu 1.4) so we have to check for it separately from vfio itself. --- src/qemu/qemu_capabilities.c | 7 +++ src/qemu/qemu_capabilities.h | 2 +- 2

Re: [libvirt] [PATCH 5/8] qemu: use vfio-pci on commandline when appropriate

2013-04-25 Thread Eric Blake
On 04/25/2013 11:57 AM, Laine Stump wrote: The device option for vfio-pci is nearly identical to that for pci-assign - only the configfd parameter isn't supported (or needed). Checking for presence of the bootindex parameter is done separately from constructing the commandline, similar to

Re: [libvirt] [PATCH] build: avoid unsafe functions in libgen.h

2013-04-25 Thread Eric Blake
On 04/25/2013 02:41 PM, Laine Stump wrote: On 04/25/2013 04:30 PM, Eric Blake wrote: POSIX says that both basename() and dirname() may return static storage (aka they are not thread-safe); and that they may but not must modify their input argument. Furthermore, libgen.h is not available on

Re: [libvirt] [PATCH 2/8] security: update hostdev labelling functions for VFIO

2013-04-25 Thread Eric Blake
On 04/25/2013 11:57 AM, Laine Stump wrote: Legacy kvm style pci device assignment requires changes to the labelling of several sysfs files for each device, but for vfio device assignment, the only thing that needs to be relabelled/chowned is the group device for the group that contains the

Re: [libvirt] [PATCH 6/8] util: new virCommandSetMax(MemLock|Processes|Files)

2013-04-25 Thread Eric Blake
On 04/25/2013 11:57 AM, Laine Stump wrote: This patch adds two sets of functions: 1) lower level functions that will immediately set the RLIMIT_MEMLOCK. RLIMIT_NPROC, or RLIMIT_NOFILE of either the current process (using setrlimit()) or any other process (using prlimit()). 2) functions

Re: [libvirt] [PATCH 7/8] qemu: use new virCommandSetMax(Processes|Files)

2013-04-25 Thread Eric Blake
On 04/25/2013 11:57 AM, Laine Stump wrote: These were previously being set in a custom hook function, but now that virCommand directly supports setting them, we can eliminate that part of the hook and call the APIs directly. --- src/qemu/qemu_process.c | 38

Re: [libvirt] [PATCH 8/8] qemu: set qemu process' RLIMIT_MEMLOCK when VFIO is used

2013-04-25 Thread Eric Blake
On 04/25/2013 11:57 AM, Laine Stump wrote: VFIO requires all of the guest's memory and IO space to be lockable in RAM. The domain's max_balloon is the maximum amount of memory the domain can have (in KiB). We add a generous 1GiB to that for IO space (still much better than KVM device

Re: [libvirt] [PATCH 9/8] qemu: xml/args tests for VFIO hostdev and interface type='hostdev'/

2013-04-25 Thread Eric Blake
On 04/25/2013 12:37 PM, Laine Stump wrote: These should be squashed in with the patch that adds commandline handling of vfio (they would fail at any earlier time). --- .../qemuxml2argv-hostdev-vfio.args | 5 +++ .../qemuxml2argvdata/qemuxml2argv-hostdev-vfio.xml | 33

Re: [libvirt] [PATCH 1/8] util: new function virPCIDeviceGetVFIOGroupDev

2013-04-25 Thread Laine Stump
On 04/25/2013 04:06 PM, Eric Blake wrote: On 04/25/2013 11:57 AM, Laine Stump wrote: Given a virPCIDevice, this function returns the path for the device that controls the vfio group the device belongs to, e.g. /dev/vfio/15. --- +if (virAsprintf(groupDev, /dev/vfio/%s,

Re: [libvirt] [PATCH 5/8] qemu: use vfio-pci on commandline when appropriate

2013-04-25 Thread Laine Stump
On 04/25/2013 05:07 PM, Eric Blake wrote: On 04/25/2013 11:57 AM, Laine Stump wrote: The device option for vfio-pci is nearly identical to that for pci-assign - only the configfd parameter isn't supported (or needed). Checking for presence of the bootindex parameter is done separately from

Re: [libvirt] [PATCH 8/8] qemu: set qemu process' RLIMIT_MEMLOCK when VFIO is used

2013-04-25 Thread Laine Stump
On 04/25/2013 06:14 PM, Eric Blake wrote: On 04/25/2013 11:57 AM, Laine Stump wrote: VFIO requires all of the guest's memory and IO space to be lockable in RAM. The domain's max_balloon is the maximum amount of memory the domain can have (in KiB). We add a generous 1GiB to that for IO space

Re: [libvirt] [PATCH 0/8] VFIO support part 3

2013-04-25 Thread Laine Stump
On 04/25/2013 01:57 PM, Laine Stump wrote: This *almost* completes VFIO support. I still need to add a couple of xml/args test cases. I actually added the test cases as a separate patch in this series, but then squashed them into the earlier patch that constructs a qemu commandline with vfio

[libvirt] [PATCH 4/4] qemu: add VFIO devices to cgroup ACL

2013-04-25 Thread Laine Stump
We don't know exactly the names of the VFIO devices that will be needed (and due to hotplug, we can't ever assume we won't need them at all), so we just add an ACL to allow any vfio device - they all have the major number 244 (/dev/vfio/vfio is 244,0, and the /dev/vfio/n devices are up from

[libvirt] [PATCH 2/4] qemu: use new virCommandSetMax(Processes|Files)

2013-04-25 Thread Laine Stump
These were previously being set in a custom hook function, but now that virCommand directly supports setting them, we can eliminate that part of the hook and call the APIs directly. --- src/qemu/qemu_process.c | 38 ++ 1 file changed, 2 insertions(+), 36

[libvirt] [PATCH 0/4] Remaining patches from VFIO series

2013-04-25 Thread Laine Stump
I've pushed everything else from all 3 VFIO series. Patch 1/4 in this series had questions from Eric about whether it is the right way to go, or if we want to do something more limited: https://www.redhat.com/archives/libvir-list/2013-April/msg01864.html Eric and danpb had both raised issues

[libvirt] [PATCH 3/4] qemu: set qemu process' RLIMIT_MEMLOCK when VFIO is used

2013-04-25 Thread Laine Stump
VFIO requires all of the guest's memory and IO space to be lockable in RAM. The domain's max_balloon is the maximum amount of memory the domain can have (in KiB). We add a generous 1GiB to that for IO space (still much better than KVM device assignment, where the KVM module actually *ignores* the

[libvirt] [PATCH 1/4] util: new virCommandSetMax(MemLock|Processes|Files)

2013-04-25 Thread Laine Stump
This patch adds two sets of functions: 1) lower level virProcessSet*() functions that will immediately set the RLIMIT_MEMLOCK. RLIMIT_NPROC, or RLIMIT_NOFILE of either the current process (using setrlimit()) or any other process (using prlimit()). current process is indicated by passing a 0 for

Re: [libvirt] [PATCH 0/7] VFIO support part 2

2013-04-25 Thread Laine Stump
On 04/24/2013 03:26 PM, Laine Stump wrote: More patches to go on top of the 3 patches yesterday. These patches add a new API that I just learned was necessary - virNodeDeviceDetachFlags() (explanation in patches), implement it for xen and qemu, and use it in virsh. Laine Stump (7): pci:

Re: [libvirt] [PATCH 0/3] start of patches to support VFIO device assignment

2013-04-25 Thread Laine Stump
On 04/23/2013 12:45 PM, Laine Stump wrote: This work isn't finished, but since there's a freeze coming up in a few days, I thought I should send these patches that *are* finished to get them out of the way before the last minute rush. Patch 1 is trivial. Patch 2 is longer, but completely

[libvirt] [libvirt-perl][PATCH] Fix typo in domain help page

2013-04-25 Thread Zhe Peng
The help page of $dom-set_metadata have a typo,this patch fix it. --- lib/Sys/Virt/Domain.pm |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/lib/Sys/Virt/Domain.pm b/lib/Sys/Virt/Domain.pm index a502029..053f127 100644 --- a/lib/Sys/Virt/Domain.pm +++

[libvirt] [question] Why doesn't virsh command support an optional parameter

2013-04-25 Thread Zhang Xiaohe
hi guys, It's hard for me to understand why doesn't virsh command support an optional parameter because I think omitting a parameter and offering a default value sometimes is quite convenient. For example: $ virsh shutdown guest --mode acpi The option --mode only accept string acpi, agent,

Re: [libvirt] [question] Why doesn't virsh command support an optional parameter

2013-04-25 Thread Eric Blake
On 04/25/2013 09:19 PM, Zhang Xiaohe wrote: hi guys, It's hard for me to understand why doesn't virsh command support an optional parameter because I think omitting a parameter and offering a default value sometimes is quite convenient. For example: $ virsh shutdown guest --mode acpi

Re: [libvirt] [question] Why doesn't virsh command support an optional parameter

2013-04-25 Thread Zhang Xiaohe
于 2013年04月26日 11:35, Eric Blake 写道: On 04/25/2013 09:19 PM, Zhang Xiaohe wrote: hi guys, It's hard for me to understand why doesn't virsh command support an optional parameter because I think omitting a parameter and offering a default value sometimes is quite convenient. For example: $ virsh