[libvirt] [PATCH 1/3] Fix building with threaded php.

2011-03-04 Thread Tiziano Mueller
--- src/libvirt.c | 74 ++--- 1 files changed, 39 insertions(+), 35 deletions(-) diff --git a/src/libvirt.c b/src/libvirt.c index 1ba2662..ce39a28 100644 --- a/src/libvirt.c +++ b/src/libvirt.c @@ -195,7 +195,7 @@ PHP_MINFO_FUNCTION(libvirt)

[libvirt] [PATCH 3/3] fix libvirt_connect failure without Xen

2011-03-04 Thread Tiziano Mueller
Currently libvirt_connect fails if libvirt has no Xen support. This is because virGetVersion checks for Xen if typeVer!=NULL. --- src/libvirt.c |6 ++ 1 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/libvirt.c b/src/libvirt.c index ce39a28..9a1b51a 100644 --- a/src/libvir

[libvirt] [PATCH 2/3] add --with-php-config flag

2011-03-04 Thread Tiziano Mueller
php extensions can usually be configured to use a specific php-config using --with-php-config to explicitly specify a path to php-config. Moved phpize-detection after php-config and use php-config's prefix path to look for phpize first. --- configure.ac| 18 ++ src/Makefile.a

[libvirt] libvirt-php: various fixes

2011-03-04 Thread Tiziano Mueller
While building a libvirt-php package for Gentoo Linux I had to workaround a couple of build issues. The first two patches are the results. The last patch is a fix for the case libvirt has been built without Xen support. In this case libvirt_connect (and phpinfo()) fails because virGetVersion is ca

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

2011-03-04 Thread Eric Blake
On 03/04/2011 06:03 PM, Eric Blake 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 > differe

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

2011-03-04 Thread Eric Blake
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 == mon) >> priv->mon = NULL; >> -virDomain

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

2011-03-04 Thread Eric Blake
On 03/03/2011 12:47 PM, Laine Stump wrote: > This was found while researching the root cause of: > > https://bugzilla.redhat.com/show_bug.cgi?id=670848 > > virDomainUnref should only be called with the lock held for the > virDomainObj in question. However, when a transient qemu domain gets >

Re: [libvirt] problem attaching/detaching disk

2011-03-04 Thread Shi Jin
Although the attach/detach problem has been solved, I fond the driver name issue still causes problems restoring from a saved VM with disk attached. For example, once saved, the checkpoint file would contains And then the restore would fail: [cloudadmin@

[libvirt] [PATCHv3 11/10] qemu: use common API for reading difficult files

2011-03-04 Thread Eric Blake
Direct access to an open file is so much simpler than passing everything through a pipe! * src/qemu/qemu_driver.c (qemudOpenAsUID) (qemudDomainSaveImageClose): Delete. (qemudDomainSaveImageOpen): Rename... (qemuDomainSaveImageOpen): ...and drop read_pid argument. Use virFileOpenAs instead of qemu

[libvirt] [PATCHv3 02a/10] qemu: consolidate duplicated monitor migration code

2011-03-04 Thread Eric Blake
I'm tired of maintaining two copies of migration uri generation. * src/qemu/qemu_monitor_text.h (qemuMonitorTextMigrate): Declare in place of individual monitor commands. * src/qemu/qemu_monitor_json.h (qemuMonitorJSONMigrate): Likewise. * src/qemu/qemu_monitor_text.c (qemuMonitorTextMigrateToFd)

Re: [libvirt] problem attaching/detaching disk

2011-03-04 Thread Shi Jin
Finally, everything works for if I simply change my template to use the /usr/libexec/qemu-kvm instead of /usr/bin/kvm, which is a symbolic link to it. Not sure why it matters but that does solve all the mysteries. Shi On Fri, Mar 4, 2011 at 9:56 AM, Shi Jin wrote: > It seems that your qemu does

Re: [libvirt] [PATCH 1/2] virsh: Change integer option parsing functions to return tri-state information.

2011-03-04 Thread Eric Blake
On 03/01/2011 03:16 AM, Michal Privoznik wrote: > This is needed to detect situations when optional argument was > specified with non-integer value: '--int-opt foo'. > --- > tools/virsh.c | 46 +++--- > 1 files changed, 27 insertions(+), 19 deletions(-) >

Re: [libvirt] [PATCH] dynamic_ownership documentation

2011-03-04 Thread Eric Blake
On 03/04/2011 09:35 AM, Daniel P. Berrange wrote: >> +# A static assignment of SELinux labels imply that the administrator >> +# manually configures the SELinux label of the virtual machine in >> +# /etc/libvirt/qemu/ based on the following example: >> +# >> +# >> +#system_u:system_r:qemu_t:s

Re: [libvirt] problem attaching/detaching disk

2011-03-04 Thread Shi Jin
> > It seems that your qemu does not support monitor command 'drive_add'. > What's version of your qemu? > > Thank you. Here is my version [cloudadmin@test2 ~]$ /usr/libexec/qemu-kvm -version QEMU PC emulator version 0.12.1 (qemu-kvm-0.12.1.2), Copyright (c) 2003-2008 Fabrice Bellard I finally thi

Re: [libvirt] Fixes for several memory leaks

2011-03-04 Thread Eric Blake
On 03/03/2011 08:28 PM, Phil Petty (phpetty) wrote: First, a big thank you for this. You found several real bugs, some easier than others to trigger. > Index: libvirt/src/conf/secret_conf.c > > === > > *** > > *** 154

Re: [libvirt] [PATCH] dynamic_ownership documentation

2011-03-04 Thread Daniel P. Berrange
On Fri, Mar 04, 2011 at 04:53:20PM +0100, Stephan Mueller wrote: > Hi, > > I would like to propose the following patch for the libvirtd.conf file to > document sVirt and its usage. If you have suggestions to add better wording, > please let me know. > > (If you reply with comments, could you pl

Re: [libvirt] [PATCH 2/3] Move event code out of the daemon/ into src/util/

2011-03-04 Thread Jiri Denemark
On Fri, Mar 04, 2011 at 10:20:33 +, Daniel P. Berrange wrote: > > ACK if you squash this in (did you forget to run 'make check'?): > > Urgh yes. I find it really annoying that plain 'make' does not > cause the test suite to be compiled anymore:-( It certainly used > to, but we lost it at some

[libvirt] [PATCH] dynamic_ownership documentation

2011-03-04 Thread Stephan Mueller
Hi, I would like to propose the following patch for the libvirtd.conf file to document sVirt and its usage. If you have suggestions to add better wording, please let me know. (If you reply with comments, could you please CC me as I am not on the list.) Ciao Stephan --- diff --git a/cc-config

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

2011-03-04 Thread Eric Blake
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 > log file or stderr if none is found > * src/util/logging.h src/util/logging.c: add the new API > and cleanup the old virLogDum

Re: [libvirt] [PATCH 1/6] Force all logs to go to the round robbin memory buffer

2011-03-04 Thread Eric Blake
On 03/04/2011 03:30 AM, Daniel Veillard wrote: In the subject - s/robbin/robin/ Oh well, you already pushed it with the typo. > Initially only the log actually written out by libvirt were > saved on the memory buffer, this patch forces all informations > including info and debug to be saved in m

Re: [libvirt] Network Filter not working on RHEL-6

2011-03-04 Thread Laine Stump
On 03/02/2011 04:55 PM, edison wrote: There is a bug in netcf-libs(https://bugzilla.redhat.com/show_bug.cgi?id=651032), which automatically sets "-A FORWARD -m physdev --physdev-is-bridged -j ACCEPT " if /proc/sys/net/bridge/bridge-nf-call-iptables == 1. I hit the bug last week, which drove me cr

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

2011-03-04 Thread Osier Yang
于 2011年03月04日 19:40, Daniel P. Berrange 写道: On Mon, Feb 21, 2011 at 09:43:30PM +0800, Osier Yang wrote: diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index e7c3409..db8c8da 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -4164,6 +4164,10 @@ virDomainVideoDefaul

Re: [libvirt] [PATCH 0/6 v2] Allow debug dump in case of crashes

2011-03-04 Thread Daniel Veillard
On Fri, Mar 04, 2011 at 06:30:51PM +0800, Daniel Veillard wrote: > Changes in v2 based on danpb feedback: > - make libvirtd.log the default instead of syslog > - do not open the libvirtd.log directly > - create a new API to dump debug buffer to file output > - use that new API now in the fa

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

2011-03-04 Thread Laine Stump
On 03/04/2011 06:47 AM, Daniel P. Berrange wrote: ACK Pushed. Thanks! -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [PATCH 2/2] qemu: avoid corruption of domain hashtable and misuse of freed domains

2011-03-04 Thread Laine Stump
On 03/04/2011 06:47 AM, Daniel P. Berrange wrote: ACK Pushed. Thanks! -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] problem attaching/detaching disk

2011-03-04 Thread Shi Jin
> > > > > > > > > > > > > > > > > > > > > > > > function='0x0'/> > > > > function='0x1'/> > > > > Thank you very much. It is exactly the same output as m

[libvirt] Fixes for several memory leaks

2011-03-04 Thread Phil Petty (phpetty)
Index: libvirt/src/conf/secret_conf.c === *** *** 154,160 _("invalid value of 'private'")); goto cleanup; } - VIR_FREE(prop); }

Re: [libvirt] problem attaching/detaching disk

2011-03-04 Thread Shi Jin
Here is the command [root@test2 images]# virsh attach-disk 1 /var/lib/libvirt/images/disk.qcow2 vdb --driver file --subdriver qcow2 Disk attached successfully Here is the log I found relevant (too much under debug mode) 15:31:52.902: debug : virEventInterruptLocked:668 : Interrupting 15:31:52.90

[libvirt] [PATCH] Access qemu backing_file with relative pool path

2011-03-04 Thread Jesse Cook
This patch enables the relative backing file path support provided by qemu-img create. If the storage pool is not found with the specified path, check if the file exists relative to the pool where the new image will be created by prepending the storage pool path. --- src/storage/storage_backend.c

Re: [libvirt] [PATCHv3 06/10] storage: simplify fd handling

2011-03-04 Thread Eric Blake
On 03/04/2011 01:15 AM, Paolo Bonzini wrote: > On 03/04/2011 01:37 AM, Eric Blake wrote: >> - unsigned int flags ATTRIBUTE_UNUSED) >> + unsigned int flags) > > Uhm, you're still not using the flags, you're just using the argument as > a place to

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

2011-03-04 Thread Daniel Veillard
On Fri, Mar 04, 2011 at 11:33:16AM +, Daniel P. Berrange wrote: > On Fri, Mar 04, 2011 at 06:30:56PM +0800, Daniel Veillard wrote: > > > > virLogEmergencyDumpAll() allows to dump the content of the > > debug buffer from within a signal handler. It saves to all > > log file or stderr if none is

Re: [libvirt] [PATCH 2/2] qemu: avoid corruption of domain hashtable and misuse of freed domains

2011-03-04 Thread Daniel P. Berrange
On Thu, Mar 03, 2011 at 02:47:38PM -0500, Laine Stump wrote: > This was also found while investigating > >https://bugzilla.redhat.com/show_bug.cgi?id=670848 > > An EOF on a domain's monitor socket results in an event being queued > to handle the EOF. The handler calls qemuProcessHandleMonitor

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

2011-03-04 Thread Daniel P. Berrange
On Thu, Mar 03, 2011 at 04:10:07PM -0500, Laine Stump wrote: > (Eric pointed out in IRC that I should be acquiring the domainobj lock > prior to modifying obj->privateData->mon) > > This was found while researching the root cause of: > > https://bugzilla.redhat.com/show_bug.cgi?id=670848 > >

Re: [libvirt] [PATCH 2/2] Enable cgroup controllers as much as possible.

2011-03-04 Thread Daniel P. Berrange
On Fri, Mar 04, 2011 at 12:06:26PM +0800, Hu Tao wrote: > If any cgroup controller is not avaiable, libvirt disables other > controllers as well although they are avaiable. This patch enables > cgroup controllers as much as possible. > > the kernel shipped with RHEL6 doesn't support mutli-level di

Re: [libvirt] [PATCH 1/2] Gives a warning when unable to create cgroup for qemu.

2011-03-04 Thread Daniel P. Berrange
On Fri, Mar 04, 2011 at 12:05:59PM +0800, Hu Tao wrote: > > Signed-off-by: Hu Tao > --- > src/qemu/qemu_driver.c |2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c > index c9095bb..a54bfc5 100644 > --- a/src/qemu/qemu_d

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

2011-03-04 Thread Daniel P. Berrange
On Mon, Feb 21, 2011 at 09:43:30PM +0800, Osier Yang wrote: > diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c > index e7c3409..db8c8da 100644 > --- a/src/conf/domain_conf.c > +++ b/src/conf/domain_conf.c > @@ -4164,6 +4164,10 @@ virDomainVideoDefaultRAM(virDomainDefPtr def, >

Re: [libvirt] [PATCH 6/6] Dump the debug buffer to libvirtd.log on fatal signal

2011-03-04 Thread Daniel P. Berrange
On Fri, Mar 04, 2011 at 06:30:57PM +0800, Daniel Veillard wrote: > > In case of imminent crash or upon request (signal USR2), > dump the logging buffer to the libvirtd.log file for > post-mortem analysis > * daemon/libvirtd.c: create a sig_fatal() handler connected to > SIGFPE SIGSEGV SIGILL SIG

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

2011-03-04 Thread Daniel P. Berrange
On Fri, Mar 04, 2011 at 06:30:56PM +0800, Daniel Veillard wrote: > > virLogEmergencyDumpAll() allows to dump the content of the > debug buffer from within a signal handler. It saves to all > log file or stderr if none is found > * src/util/logging.h src/util/logging.c: add the new API > and clea

Re: [libvirt] [PATCH 3/6] Add logrotate support for libvirtd.log

2011-03-04 Thread Daniel P. Berrange
On Fri, Mar 04, 2011 at 06:30:54PM +0800, Daniel Veillard wrote: > > As the file may grow quite a bit especially with debug turned on. > * daemon/libvirtd.logrotate.in daemon/Makefile.am libvirt.spec.in: > add new logrotate file for the daemon log > > Signed-off-by: Daniel Veillard > --- > da

Re: [libvirt] [PATCH 4/6] Fix a counter bug in the log buffer

2011-03-04 Thread Daniel P. Berrange
On Fri, Mar 04, 2011 at 06:30:55PM +0800, Daniel Veillard wrote: > > * src/util/logging.c: the start pointer need to wrap around too > > Signed-off-by: Daniel Veillard > --- > src/util/logging.c |2 ++ > 1 files changed, 2 insertions(+), 0 deletions(-) ACK Daniel -- |: http://berrange.c

Re: [libvirt] [PATCH 1/6] Force all logs to go to the round robbin memory buffer

2011-03-04 Thread Daniel P. Berrange
On Fri, Mar 04, 2011 at 06:30:52PM +0800, Daniel Veillard wrote: > > Initially only the log actually written out by libvirt were > saved on the memory buffer, this patch forces all informations > including info and debug to be saved in memory too. This is > useful to get full data in case of crash

Re: [libvirt] [PATCH 2/6] Change default log policy to libvirtd.log instead of syslog

2011-03-04 Thread Daniel P. Berrange
On Fri, Mar 04, 2011 at 06:30:53PM +0800, Daniel Veillard wrote: > > Syslog is not the best place to go search for libvirt error > logs, change it to a default file output libvirtd.log, but > still keep standard error if not run as a daemon. > Depending on whether it's run as root or user, the log

Re: [libvirt] [PATCH 3/3] Expose event loop implementation as a public API

2011-03-04 Thread Daniel Veillard
On Fri, Mar 04, 2011 at 10:19:20AM +, Daniel P. Berrange wrote: > On Thu, Mar 03, 2011 at 04:13:08PM -0700, Eric Blake wrote: > > On 03/03/2011 07:21 AM, Daniel P. Berrange wrote: > > > +LIBVIRT_0.9.0 { > > > +global: > > > +virEventRegisterDefaultImpl; > > > +virEventRunDe

Re: [libvirt] [PATCH 2/6] Change default log policy to libvirtd.log instead of syslog

2011-03-04 Thread Daniel Veillard
On Fri, Mar 04, 2011 at 06:30:53PM +0800, Daniel Veillard wrote: > +++ b/daemon/libvirtd.c > @@ -197,6 +197,8 @@ static int audit_logging = 0; > > #define DH_BITS 1024 > > +static int logFD = -1; > + Ah, I though I had that cleaned up, will remove before any commit, or next push, Daniel -

[libvirt] [PATCH 6/6] Dump the debug buffer to libvirtd.log on fatal signal

2011-03-04 Thread Daniel Veillard
In case of imminent crash or upon request (signal USR2), dump the logging buffer to the libvirtd.log file for post-mortem analysis * daemon/libvirtd.c: create a sig_fatal() handler connected to SIGFPE SIGSEGV SIGILL SIGABRT SIGBUS and SIGUSR2, just dumping the log buffer using virLogEmergencyD

[libvirt] [PATCH 4/6] Fix a counter bug in the log buffer

2011-03-04 Thread Daniel Veillard
* src/util/logging.c: the start pointer need to wrap around too Signed-off-by: Daniel Veillard --- src/util/logging.c |2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/src/util/logging.c b/src/util/logging.c index 33b0992..b946285 100644 --- a/src/util/logging.c +++ b/sr

[libvirt] [PATCH 2/6] Change default log policy to libvirtd.log instead of syslog

2011-03-04 Thread Daniel Veillard
Syslog is not the best place to go search for libvirt error logs, change it to a default file output libvirtd.log, but still keep standard error if not run as a daemon. Depending on whether it's run as root or user, the log is saved in the local state dir or in $HOME/.libvirt. * daemon/libvirtd.c:

[libvirt] [PATCH 3/6] Add logrotate support for libvirtd.log

2011-03-04 Thread Daniel Veillard
As the file may grow quite a bit especially with debug turned on. * daemon/libvirtd.logrotate.in daemon/Makefile.am libvirt.spec.in: add new logrotate file for the daemon log Signed-off-by: Daniel Veillard --- daemon/Makefile.am | 10 +- daemon/libvirtd.logrotate.in |9

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

2011-03-04 Thread Daniel Veillard
virLogEmergencyDumpAll() allows to dump the content of the debug buffer from within a signal handler. It saves to all log file or stderr if none is found * src/util/logging.h src/util/logging.c: add the new API and cleanup the old virLogDump code * src/libvirt_private.syms: exports it as a priva

[libvirt] [PATCH 0/6 v2] Allow debug dump in case of crashes

2011-03-04 Thread Daniel Veillard
Changes in v2 based on danpb feedback: - make libvirtd.log the default instead of syslog - do not open the libvirtd.log directly - create a new API to dump debug buffer to file output - use that new API now in the fatal signal handler This patch set main goal is to allow dumping of full de

[libvirt] [PATCH 1/6] Force all logs to go to the round robbin memory buffer

2011-03-04 Thread Daniel Veillard
Initially only the log actually written out by libvirt were saved on the memory buffer, this patch forces all informations including info and debug to be saved in memory too. This is useful to get full data in case of crash. Signed-off-by: Daniel Veillard --- src/util/logging.c | 16 +

Re: [libvirt] [PATCH 2/3] Move event code out of the daemon/ into src/util/

2011-03-04 Thread Daniel P. Berrange
On Thu, Mar 03, 2011 at 04:01:35PM -0700, Eric Blake wrote: > On 03/03/2011 07:21 AM, Daniel P. Berrange wrote: > > The event loop implementation is used by more than just the > > daemon, so move it into the shared area. > > > > * daemon/event.c, src/util/event_poll.c: Renamed > > * daemon/event.h

Re: [libvirt] [PATCH 3/3] Expose event loop implementation as a public API

2011-03-04 Thread Daniel P. Berrange
On Thu, Mar 03, 2011 at 04:13:08PM -0700, Eric Blake wrote: > On 03/03/2011 07:21 AM, Daniel P. Berrange wrote: > > Not all applications have an existing event loop they need > > to integrate with. Forcing them to implement the libvirt > > event loop integration APIs is an undue burden. This just >

Re: [libvirt] snapshots += domain description?

2011-03-04 Thread Philipp Hahn
Hello, to refresh this old question again: Snapshots are a great feature, but I encountered a problem with Qemu/KVM: The snapshot information does not include the domain description, which breaks the following work-flow: 1. create and start domain with RAM=x1, CPU=y1, ... 2. take snapshot 3. sh

Re: [libvirt] [PATCHv3 07/10] util: rename virFileOperation to virFileOpenAs

2011-03-04 Thread Paolo Bonzini
On 03/04/2011 01:37 AM, Eric Blake wrote: (virFileOperation): Rename... (virFileOpenAs): ...and reduce parameters. As an "external observer" of libvirt development, I must admit virFileOperation always seemed an extremely heavyweight and clunky interface. Thanks for cleaning it up! Paolo

Re: [libvirt] [PATCHv3 09/10] qemu, storage: improve type safety

2011-03-04 Thread Paolo Bonzini
On 03/04/2011 01:37 AM, Eric Blake wrote: * src/storage/storage_backend.c (createRawFileOpHook): Change signature. (struct createRawFileOpHookData): Delete unused struct. (virStorageBackendCreateRaw): Adjust caller. * src/qemu/qemu_driver.c (struct fileOpHookData): Delete unused struct. (qemudDom

Re: [libvirt] [PATCHv3 06/10] storage: simplify fd handling

2011-03-04 Thread Paolo Bonzini
On 03/04/2011 01:37 AM, Eric Blake wrote: - unsigned int flags ATTRIBUTE_UNUSED) + unsigned int flags) Uhm, you're still not using the flags, you're just using the argument as a place to write the flags for virFileOperation. Perhaps the "inn

Re: [libvirt] [PATCH] util: Allow removing hash entries in virHashForEach

2011-03-04 Thread Paolo Bonzini
On 03/03/2011 03:09 PM, Daniel Veillard wrote: ACK, removing should be safe then, but adding will still be a big problem due to virHashGrow(). Removing _the current_ element is safe, on the other hand removing any other element used to be safe and now it may cause a dangling pointer access