Re: [libvirt] [PATCH] virsh: fix memtune's help message for swap_hard_limit

2011-03-07 Thread Nikunj A. Dadhania
On Fri, 4 Mar 2011 14:46:12 +0900, KAMEZAWA Hiroyuki kamezawa.hir...@jp.fujitsu.com wrote: On Thu, 03 Mar 2011 14:47:36 +0800 Osier Yang jy...@redhat.com wrote: Yes, I think it's better. Should I prepare patches ? or you'll do ? Let's see other guys's opinions before doing it, :)

Re: [libvirt] [PATCH 1/2] qemu: Add missing lock of virDomainObj before calling virDomainUnref

2011-03-07 Thread Daniel P. Berrange
On Fri, Mar 04, 2011 at 06:03:36PM -0700, Eric Blake wrote: On 03/04/2011 02:46 PM, Eric Blake wrote: +++ b/src/qemu/qemu_process.c @@ -596,7 +596,9 @@ static void qemuProcessHandleMonitorDestroy(qemuMonitorPtr mon, qemuDomainObjPrivatePtr priv = vm-privateData; if (priv-mon

Re: [libvirt] [PATCH 5/6] Add an an internal API for emergency dump of debug buffer

2011-03-07 Thread Daniel P. Berrange
On Mon, Mar 07, 2011 at 03:06:18PM +0800, Daniel Veillard wrote: On Fri, Mar 04, 2011 at 08:53:55AM -0700, Eric Blake wrote: On 03/04/2011 03:30 AM, Daniel Veillard wrote: virLogEmergencyDumpAll() allows to dump the content of the debug buffer from within a signal handler. It saves to all

Re: [libvirt] [PATCH 5/6] Add an an internal API for emergency dump of debug buffer

2011-03-07 Thread Daniel P. Berrange
On Mon, Mar 07, 2011 at 03:06:18PM +0800, Daniel Veillard wrote: On Fri, Mar 04, 2011 at 08:53:55AM -0700, Eric Blake wrote: On 03/04/2011 03:30 AM, Daniel Veillard wrote: virLogEmergencyDumpAll() allows to dump the content of the debug buffer from within a signal handler. It saves to all

Re: [libvirt] [v3] qemu: Support vram for video of qxl type

2011-03-07 Thread Daniel P. Berrange
On Sun, Mar 06, 2011 at 10:04:48PM +0800, Osier Yang wrote: For qemu names the primary vga as qxl-vga: 1) if vram is specified for 2nd qxl device: -vga qxl -global qxl-vga.vram_size=$SIZE \ -device qxl,id=video1,vram_size=$SIZE,... 2) if vram is not specified for 2nd qxl

Re: [libvirt] qemuDomainMonitorCommand

2011-03-07 Thread Daniel P. Berrange
On Sun, Mar 06, 2011 at 11:40:16AM -0600, Anthony Liguori wrote: Hi, I've been looking at the qemuDomainMonitorCommand interface and I see a few issues with it. The current interface can take a JSON string and return a JSON string but it only works for successful commands. I'd like to

Re: [libvirt] [PATCH 1/2] rename qemuDomainDetachSCSIDiskDevice to qemuDomainDetachDiskDevice

2011-03-07 Thread Daniel P. Berrange
On Mon, Mar 07, 2011 at 11:31:48AM +0800, Wen Congyang wrote: The way to detach a USB disk is the same as that to detach a SCSI disk. Rename this function and we can use it to detach a USB disk. Signed-off-by: Wen Congyang we...@cn.fujitsu.com --- src/qemu/qemu_driver.c |3 +--

Re: [libvirt] [PATCH 2/2] support to detach USB disk

2011-03-07 Thread Daniel P. Berrange
On Mon, Mar 07, 2011 at 11:36:48AM +0800, Wen Congyang wrote: Signed-off-by: Wen Congyang we...@cn.fujitsu.com --- src/qemu/qemu_driver.c |2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index f4e52b1..2892dfe

Re: [libvirt] [PATCH] check driver name while attaching disk

2011-03-07 Thread Daniel P. Berrange
On Mon, Mar 07, 2011 at 02:35:49PM +0800, Wen Congyang wrote: This bug was reported by Shi Jin(jinzish...@gmail.com): = # virsh attach-disk RHEL6RC /var/lib/libvirt/images/test3.img vdb --driver file --subdriver qcow2 Disk attached successfully # virsh save RHEL6RC

Re: [libvirt] [PATCH] unlock eventLoop before calling callback function

2011-03-07 Thread Daniel P. Berrange
On Mon, Mar 07, 2011 at 02:06:49PM +0800, Wen Congyang wrote: diff --git a/daemon/event.c b/daemon/event.c index 1a31717..0d45014 100644 --- a/daemon/event.c +++ b/daemon/event.c @@ -493,8 +493,11 @@ static int virEventCleanupTimeouts(void) { EVENT_DEBUG(Purging timeout %d with

Re: [libvirt] [v3] qemu: Support vram for video of qxl type

2011-03-07 Thread Osier Yang
于 2011年03月07日 18:44, Daniel P. Berrange 写道: On Sun, Mar 06, 2011 at 10:04:48PM +0800, Osier Yang wrote: For qemu names the primary vga as qxl-vga: 1) if vram is specified for 2nd qxl device: -vga qxl -global qxl-vga.vram_size=$SIZE \ -device qxl,id=video1,vram_size=$SIZE,...

Re: [libvirt] [PATCH] unlock eventLoop before calling callback function

2011-03-07 Thread Jiri Denemark
On Mon, Mar 07, 2011 at 11:15:38 +, Daniel P. Berrange wrote: -if (eventLoop.handles[i].ff) +if (eventLoop.handles[i].ff) { +virMutexUnlock(eventLoop.lock); (eventLoop.handles[i].ff)(eventLoop.handles[i].opaque); +

Re: [libvirt] [PATCH] unlock eventLoop before calling callback function

2011-03-07 Thread Jiri Denemark
On Mon, Mar 07, 2011 at 14:13:23 +0100, Jiri Denemark wrote: On Mon, Mar 07, 2011 at 11:15:38 +, Daniel P. Berrange wrote: -if (eventLoop.handles[i].ff) +if (eventLoop.handles[i].ff) { +virMutexUnlock(eventLoop.lock);

Re: [libvirt] [PATCH] unlock eventLoop before calling callback function

2011-03-07 Thread Daniel P. Berrange
On Mon, Mar 07, 2011 at 02:13:23PM +0100, Jiri Denemark wrote: On Mon, Mar 07, 2011 at 11:15:38 +, Daniel P. Berrange wrote: -if (eventLoop.handles[i].ff) +if (eventLoop.handles[i].ff) { +virMutexUnlock(eventLoop.lock);

Re: [libvirt] [PATCH 5/6] Add an an internal API for emergency dump of debug buffer

2011-03-07 Thread Daniel Veillard
On Mon, Mar 07, 2011 at 10:18:57AM +, Daniel P. Berrange wrote: On Mon, Mar 07, 2011 at 03:06:18PM +0800, Daniel Veillard wrote: On Fri, Mar 04, 2011 at 08:53:55AM -0700, Eric Blake wrote: Is virLogLock async-signal-safe? I could not find, I'm afraid it's implementation dependant.

Re: [libvirt] [PATCH 5/6] Add an an internal API for emergency dump of debug buffer

2011-03-07 Thread Daniel P. Berrange
On Mon, Mar 07, 2011 at 09:18:46PM +0800, Daniel Veillard wrote: On Mon, Mar 07, 2011 at 10:18:57AM +, Daniel P. Berrange wrote: On Mon, Mar 07, 2011 at 03:06:18PM +0800, Daniel Veillard wrote: On Fri, Mar 04, 2011 at 08:53:55AM -0700, Eric Blake wrote: Is virLogLock

Re: [libvirt] [PATCH] unlock eventLoop before calling callback function

2011-03-07 Thread Jiri Denemark
On Mon, Mar 07, 2011 at 14:18:06 +0100, Jiri Denemark wrote: On Mon, Mar 07, 2011 at 14:13:23 +0100, Jiri Denemark wrote: On Mon, Mar 07, 2011 at 11:15:38 +, Daniel P. Berrange wrote: -if (eventLoop.handles[i].ff) +if (eventLoop.handles[i].ff) { +

Re: [libvirt] [PATCH 5/6] Add an an internal API for emergency dump of debug buffer

2011-03-07 Thread Daniel Veillard
On Mon, Mar 07, 2011 at 10:06:35AM +, Daniel P. Berrange wrote: On Mon, Mar 07, 2011 at 03:06:18PM +0800, Daniel Veillard wrote: On Fri, Mar 04, 2011 at 08:53:55AM -0700, Eric Blake wrote: snprintf is _not_ safe; it can call malloc. We probably ought to use a manual

Re: [libvirt] [PATCH 5/6] Add an an internal API for emergency dump of debug buffer

2011-03-07 Thread Daniel Veillard
On Mon, Mar 07, 2011 at 01:22:09PM +, Daniel P. Berrange wrote: On Mon, Mar 07, 2011 at 09:18:46PM +0800, Daniel Veillard wrote: the problem is that I really want to empty the buffer as a result of emitting the logs, i.e. the reader will emit only once the content at most. While

Re: [libvirt] [PATCH 5/6] Add an an internal API for emergency dump of debug buffer

2011-03-07 Thread Daniel P. Berrange
On Mon, Mar 07, 2011 at 09:32:59PM +0800, Daniel Veillard wrote: On Mon, Mar 07, 2011 at 01:22:09PM +, Daniel P. Berrange wrote: On Mon, Mar 07, 2011 at 09:18:46PM +0800, Daniel Veillard wrote: the problem is that I really want to empty the buffer as a result of emitting the logs,

Re: [libvirt] [PATCH 1/2] qemu: Add missing lock of virDomainObj before calling virDomainUnref

2011-03-07 Thread Eric Blake
On 03/07/2011 03:03 AM, Daniel P. Berrange wrote: I think the real reason for the deadlock is that: qemudDomainSaveFlag holds the domain lock while it calls qemuDomainEventQueue, which requests the event loop lock the event loop thread holds the event loop lock, and can make several

Re: [libvirt] [PATCH] check driver name while attaching disk

2011-03-07 Thread Shi Jin
Thanks Wen. However, this patch only adds the checking but to make it work we really have to replace the driver name 'file' with 'qemu', don't we? Thank you very much. Shi On Sun, Mar 6, 2011 at 11:35 PM, Wen Congyang we...@cn.fujitsu.com wrote: This bug was reported by Shi

Re: [libvirt] [PATCH] unlock eventLoop before calling callback function

2011-03-07 Thread Laine Stump
On 03/07/2011 08:17 AM, Daniel P. Berrange wrote: On Mon, Mar 07, 2011 at 02:13:23PM +0100, Jiri Denemark wrote: On Mon, Mar 07, 2011 at 11:15:38 +, Daniel P. Berrange wrote: -if (eventLoop.handles[i].ff) +if (eventLoop.handles[i].ff) { +

Re: [libvirt] [PATCH] unlock eventLoop before calling callback function

2011-03-07 Thread Eric Blake
On 03/07/2011 06:27 AM, Jiri Denemark wrote: And the rest of the for loops in Cleanup* is safe as well for the reason you already mentioned. The code moves stuff from i+1 to the end of the array one position closer the beginning of the array and it will move the possibly added items as well.

[libvirt] [PATCHv2] unlock eventLoop before calling callback function

2011-03-07 Thread Eric Blake
From: Wen Congyang we...@cn.fujitsu.com When I use newest libvirt to save a domain, libvirtd will be deadlock. Here is the output of gdb: (gdb) thread 3 [Switching to thread 3 (Thread 0x7f972a1fc710 (LWP 30265))]#0 0x00351fe0e034 in __lll_lock_wait () from /lib64/libpthread.so.0 (gdb) bt

Re: [libvirt] [PATCHv2] unlock eventLoop before calling callback function

2011-03-07 Thread Daniel P. Berrange
On Mon, Mar 07, 2011 at 10:09:36AM -0700, Eric Blake wrote: From: Wen Congyang we...@cn.fujitsu.com When I use newest libvirt to save a domain, libvirtd will be deadlock. Here is the output of gdb: (gdb) thread 3 [Switching to thread 3 (Thread 0x7f972a1fc710 (LWP 30265))]#0

Re: [libvirt] [PATCHv2] unlock eventLoop before calling callback function

2011-03-07 Thread Eric Blake
On 03/07/2011 10:18 AM, Daniel P. Berrange wrote: On Mon, Mar 07, 2011 at 10:09:36AM -0700, Eric Blake wrote: From: Wen Congyang we...@cn.fujitsu.com When I use newest libvirt to save a domain, libvirtd will be deadlock. The reason is that we will try to lock some object in callback

[libvirt] [PATCH] qemu_hotplug: Reword error if spice password change not available

2011-03-07 Thread Cole Robinson
Currently it sounds like spice is completely unsupported, which is confusing. --- src/qemu/qemu_hotplug.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index da07c29..25d2dd9 100644 --- a/src/qemu/qemu_hotplug.c +++

Re: [libvirt] [PATCH] qemu_hotplug: Reword error if spice password change not available

2011-03-07 Thread Eric Blake
On 03/07/2011 11:14 AM, Cole Robinson wrote: Currently it sounds like spice is completely unsupported, which is confusing. --- src/qemu/qemu_hotplug.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index

Re: [libvirt] [PATCH] qemu_hotplug: Reword error if spice password change not available

2011-03-07 Thread Cole Robinson
On 03/07/2011 01:22 PM, Eric Blake wrote: On 03/07/2011 11:14 AM, Cole Robinson wrote: Currently it sounds like spice is completely unsupported, which is confusing. --- src/qemu/qemu_hotplug.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/src/qemu/qemu_hotplug.c

[libvirt] [PATCH v2] virsh: Change option parsing functions to return tri-state information.

2011-03-07 Thread Michal Privoznik
This is needed to detect situations when optional argument was specified with non-integer value: '--int-opt foo'. To keep functions uniform vshCommandOptString function was also changed, because it returns tri-state value as well. Given result pointer is updated only in case of success. If parsing

Re: [libvirt] [PATCH 2/2] support to detach USB disk

2011-03-07 Thread Eric Blake
On 03/07/2011 04:10 AM, Daniel P. Berrange wrote: On Mon, Mar 07, 2011 at 11:36:48AM +0800, Wen Congyang wrote: Signed-off-by: Wen Congyang we...@cn.fujitsu.com --- src/qemu/qemu_driver.c |2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/src/qemu/qemu_driver.c

Re: [libvirt] [PATCH v2] virsh: Change option parsing functions to return tri-state information.

2011-03-07 Thread Eric Blake
On 03/07/2011 11:46 AM, Michal Privoznik wrote: This is needed to detect situations when optional argument was specified with non-integer value: '--int-opt foo'. To keep functions uniform vshCommandOptString function was also changed, because it returns tri-state value as well. Given result

Re: [libvirt] problem attaching/detaching disk

2011-03-07 Thread Dave Allan
On Sun, Mar 06, 2011 at 10:36:14PM -0700, Shi Jin wrote: I am very glad to hear that you can reproduce this problem. Please keep me posted on the status of this patch. One more question which might be more appropriate for Redhat: any idea when this fix would go into RHEL-6 as a bug fix?

Re: [libvirt] [RFC PATCH 0/5] Allow data upload/download to/from storage volumes

2011-03-07 Thread Cole Robinson
On 02/22/2011 08:23 AM, Daniel P. Berrange wrote: This patch series introduces two new APIs to allow data upload/download to/from storage volumes, using the streams APIs. Mostly I wrote this so I had an easier way to test the streams handling in my RPC patch series than using QEMU tunnelled

[libvirt] Network Interface: How to disable virbr0 correctly?

2011-03-07 Thread Jake Xu
Hi all, Recently, I have been using libvirt to create virtual machines on ESX servers. It has been very well until to the point where I couldn't find any way to disable/remove the virbr0 interface properly. We use static configuration for VMs on ESX so we do not need to use virbr0 interface and

[libvirt] [PATCH 3/3] audit: also audit cgroup controller path

2011-03-07 Thread Eric Blake
Although the cgroup device ACL controller path can be worked out by researching the code, it is more efficient to include that information directly in the audit message. * src/util/cgroup.h (virCgroupPathOfController): New prototype. * src/util/cgroup.c (virCgroupPathOfController): Export. *

[libvirt] [PATCH 2/3] audit: split cgroup audit types to allow more information

2011-03-07 Thread Eric Blake
Device names can be manipulated, so it is better to also log the major/minor device number corresponding to the cgroup ACL changes that libvirt made. This required some refactoring of the relatively new qemu cgroup audit code. * src/qemu/qemu_audit.c (qemuDomainCgroupAudit): Drop a parameter.

[libvirt] [PATCH 0/3] more cgroup ACL audit improvements

2011-03-07 Thread Eric Blake
Based on some feedback from Steve Grubb, Stephan Mueller, and others (unfortunately most of it on some non-public lists), I'm proposing the following patches to enhance my earlier audits for device cgroup ACLs. Pre-patch, cgroup audits looked like: type=VIRT_RESOURCE

[libvirt] [PATCH 1/3] audit: tweak audit messages to match conventions

2011-03-07 Thread Eric Blake
* src/qemu/qemu_audit.c (qemuDomainHostdevAudit): Avoid use of type, which has a pre-defined meaning. (qemuDomainCgroupAudit): Likewise, as well as item. --- src/qemu/qemu_audit.c |6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/qemu/qemu_audit.c

Re: [libvirt] [PATCH] check driver name while attaching disk

2011-03-07 Thread Wen Congyang
At 03/07/2011 07:17 PM, Daniel P. Berrange Write: On Mon, Mar 07, 2011 at 02:35:49PM +0800, Wen Congyang wrote: This bug was reported by Shi Jin(jinzish...@gmail.com): = # virsh attach-disk RHEL6RC /var/lib/libvirt/images/test3.img vdb --driver file --subdriver qcow2 Disk

[libvirt] attach/detach device in json mode

2011-03-07 Thread Wen Congyang
Hi, all The qemu does not support monitor_command drive_add and drive_del in json mode. These two commands are important because attaching/detaching commands need them. AFAIK, if we use libvirt provided by RHEL6(not upstream), we connect to qemu in json mode. So, it is important to make qemu to

[libvirt] [PATCH] Fix performance problem of virStorageVolCreateXMLFrom()

2011-03-07 Thread Minoru Usui
virStorageVolCreateXMLFrom() is slow if destination Pool is LVM. Because write block size is not appropriate. On linux environment, block size of LVM Pool which is made by virStoragePoolCreateXML() is 4096 bytes. On the other hand, write block size of virStorageVolCreateXMLFrom() is 512 bytes.