[libvirt] [PATCH 0/3] fix some issue around host-passthough cpu model

2015-03-30 Thread Luyao Huang
We support add feature in host-passthough cpu model, but there are some place need fix. Luyao Huang (3): cpu:x86: fix cannot keep cpu feature after migrate/restore qemu: add a check for non-migratable cpu flags docs: fix a small xml error in docs docs/formatdomain.html.in | 2 +-

[libvirt] [PATCH 1/3] cpu:x86: fix cannot keep cpu feature after migrate/restore

2015-03-30 Thread Luyao Huang
https://bugzilla.redhat.com/show_bug.cgi?id=1207095 When we set feature when cpu model is host-passthrough and start the vm, we can see these settings in the XML, however after migrate/restore these flags will be covered by host cpu models. As cpu model host-passthrough can set feature by users

Re: [libvirt] [RFC] Add uptime to API returning Dom Info

2015-03-30 Thread Peter Krempa
On Mon, Mar 30, 2015 at 13:26:40 +0530, Nehal J Wani wrote: On Mon, Mar 30, 2015 at 1:16 PM, Peter Krempa pkre...@redhat.com wrote: On Mon, Mar 30, 2015 at 03:29:40 +0530, Nehal J Wani wrote: This is an attempt to fix: https://bugzilla.redhat.com/show_bug.cgi?id=812911 Calculate vm

[libvirt] [PATCH4/3] qemu: add cpu feature check for host-passthrough

2015-03-30 Thread Luyao Huang
Signed-off-by: Luyao Huang lhu...@redhat.com --- I forgot this place. src/qemu/qemu_process.c | 5 - 1 file changed, 5 deletions(-) diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 79f763e..5f418a9 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@

[libvirt] [PATCH 2/3] qemu: Extract internals of processBlockJobEvent into a helper

2015-03-30 Thread Peter Krempa
Later on I'll be adding a condition that will allow to synchronise a SYNC block job abort. The approach will require this code to be called from two different places so it has to be extracted into a helper. --- src/qemu/qemu_driver.c | 200 + 1 file

[libvirt] [PATCH 0/3] For 1.2.14: Fix regression in synchronous block job ABORT/PIVOT

2015-03-30 Thread Peter Krempa
When a block job is terminated via the synchronous API the backing chain would be updated in a separate thread and thus allowed applications to get outdated data. This broke live snapshot merge on oVirt. Since the commit breaking this (see patch 3/3) was not released yet I'm asking to merge this

[libvirt] [PATCH 1/3] qemu: processBlockJob: Don't unlock @vm twice

2015-03-30 Thread Peter Krempa
Commit 1a92c719 moved code to handle block job events to a different function that is executed in a separate thread. The caller of processBlockJob handles locking and unlocking of @vm, so the we should not do it in the function itself. --- src/qemu/qemu_driver.c | 1 - 1 file changed, 1

[libvirt] [PATCH 3/3] qemu: blockjob: Synchronously update backing chain in XML on ABORT/PIVOT

2015-03-30 Thread Peter Krempa
When the synchronous pivot option is selected, libvirt would not update the backing chain until the job was exitted. Some applications then received invalid data as their job serialized first. This patch removes polling to wait for the ABORT/PIVOT job completion and replaces it with a condition.

Re: [libvirt] [RFC] Add uptime to API returning Dom Info

2015-03-30 Thread Peter Krempa
On Mon, Mar 30, 2015 at 03:29:40 +0530, Nehal J Wani wrote: This is an attempt to fix: https://bugzilla.redhat.com/show_bug.cgi?id=812911 Calculate vm uptime by subtracting process starttime from system uptime: Almost equivalent to: echo $(($(($(awk '{print $1}' /proc/uptime)*1e9 - $(($(cut

Re: [libvirt] [RFC] Add uptime to API returning Dom Info

2015-03-30 Thread Nehal J Wani
On Mon, Mar 30, 2015 at 1:16 PM, Peter Krempa pkre...@redhat.com wrote: On Mon, Mar 30, 2015 at 03:29:40 +0530, Nehal J Wani wrote: This is an attempt to fix: https://bugzilla.redhat.com/show_bug.cgi?id=812911 Calculate vm uptime by subtracting process starttime from system uptime: Almost

[libvirt] [PATCH 2/3] qemu: add a check for non-migratable cpu flags

2015-03-30 Thread Luyao Huang
If user set this feature in vm xml: cpu mode='host-passthrough' feature policy='require' name='invtsc'/ /cpu we won't report error when do migrate. So remove def-cpu-mode check, because we can set feature for host-passthrough model now. Signed-off-by: Luyao Huang lhu...@redhat.com ---

[libvirt] [PATCH 3/3] docs: fix a small xml error in docs

2015-03-30 Thread Luyao Huang
Signed-off-by: Luyao Huang lhu...@redhat.com --- docs/formatdomain.html.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index 1b496c3..577d647 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@

Re: [libvirt] [openstack-dev] [nova] The risk of hanging when shutdown instance.

2015-03-30 Thread zhang bo
On 2015/3/28 18:06, Rui Chen wrote: Thank you for reply, Chris. 2015-03-27 23:15 GMT+08:00 Chris Friesen chris.frie...@windriver.com mailto:chris.frie...@windriver.com: On 03/26/2015 07:44 PM, Rui Chen wrote: Yes, you are right, but we found our instance hang at first

Re: [libvirt] [PATCH 5/6] qemuProcessHook: Call virNuma*() iff needed

2015-03-30 Thread Ján Tomko
On Fri, Mar 27, 2015 at 03:26:53PM +0100, Michal Privoznik wrote: Once upon a time, there was a little domain. And the domain was pinned onto a NUMA node and hasn't fully allocated its memory: memory unit='KiB'2355200/memory currentMemory unit='KiB'1048576/currentMemory numatune

Re: [libvirt] [PATCH 6/7] storage: Introduce storagePoolUpdateAllState function

2015-03-30 Thread Erik Skultety
On 03/25/2015 06:42 PM, John Ferlan wrote: the 'checkPool' block has been moved to storagePoolUpdateAllState. move the checkPool block into storageDriverInitialize. This ensures activating pools earlier allowing domains using volumes from a pool to be able to find the volume during

Re: [libvirt] [openstack-dev] [nova] The risk of hanging when shutdown instance.

2015-03-30 Thread Michal Privoznik
On 30.03.2015 11:28, zhang bo wrote: On 2015/3/28 18:06, Rui Chen wrote: snip/ The API virDomainShutdown's description is out of date, it's not correct. In fact, virDomainShutdown would block or not, depending on its mode. If it's in mode *agent*, then it would be blocked until qemu

Re: [libvirt] [PATCH] Strip control codes in virBufferEscapeString

2015-03-30 Thread Pavel Hrdina
On Mon, Mar 30, 2015 at 01:02:49PM +0200, Ján Tomko wrote: These cannot be represented in XML. We have been stripping them, but only if the string had characters that needed escaping: ' Extend the strcspn check to include control codes, and strip them even if we don't do any escaping.

Re: [libvirt] [PATCH] Strip control codes in virBufferEscapeString

2015-03-30 Thread Eric Blake
On 03/30/2015 05:02 AM, Ján Tomko wrote: These cannot be represented in XML. Yes they can, via entities. DV would know for sure, but I think that #x01; is the entity for the C byte '\1'. We have been stripping them, but only if the string had characters that needed escaping: ' Extend

Re: [libvirt] [PATCH 0/6] Few NUMA fixes

2015-03-30 Thread Ján Tomko
On Fri, Mar 27, 2015 at 03:26:48PM +0100, Michal Privoznik wrote: The heart of the patchset are the last two patches. Long story short, if a domain is configured to be pinned onto a set of NUMA nodes stricly, we use both CGroups and numa_set_membind(). While we can change the former later on a

Re: [libvirt] [PATCH 5/6] qemuProcessHook: Call virNuma*() iff needed

2015-03-30 Thread Michal Privoznik
On 30.03.2015 15:15, Ján Tomko wrote: On Fri, Mar 27, 2015 at 03:26:53PM +0100, Michal Privoznik wrote: Once upon a time, there was a little domain. And the domain was pinned onto a NUMA node and hasn't fully allocated its memory: memory unit='KiB'2355200/memory currentMemory

Re: [libvirt] [Xen-devel] [PATCH 0/3] libxl: domain destroy fixes

2015-03-30 Thread Anthony PERARD
On Wed, Mar 25, 2015 at 02:08:33PM -0600, Jim Fehlig wrote: This small series of patches fixes some issues wrt domain destroy in the libxl driver. The primary motivation for this work is to prevent locking the virDomainObj during long running destroy operations on large memory domains.

Re: [libvirt] [PATCH] Strip control codes in virBufferEscapeString

2015-03-30 Thread Ján Tomko
On Mon, Mar 30, 2015 at 07:06:45AM -0600, Eric Blake wrote: On 03/30/2015 05:02 AM, Ján Tomko wrote: These cannot be represented in XML. Yes they can, via entities. DV would know for sure, but I think that #x01; is the entity for the C byte '\1'. Only in XML 1.1. For XML 1.0:

[libvirt] ceph rbd key

2015-03-30 Thread Raymond Durand
Is there a way that qemu takes the key of ceph rbd from a file rather than reading it from the file cinder.conf? Going from something like rbd_secret_uuid=UUID key to something like rbd_secret_uuid=/path/to/key (to restrict the access rights to the file and avoid the secret_uuid to be readable

Re: [libvirt] [PATCH] interface: allow multiple IPv4 addresses in interface XML

2015-03-30 Thread Martin Kletzander
On Thu, Mar 26, 2015 at 08:18:07PM -0400, Laine Stump wrote: An upcoming netcf release will support multiple ipv4 addresses, so let's loosen up libvirt's interface.rng to allow it. --- docs/schemas/interface.rng | 14 -- 1 file changed, 8 insertions(+), 6 deletions(-) ACK after

[libvirt] [PATCH] virDomainShutdown*: Describe blocking behaviour

2015-03-30 Thread Michal Privoznik
The description to both virDomainShutdown() and virDomainShutdownFlags() is quite misleading when it comes to blocking behaviour of these two APIs. Firstly, we support many shutdown methods, from signalizing an ACPI event, through sending a signal to guest agent assisted shutdown. Some of these

[libvirt] [PATCH] Strip control codes in virBufferEscapeString

2015-03-30 Thread Ján Tomko
These cannot be represented in XML. We have been stripping them, but only if the string had characters that needed escaping: ' Extend the strcspn check to include control codes, and strip them even if we don't do any escaping. https://bugzilla.redhat.com/show_bug.cgi?id=1184131

Re: [libvirt] [PATCH] virsh: fix forget jump to clean up when set a big bandwidth

2015-03-30 Thread Peter Krempa
On Fri, Mar 27, 2015 at 17:56:29 +0800, Luyao Huang wrote: We already have a check for this, just add a jump to cleanup and change to use vshError instead of virReportError. Signed-off-by: Luyao Huang lhu...@redhat.com --- tools/virsh-domain.c | 5 ++--- 1 file changed, 2 insertions(+),

[libvirt] [PATCH] qemu: blockCopy: Pass adjusted bandwidth when called via blockRebase

2015-03-30 Thread Peter Krempa
The block copy API takes the speed in bytes/s rather than MiB/s that was the prior approach in virDomainBlockRebase. We correctly converted the speed to bytes/s in the old API but we still called the common helper virDomainBlockCopyCommon with the unadjusted variable. Resolves:

Re: [libvirt] [PATCH] Strip control codes in virBufferEscapeString

2015-03-30 Thread Eric Blake
On 03/30/2015 09:50 AM, Daniel Veillard wrote: NACK. Stripping control codes from a volume name represents the wrong name. We need to escape the problematic bytes, rather than strip them. you can't escape them with a CharRef for sure http://www.w3.org/TR/REC-xml/#wf-Legalchar

Re: [libvirt] [PATCH] qemu: blockCopy: Pass adjusted bandwidth when called via blockRebase

2015-03-30 Thread Peter Krempa
On Mon, Mar 30, 2015 at 10:54:14 -0600, Eric Blake wrote: On 03/30/2015 09:41 AM, Peter Krempa wrote: The block copy API takes the speed in bytes/s rather than MiB/s that was the prior approach in virDomainBlockRebase. We correctly converted the speed to bytes/s in the old API but we still

Re: [libvirt] [PATCH] Strip control codes in virBufferEscapeString

2015-03-30 Thread Cole Robinson
On 03/30/2015 12:56 PM, Eric Blake wrote: On 03/30/2015 09:50 AM, Daniel Veillard wrote: NACK. Stripping control codes from a volume name represents the wrong name. We need to escape the problematic bytes, rather than strip them. you can't escape them with a CharRef for sure

Re: [libvirt] [PATCH] qemu: blockCopy: Pass adjusted bandwidth when called via blockRebase

2015-03-30 Thread Eric Blake
On 03/30/2015 09:41 AM, Peter Krempa wrote: The block copy API takes the speed in bytes/s rather than MiB/s that was the prior approach in virDomainBlockRebase. We correctly converted the speed to bytes/s in the old API but we still called the common helper virDomainBlockCopyCommon with the

Re: [libvirt] [PATCH 2/2] conf: Rename virDomainHasDiskMirror and detect block jobs properly

2015-03-30 Thread Eric Blake
On 03/30/2015 12:50 PM, Peter Krempa wrote: From: Shanzhi Yu s...@redhat.com virDomainHasDiskMirror() currently detects only jobs that add the mirror elements. Since some operations like migration are interlocked by existing block jobs on the given domain the check needs to be instrumented

Re: [libvirt] Entering freeze for libvirt-1.2.14

2015-03-30 Thread Peter Krempa
On Fri, Mar 27, 2015 at 12:12:42 +0800, Daniel Veillard wrote: I have tagged a release candidate 1 in git and generated signed tarballs and rpms at the usual place: ftp://libvirt.org/libvirt/ This seems to work normally in my limited testing but others need to give it a serious try

[libvirt] [PATCHv2] qemu: Fix issues with maxMemory in qemuDomainSetMemoryFlags()

2015-03-30 Thread Peter Krempa
From: Luyao Huang lhu...@redhat.com qemuDomainSetMemoryFlags() would allow to set the initial memory greater than the maxMemory field. While the configuration would not work as memory hotplug requires NUMA to be enabled and the qemuDomainSetMemoryFlags() API does not work on NUMA guests this just

Re: [libvirt] [Xen-devel] [PATCH 0/3] libxl: domain destroy fixes

2015-03-30 Thread Jim Fehlig
Jim Fehlig wrote: Konrad Rzeszutek Wilk wrote: On Wed, Mar 25, 2015 at 02:08:33PM -0600, Jim Fehlig wrote: This small series of patches fixes some issues wrt domain destroy in the libxl driver. The primary motivation for this work is to prevent locking the virDomainObj during

Re: [libvirt] [PATCH 1/2] qemu: snapshot: Check for block jobs individually

2015-03-30 Thread Eric Blake
On 03/30/2015 12:50 PM, Peter Krempa wrote: If any disk of a VM was involved in a (copy) block job we refused to do a snapshot. As not only copy jobs interlock snapshots and the interlocking is applicable to individual disks only we can make the check in a more individual fashion and interlock

[libvirt] [PATCH 0/2] qemu: Finish fixing of interlocking domain ops with blockjobs

2015-03-30 Thread Peter Krempa
Peter Krempa (1): qemu: snapshot: Check for block jobs individually Shanzhi Yu (1): conf: Rename virDomainHasDiskMirror and detect block jobs properly src/conf/domain_conf.c| 25 - src/conf/domain_conf.h| 3 ++- src/libvirt_private.syms | 2 +-

[libvirt] [PATCH 2/2] conf: Rename virDomainHasDiskMirror and detect block jobs properly

2015-03-30 Thread Peter Krempa
From: Shanzhi Yu s...@redhat.com virDomainHasDiskMirror() currently detects only jobs that add the mirror elements. Since some operations like migration are interlocked by existing block jobs on the given domain the check needs to be instrumented to check regular jobs too. This patch renames

[libvirt] [PATCH 1/2] qemu: snapshot: Check for block jobs individually

2015-03-30 Thread Peter Krempa
If any disk of a VM was involved in a (copy) block job we refused to do a snapshot. As not only copy jobs interlock snapshots and the interlocking is applicable to individual disks only we can make the check in a more individual fashion and interlock all block job types supported by libvirt.

Re: [libvirt] [openstack-dev] [nova] The risk of hanging when shutdown instance.

2015-03-30 Thread Eric Blake
On 03/30/2015 06:08 AM, Michal Privoznik wrote: On 30.03.2015 11:28, zhang bo wrote: On 2015/3/28 18:06, Rui Chen wrote: snip/ The API virDomainShutdown's description is out of date, it's not correct. In fact, virDomainShutdown would block or not, depending on its mode. If it's in

Re: [libvirt] [PATCH 2/3] qemu: Extract internals of processBlockJobEvent into a helper

2015-03-30 Thread Eric Blake
On 03/30/2015 03:26 AM, Peter Krempa wrote: Later on I'll be adding a condition that will allow to synchronise a SYNC block job abort. The approach will require this code to be called from two different places so it has to be extracted into a helper. --- src/qemu/qemu_driver.c | 200

Re: [libvirt] [PATCH 3/3] qemu: blockjob: Synchronously update backing chain in XML on ABORT/PIVOT

2015-03-30 Thread Eric Blake
On 03/30/2015 03:26 AM, Peter Krempa wrote: When the synchronous pivot option is selected, libvirt would not update the backing chain until the job was exitted. Some applications then s/exitted/exited/ received invalid data as their job serialized first. This patch removes polling to wait

[libvirt] [PATCH 0/3] storage: handle scsi/iscsi error paths better

2015-03-30 Thread John Ferlan
Adjust error path logic for processing LU's in order to better ascertain the correct cause for failure. The first two patches are merely setting for the third one which determines that the pool definition used a non existent path in the configuration thus no 'real' targets were able to be created.

[libvirt] [PATCH 3/3] scsi: Check for invalid target.path after processLU failure

2015-03-30 Thread John Ferlan
https://bugzilla.redhat.com/show_bug.cgi?id=1171933 After processing all the LU's and find no real LU's - check if perhaps the cause of that was a poorly formed 'target.path'. The expection is generally that the path is /dev/disk/by-path or at least something in /dev. Although it's not impossible

[libvirt] [PATCH 2/3] scsi: Adjust return values from processLU

2015-03-30 Thread John Ferlan
Currently processLU returns a 0 when either a 'non disk/lun' volume or a processed and found disk/lun value. On return we set *found = true in either case. If we don't find any real LU's that could be indicative of some other problem that we may need to message. Therefore, only set the *found

Re: [libvirt] [PATCH] virDomainShutdown*: Describe blocking behaviour

2015-03-30 Thread Eric Blake
On 03/30/2015 06:07 AM, Michal Privoznik wrote: The description to both virDomainShutdown() and virDomainShutdownFlags() is quite misleading when it comes to blocking behaviour of these two APIs. Firstly, we support many shutdown methods, from signalizing an ACPI event, through sending a

[libvirt] [PATCH 1/3] iscsi: Check for presence of error before creating new one

2015-03-30 Thread John Ferlan
If virStorageBackendSCSIFindLUs fails, but the failure has an error message - the iscsi code didn't honor that creating it's own wonderful message such as error: Failed to find LUs on host 60: ... - not overly helpful. Since a few of the called paths generate a message, check for that before using

Re: [libvirt] [PATCH 1/3] qemu: processBlockJob: Don't unlock @vm twice

2015-03-30 Thread Eric Blake
On 03/30/2015 03:26 AM, Peter Krempa wrote: Commit 1a92c719 moved code to handle block job events to a different function that is executed in a separate thread. The caller of processBlockJob handles locking and unlocking of @vm, so the we should not do it in the function itself. ---

Re: [libvirt] connect: ssh: Shall we remove the dependency of netcat ?

2015-03-30 Thread zhang bo
On 2015/3/28 0:25, Peter Krempa wrote: On Fri, Mar 27, 2015 at 10:54:26 +0800, zhang bo wrote: Too powerful? That is a ridiculous statement that probably originates from some kind of misunderstanding when creating a security policy or stuff like that. If a policy bans nc as powerful then

[libvirt] Release of libvirt-1.2.14 candidate release 2

2015-03-30 Thread Daniel Veillard
So I have just tagged in git and pushed the 1.2.14 candidate release 2, it is available as usual as signed tarballs and rpms from: ftp://libvirt.org/libvirt/ I did push the 3 patches from Peter because what is the point of a candidate release if it doesn't include the potentially

Re: [libvirt] [PATCH] Strip control codes in virBufferEscapeString

2015-03-30 Thread Daniel Veillard
On Mon, Mar 30, 2015 at 10:56:11AM -0600, Eric Blake wrote: On 03/30/2015 09:50 AM, Daniel Veillard wrote: NACK. Stripping control codes from a volume name represents the wrong name. We need to escape the problematic bytes, rather than strip them. you can't escape them with a

Re: [libvirt] [openstack-dev] [nova] The risk of hanging when shutdown instance.

2015-03-30 Thread zhang bo
On 2015/3/31 4:36, Eric Blake wrote: On 03/30/2015 06:08 AM, Michal Privoznik wrote: On 30.03.2015 11:28, zhang bo wrote: On 2015/3/28 18:06, Rui Chen wrote: snip/ The API virDomainShutdown's description is out of date, it's not correct. In fact, virDomainShutdown would block or not,

Re: [libvirt] [PATCH] Strip control codes in virBufferEscapeString

2015-03-30 Thread Daniel Veillard
On Mon, Mar 30, 2015 at 07:06:45AM -0600, Eric Blake wrote: On 03/30/2015 05:02 AM, Ján Tomko wrote: These cannot be represented in XML. Yes they can, via entities. DV would know for sure, but I think that #x01; is the entity for the C byte '\1'. no they can't :-) A character must match