Re: [libvirt] [PATCH 2/3] Improve tokenizing of linkable terms

2011-08-12 Thread Philipp Hahn
Am Donnerstag 11 August 2011 21:45:18 schrieb Eric Blake: On 08/11/2011 06:44 AM, Philipp Hahn wrote: Currently only tabs and blanks are used for tokenizing the description, which breaks when a term is at the end of a line or has () appended to it. 1. Use also other white space

Re: [libvirt] RFCv2: virDomainSnapshotCreateXML enhancements

2011-08-12 Thread Philipp Hahn
Hello Kevin, hello Eric, On Thursday 11 August 2011 12:00:46 Kevin Wolf wrote: Am 11.08.2011 00:08, schrieb Eric Blake: Libvirt currently has a bug in that it only saves domain/uuid rather than the full domain xml along with a checkpoint - if any devices are hot-plugged (or in the case of

[libvirt] Re: [PATCH] Add some docs about the RPC protocol and APIs

2011-08-12 Thread Nicolas Sebrecht
The 11/08/11, Daniel P. Berrange wrote: diff --git a/docs/internals/rpc.html.in b/docs/internals/rpc.html.in new file mode 100644 index 000..761832a --- /dev/null +++ b/docs/internals/rpc.html.in @@ -0,0 +1,876 @@ +html + body +h1libvirt RPC infrastructure/h1 + +ul

Re: [libvirt] RFCv2: virDomainSnapshotCreateXML enhancements

2011-08-12 Thread Kevin Wolf
Am 12.08.2011 09:18, schrieb Philipp Hahn: Hello Kevin, hello Eric, On Thursday 11 August 2011 12:00:46 Kevin Wolf wrote: Am 11.08.2011 00:08, schrieb Eric Blake: Libvirt currently has a bug in that it only saves domain/uuid rather than the full domain xml along with a checkpoint - if any

Re: [libvirt] RFCv2: virDomainSnapshotCreateXML enhancements

2011-08-12 Thread Philipp Hahn
Hello Kevin, Am Freitag 12 August 2011 10:04:07 schrieb Kevin Wolf: Am 12.08.2011 09:18, schrieb Philipp Hahn: On Thursday 11 August 2011 12:00:46 Kevin Wolf wrote: Am 11.08.2011 00:08, schrieb Eric Blake: Libvirt currently has a bug in that it only saves domain/uuid rather than the full

Re: [libvirt] [PATCH] daemon: Add early libvirtd start verbose errors.

2011-08-12 Thread Daniel P. Berrange
On Thu, Aug 11, 2011 at 02:18:15PM +0200, Peter Krempa wrote: Early errors during start of libvirtd didn't have an error reporting mechanism and caused libvirtd to exit silently (only the return value indicated an error). This patch adds error messages printed to stderr if verbose parameter

Re: [libvirt] [PATCH v2] Implement DNS SRV record into the bridge driver

2011-08-12 Thread Michal Novotny
On 08/11/2011 08:56 PM, Eric Blake wrote: On 08/11/2011 07:38 AM, Michal Novotny wrote: Please ignore previous mails (done by my sendmail was not working fine and please review this one instead). It may have also been an issue of sendmail sending from a different address, and your patches

[libvirt] [PATCH v2.5] daemon: Add early libvirtd start verbose errors.

2011-08-12 Thread Peter Krempa
Early errors during start of libvirtd didn't have an error reporting mechanism and caused libvirtd to exit silently (only the return value indicated an error). Libvirt logging is initialized very early using enviroment variables and the internal error reporting API is used to report early errors.

Re: [libvirt] [Qemu-devel] [PATCH v3] Add support for fd: protocol

2011-08-12 Thread Kevin Wolf
Am 11.08.2011 18:28, schrieb Corey Bryant: On 07/26/2011 08:51 AM, Corey Bryant wrote: +static int raw_open_fd(BlockDriverState *bs, const char *filename, int flags) +{ +BDRVRawState *s = bs-opaque; +const char *fd_str; +int fd; + +/* extract the file

Re: [libvirt] [PATCH v2.5] daemon: Add early libvirtd start verbose errors.

2011-08-12 Thread Daniel P. Berrange
On Fri, Aug 12, 2011 at 11:54:39AM +0200, Peter Krempa wrote: Early errors during start of libvirtd didn't have an error reporting mechanism and caused libvirtd to exit silently (only the return value indicated an error). Libvirt logging is initialized very early using enviroment variables

Re: [libvirt] [PATCH 0/5] Some rearrangement additions to pid file handling/locking

2011-08-12 Thread Daniel P. Berrange
On Wed, Aug 10, 2011 at 04:37:23PM +0100, Daniel P. Berrange wrote: This series is a collection of changes related to pidfiles. First we define some wrappers around fcntl()'s lock file capability. Then all existing pidfile APIs from src/util/util.h are moved into a new file

[libvirt] Curl/HTTP block device

2011-08-12 Thread Radek Hladik
Hi, I've noticed newer version of curl in last qemu changelog. It seems that its needed for curl block device. Unfortunatelly, I was not able to find out more. I tried to look into qemu source code and to some patches but I am not much wiser. As I understand it, qemu could be able to use a

Re: [libvirt] [PATCH 1/5] Add virFileLock and virFileUnlock APIs

2011-08-12 Thread Jiri Denemark
On Wed, Aug 10, 2011 at 16:37:24 +0100, Daniel P. Berrange wrote: From: Daniel P. Berrange berra...@redhat.com Add some simple wrappers around the fcntl() discretionary file locking capability. * src/util/util.c, src/util/util.h, src/libvirt_private.syms: Add virFileLock and

Re: [libvirt] [PATCH v2] Implement DNS SRV record into the bridge driver

2011-08-12 Thread Michal Novotny
On 08/11/2011 08:56 PM, Eric Blake wrote: On 08/11/2011 07:38 AM, Michal Novotny wrote: Please ignore previous mails (done by my sendmail was not working fine and please review this one instead). It may have also been an issue of sendmail sending from a different address, and your patches

Re: [libvirt] [PATCH 2/5] Move pidfile functions into util/virpidfile.{c, h}

2011-08-12 Thread Jiri Denemark
On Wed, Aug 10, 2011 at 16:37:25 +0100, Daniel P. Berrange wrote: From: Daniel P. Berrange berra...@redhat.com The functions for manipulating pidfiles are in util/util.{c,h}. We will shortly be adding some further pidfile related functions. To avoid further growing util.c, this moves the

[libvirt] [PATCH v3] Implement DNS SRV record into the bridge driver

2011-08-12 Thread Michal Novotny
Hi, this is the third version of my patch to the bridge driver and libvirt XML file to include support for the SRV records in the DNS. The syntax is based on DNSMasq man page and tests for both xml2xml and xml2argv were added as well. Differences between v2 and v3: - Rebased for the latest

Re: [libvirt] [PATCH 3/5] Introduce functions for checking whether a pidfile is valid

2011-08-12 Thread Jiri Denemark
On Wed, Aug 10, 2011 at 16:37:26 +0100, Daniel P. Berrange wrote: From: Daniel P. Berrange berra...@redhat.com In some cases the caller of virPidFileRead might like extra checks to determine whether the pid just read is really the one they are expecting. This adds virPidFileReadIfValid which

[libvirt] [PATCH v3] daemon: Add early libvirtd start verbose errors.

2011-08-12 Thread Peter Krempa
Early errors during start of libvirtd didn't have an error reporting mechanism and caused libvirtd to exit silently (only the return value indicated an error). Libvirt logging is initialized very early using enviroment variables and the internal error reporting API is used to report early errors.

Re: [libvirt] [PATCH 3/5] Introduce functions for checking whether a pidfile is valid

2011-08-12 Thread Jiri Denemark
Eh, I forgot to add some more notes... ... diff --git a/src/util/virpidfile.c b/src/util/virpidfile.c index 25c3272..dc92868 100644 --- a/src/util/virpidfile.c +++ b/src/util/virpidfile.c @@ -24,6 +24,7 @@ #include config.h #include fcntl.h +#include signal.h #include

Re: [libvirt] [PATCH 4/5] Add some APIs which use locking for crashsafe pidfile handling

2011-08-12 Thread Jiri Denemark
On Wed, Aug 10, 2011 at 16:37:27 +0100, Daniel P. Berrange wrote: From: Daniel P. Berrange berra...@redhat.com In daemons using pidfiles to protect against concurrent execution there is a possibility that a crash may leave a stale pidfile on disk, which then prevents later restart of the

Re: [libvirt] [PATCH 5/5] Convert libvirtd to use crash-safe pidfile APIs

2011-08-12 Thread Jiri Denemark
On Wed, Aug 10, 2011 at 16:37:28 +0100, Daniel P. Berrange wrote: From: Daniel P. Berrange berra...@redhat.com Remove the current libvirtd pidfile handling code, in favour of calling out to the new APIs. This ensures libvirtd's pidfile handling is crashsafe This also means that the

Re: [libvirt] RFCv2: virDomainSnapshotCreateXML enhancements

2011-08-12 Thread Eric Blake
On 08/12/2011 02:56 AM, Philipp Hahn wrote: For -loadvm to work you have to call kvm with the nearly same command line arguments again; what may change you probably know better than me. For I thinks it's essential to store the VM consiguration with the snapshot, which would be the qemu command

Re: [libvirt] [PATCH] Add some docs about the RPC protocol and APIs

2011-08-12 Thread Daniel P. Berrange
On Thu, Aug 11, 2011 at 12:42:06PM -0600, Eric Blake wrote: On 08/11/2011 09:12 AM, Daniel P. Berrange wrote: From: Daniel P. Berrangeberra...@redhat.com * remote.html.in: Remove obsolete notes about internals of the RPC protocol * internals/rpc.html.in: Extensive docs on RPC

[libvirt] Do not fail migration if the media is ejected inside guest.

2011-08-12 Thread Osier Yang
The whole mail title should be Do not fail migration if the media is ejected inside guest and the media source is removed. Following 2 patches are trying to solve it, please see the patch descriptions for more detail. BZ# https://bugzilla.redhat.com/show_bug.cgi?id=725673 [PATCH 1/2] qemu: Get

[libvirt] [PATCH 1/2] qemu: Get the media status of removable block device

2011-08-12 Thread Osier Yang
Intorduce new monitor functions to get the media status (ejected or inserted) of removable block device via qemu monitor command info block. QEMU upstream will expose the the media status like: cd: type=cdrom removable=1 locked=0 ejected=0 The related patch:

[libvirt] [PATCH 2/2] qemu: Clear source path of removable block if it is ejected.

2011-08-12 Thread Osier Yang
This patch is mainly to solve the migration problem: After the media is ejected inside guest, and one removes the source of the media outside, migration will fail early, as we start the qemu daemon on dest host with the source of the removable block still existing, this causes failure when

Re: [libvirt] [PATCH 2/2] qemu: Clear source path of removable block if it is ejected.

2011-08-12 Thread Daniel P. Berrange
On Fri, Aug 12, 2011 at 09:34:42PM +0800, Osier Yang wrote: This patch is mainly to solve the migration problem: After the media is ejected inside guest, and one removes the source of the media outside, migration will fail early, as we start the qemu daemon on dest host with the source of

Re: [libvirt] [PATCH 1/2] qemu: Get the media status of removable block device

2011-08-12 Thread Daniel P. Berrange
On Fri, Aug 12, 2011 at 09:34:41PM +0800, Osier Yang wrote: Intorduce new monitor functions to get the media status (ejected or inserted) of removable block device via qemu monitor command info block. QEMU upstream will expose the the media status like: cd: type=cdrom removable=1 locked=0

Re: [libvirt] [PATCH 2/2] qemu: Clear source path of removable block if it is ejected.

2011-08-12 Thread Osier Yang
于 2011年08月12日 21:04, Daniel P. Berrange 写道: On Fri, Aug 12, 2011 at 09:34:42PM +0800, Osier Yang wrote: This patch is mainly to solve the migration problem: After the media is ejected inside guest, and one removes the source of the media outside, migration will fail early, as we start the

Re: [libvirt] [PATCH 1/2] qemu: Get the media status of removable block device

2011-08-12 Thread Osier Yang
于 2011年08月12日 21:11, Daniel P. Berrange 写道: On Fri, Aug 12, 2011 at 09:34:41PM +0800, Osier Yang wrote: Intorduce new monitor functions to get the media status (ejected or inserted) of removable block device via qemu monitor command info block. QEMU upstream will expose the the media status

Re: [libvirt] [PATCH 1/2] qemu: Get the media status of removable block device

2011-08-12 Thread Osier Yang
于 2011年08月12日 21:11, Daniel P. Berrange 写道: On Fri, Aug 12, 2011 at 09:34:41PM +0800, Osier Yang wrote: Intorduce new monitor functions to get the media status (ejected or inserted) of removable block device via qemu monitor command info block. QEMU upstream will expose the the media status

[libvirt] [PATCH 3/3] snapshot: let qemu discard only snapshot metadata

2011-08-12 Thread Eric Blake
Adding this was trivial compared to the previous patch for fixing qemu snapshot deletion in the first place. * src/qemu/qemu_driver.c (qemuDomainSnapshotDiscard): Add parameter. (qemuDomainSnapshotDiscardDescendant, qemuDomainSnapshotDelete): Update callers. --- Most of the diff is indentation.

[libvirt] [PATCH 2/3] snapshot: avoid crash when deleting qemu snapshots

2011-08-12 Thread Eric Blake
This one's nasty. Ever since we fixed virHashForEach to prevent nested hash iterations for safety reasons, virDomainSnapshotDelete with VIR_DOMAIN_SNAPSHOT_DELETE_CHILDREN has been broken for qemu: it deletes children, while leaving grandchildren intact but pointing to a no-longer-present parent.

[libvirt] [PATCH 1/3] snapshot: allow deletion of just snapshot metadata

2011-08-12 Thread Eric Blake
A future patch will make it impossible to remove a domain if it would leave behind any libvirt-tracked metadata about snapshots, since stale metadata interferes with a new domain by the same name. But requiring snaphot contents to be deleted before removing a domain is harsh; with qemu, qemu-img

Re: [libvirt] [PATCH 2/3] Improve tokenizing of linkable terms

2011-08-12 Thread Eric Blake
On 08/11/2011 09:18 PM, Daniel Veillard wrote: On Thu, Aug 11, 2011 at 02:44:00PM +0200, Philipp Hahn wrote: Currently only tabs and blanks are used for tokenizing the description, which breaks when a term is at the end of a line or has () appended to it. 1. Use also other white space

[libvirt] [PATCH 3/4] latency: Update handler in qemu driver.

2011-08-12 Thread Osier Yang
* src/qemu/qemu_driver.c: Update function qemudDomainBlockStats to support the new disk latency related members. --- src/qemu/qemu_driver.c |4 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index ce19be7..36d0d3f 100644

[libvirt] [PATCH 1/4] latency: Introduce new members for _virDomainBlockStats

2011-08-12 Thread Osier Yang
The new disk latency related members include: rd_total_times wr_total_times flush_operations flush_total_times --- include/libvirt/libvirt.h.in |4 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/include/libvirt/libvirt.h.in b/include/libvirt/libvirt.h.in

[libvirt] [RFC 0/4] Report disk latency information

2011-08-12 Thread Osier Yang
The QEMU side patches are not posted yet, but considering what these patche series need is only a fixed interface provided by QEMU, posting it for early reviewing, won't push it before QEMU patches are got pushed even it got ACK. Osier -- libvir-list mailing list libvir-list@redhat.com

[libvirt] [PATCH 4/4] latency: Update virsh command domblkstat to support the new members

2011-08-12 Thread Osier Yang
--- tools/virsh.c | 13 + 1 files changed, 13 insertions(+), 0 deletions(-) diff --git a/tools/virsh.c b/tools/virsh.c index b053ed0..555f278 100644 --- a/tools/virsh.c +++ b/tools/virsh.c @@ -1082,12 +1082,25 @@ cmdDomblkstat (vshControl *ctl, const vshCmd *cmd) if

[libvirt] [PATCH 2/4] latency: Parse the new disk latency keys in qemu monitor functions

2011-08-12 Thread Osier Yang
--- src/qemu/qemu_monitor.c | 12 src/qemu/qemu_monitor.h |4 src/qemu/qemu_monitor_json.c | 36 +++- src/qemu/qemu_monitor_json.h |5 - src/qemu/qemu_monitor_text.c | 39 +--

Re: [libvirt] [PATCH 1/2] virsh: don't reject undefine on active domain

2011-08-12 Thread Eric Blake
On 08/11/2011 09:11 PM, Daniel Veillard wrote: On Thu, Aug 11, 2011 at 08:39:22PM -0600, Eric Blake wrote: The public API documents that undefine may be used to transition a running persistent domain into a transient one. Many drivers still do not support this usage, but virsh shouldn't be

Re: [libvirt] [PATCH 2/2] vbox, xenapi: add virDomainUndefineFlags

2011-08-12 Thread Eric Blake
On 08/11/2011 09:12 PM, Daniel Veillard wrote: On Thu, Aug 11, 2011 at 08:39:23PM -0600, Eric Blake wrote: We forgot to add virDomainUndefineFlags for a couple of hypervisors. This wires up trivial versions (since neither hypervisor supports managed save yet, they do not need to support any

Re: [libvirt] [PATCH 3/5] Introduce functions for checking whether a pidfile is valid

2011-08-12 Thread Daniel P. Berrange
On Fri, Aug 12, 2011 at 02:10:00PM +0200, Jiri Denemark wrote: Eh, I forgot to add some more notes... ... diff --git a/src/util/virpidfile.c b/src/util/virpidfile.c index 25c3272..dc92868 100644 --- a/src/util/virpidfile.c +++ b/src/util/virpidfile.c @@ -24,6 +24,7 @@ #include

Re: [libvirt] [PATCH 1/4] latency: Introduce new members for _virDomainBlockStats

2011-08-12 Thread Daniel P. Berrange
On Fri, Aug 12, 2011 at 10:17:24PM +0800, Osier Yang wrote: The new disk latency related members include: rd_total_times wr_total_times flush_operations flush_total_times --- include/libvirt/libvirt.h.in |4 1 files changed, 4 insertions(+), 0 deletions(-) diff

Re: [libvirt] [PATCH 2/2] qemu: Clear source path of removable block if it is ejected.

2011-08-12 Thread Daniel P. Berrange
On Fri, Aug 12, 2011 at 09:14:09PM +0800, Osier Yang wrote: 于 2011年08月12日 21:04, Daniel P. Berrange 写道: The changes affect the running domain config, (e.g. for a running domain, virsh dumpxml won't display the source path of the media anymore once it's ejected inside guest. But think it's

[libvirt] [PATCH 0/5 v2] Some rearrangement additions to pid file handling/locking

2011-08-12 Thread Daniel P. Berrange
An update to: https://www.redhat.com/archives/libvir-list/2011-August/msg00349.html Changes in v2: - Fix all docs code bugs from previous review -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list

[libvirt] [PATCH 2/5] Move pidfile functions into util/virpidfile.{c, h}

2011-08-12 Thread Daniel P. Berrange
From: Daniel P. Berrange berra...@redhat.com The functions for manipulating pidfiles are in util/util.{c,h}. We will shortly be adding some further pidfile related functions. To avoid further growing util.c, this moves the pidfile related functions into a dedicated virpidfile.{c,h}. The functions

[libvirt] [PATCH 1/5] Add virFileLock and virFileUnlock APIs

2011-08-12 Thread Daniel P. Berrange
From: Daniel P. Berrange berra...@redhat.com Add some simple wrappers around the fcntl() discretionary file locking capability. * src/util/util.c, src/util/util.h, src/libvirt_private.syms: Add virFileLock and virFileUnlock APIs --- src/libvirt_private.syms |2 + src/util/virfile.c

[libvirt] [PATCH 3/5] Introduce functions for checking whether a pidfile is valid

2011-08-12 Thread Daniel P. Berrange
From: Daniel P. Berrange berra...@redhat.com In some cases the caller of virPidFileRead might like extra checks to determine whether the pid just read is really the one they are expecting. This adds virPidFileReadIfAlive which will check whether the pid is still alive with kill(0, -1), and (on

[libvirt] [PATCH 4/5] Add some APIs which use locking for crashsafe pidfile handling

2011-08-12 Thread Daniel P. Berrange
From: Daniel P. Berrange berra...@redhat.com In daemons using pidfiles to protect against concurrent execution there is a possibility that a crash may leave a stale pidfile on disk, which then prevents later restart of the daemon. To avoid this problem, introduce a pair of APIs which make use of

[libvirt] [PATCH 5/5] Convert libvirtd to use crash-safe pidfile APIs

2011-08-12 Thread Daniel P. Berrange
From: Daniel P. Berrange berra...@redhat.com Remove the current libvirtd pidfile handling code, in favour of calling out to the new APIs. This ensures libvirtd's pidfile handling is crashsafe This also means that the non-root libvirtd instances (for handling qemu:///session URIs) can now safely

Re: [libvirt] [PATCH 2/2] qemu: Clear source path of removable block if it is ejected.

2011-08-12 Thread Osier Yang
[ CC to Markus and Luiz ] 于 2011年08月12日 22:00, Daniel P. Berrange 写道: On Fri, Aug 12, 2011 at 09:14:09PM +0800, Osier Yang wrote: 于 2011年08月12日 21:04, Daniel P. Berrange 写道: The changes affect the running domain config, (e.g. for a running domain, virsh dumpxml won't display the source

Re: [libvirt] RFCv2: virDomainSnapshotCreateXML enhancements

2011-08-12 Thread Eric Blake
On 08/11/2011 08:36 PM, Eric Blake wrote: In implementing this in virsh, I found that for backwards compatibility reasons, it would be easier to two flags instead of one, since both use cases seem plausible (do the bare minimum to remove my domain, but wihtout losing snapshot data, vs. nuke

[libvirt] [PATCH] doc: Document the Block Job API

2011-08-12 Thread Adam Litke
Hi DV, This patch adds some basic documentation to the development guide for the Block Job APIs as you requested. Also included is a sample program that shows end-to-end use of the BlockPull operation. I hope this is close to what you had in mind. Signed-off-by: Adam Litke a...@us.ibm.com ---

Re: [libvirt] [PATCH 1/3] snapshot: allow deletion of just snapshot metadata

2011-08-12 Thread Eric Blake
On 08/12/2011 07:30 AM, Eric Blake wrote: A future patch will make it impossible to remove a domain if it would leave behind any libvirt-tracked metadata about snapshots, since stale metadata interferes with a new domain by the same name. But requiring snaphot contents to be deleted before

[libvirt] [PATCH] virsh: fix logic bug

2011-08-12 Thread Eric Blake
Bug introduced in commit 9a0ec36. * tools/virsh.c (cmdUndefine): Add missing line. --- Pushing under the trivial rule. tools/virsh.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/tools/virsh.c b/tools/virsh.c index 070d461..f995ae6 100644 --- a/tools/virsh.c +++

Re: [libvirt] [PATCH 3/5] Introduce functions for checking whether a pidfile is valid

2011-08-12 Thread Jiri Denemark
On Fri, Aug 12, 2011 at 14:46:35 +0100, Daniel P. Berrange wrote: On Fri, Aug 12, 2011 at 02:10:00PM +0200, Jiri Denemark wrote: ... +if (virAsprintf(procpath, /proc/%d/exe, *pid) 0) { +*pid = -1; +return 0; +} +#ifdef __linux__ +if

[libvirt] [BUG?] killall -SIGHUP libvirtd / virStateReload

2011-08-12 Thread Philipp Hahn
Hello, did something happen to sending SIGHUP to libvirtd? I can't find where the hook for SIGHUP is installed and virStateReload() seems to be uncalled. In 0.8.4 that was handled from qemudDispatchSignalEvent(), which seems to be gone. At least the manual page should be updated? Sincerely

Re: [libvirt] [PATCH 3/5] Introduce functions for checking whether a pidfile is valid

2011-08-12 Thread Jiri Denemark
On Fri, Aug 12, 2011 at 15:07:21 +0100, Daniel P. Berrange wrote: From: Daniel P. Berrange berra...@redhat.com In some cases the caller of virPidFileRead might like extra checks to determine whether the pid just read is really the one they are expecting. This adds virPidFileReadIfAlive which

Re: [libvirt] [PATCH 0/5 v2] Some rearrangement additions to pid file handling/locking

2011-08-12 Thread Jiri Denemark
On Fri, Aug 12, 2011 at 15:07:18 +0100, Daniel P. Berrange wrote: An update to: https://www.redhat.com/archives/libvir-list/2011-August/msg00349.html Changes in v2: - Fix all docs code bugs from previous review ACK series with the indentation nit in 3/5 fixed. Jirka -- libvir-list

[libvirt] [PATCH] virsh: fix logic bug

2011-08-12 Thread Eric Blake
Two copy-and-paste bugs in a row. :( * tools/virsh.c (cmdUndefine): Also avoid dead store. --- Another trivial rule push. tools/virsh.c |3 --- 1 files changed, 0 insertions(+), 3 deletions(-) diff --git a/tools/virsh.c b/tools/virsh.c index 4beb274..c282164 100644 --- a/tools/virsh.c

[libvirt] [PATCH 0/6] snapshot work - don't strand snapshot metadata

2011-08-12 Thread Eric Blake
Maps pretty well to my RFC email trail, as amended with followups: https://www.redhat.com/archives/libvir-list/2011-August/msg00452.html The qemu_driver diffstat is deceptively large; there's some code motion thrown in on 3/6. This series requires acks on the earlier one:

[libvirt] [PATCH 3/6] snapshot: refactor some qemu code

2011-08-12 Thread Eric Blake
Prepare for code sharing. No semantic change. * src/qemu/qemu_driver.c (qemuFindQemuImgBinary) (qemuDomainSnapshotDiscard): Float up. (qemuDomainSnapshotDiscardDescendant): Likewise, and rename... (qemuDomainSnapshotDiscardAll): ...for generic use. (qemuDomainSnapshotDelete): Update caller. ---

[libvirt] [PATCH 1/6] snapshot: identify which snapshots have metadata

2011-08-12 Thread Eric Blake
To make it easier to know when undefine will fail because of existing snapshot metadata, we need to know how many snapshots have metadata. * include/libvirt/libvirt.h.in (VIR_DOMAIN_SNAPSHOT_NUM_METADATA): New flag. * src/libvirt.c (virDomainSnapshotNum): Document it. * src/esx/esx_driver.c

[libvirt] [PATCH 4/6] snapshot: cache qemu-img location

2011-08-12 Thread Eric Blake
As more clients start to want to know this information, doing a PATH stat walk and malloc for every client adds up. * src/qemu/qemu_conf.h (qemud_driver): Add member. * src/qemu/qemu_driver.c (qemudShutdown): Cleanup. (qemuFindQemuImgBinary): Add an argument, and cache result.

[libvirt] [PATCH 2/6] snapshot: prevent stranding snapshot data on domain destruction

2011-08-12 Thread Eric Blake
Just as leaving managed save metadata behind can cause problems when creating a new domain that happens to collide with the name of the just-deleted domain, the same is true of leaving any snapshot metadata behind. For safety sake, extend the semantic change of commit b26a9fa9 to also cover

[libvirt] [PATCH 5/6] snapshot: support new undefine flags in qemu

2011-08-12 Thread Eric Blake
A nice benefit of deleting all snapshots at undefine time is that you don't have to do any reparenting or subtree identification - since everything goes, this is an O(n) process whereas using multiple virDomainSnapshotDelete calls would be O(n^2) or worse. * src/qemu/qemu_driver.c

[libvirt] [PATCH 6/6] snapshot: teach virsh about new undefine flags

2011-08-12 Thread Eric Blake
Similar to 'undefine --managed-save' (commit 83e849c1), we must assume that the old API is unsafe, and emulate it ourselves. Additionally, we have the wrinkle that while virDomainUndefineFlags and managed save cleanup were introduced in 0.9.4, it wasn't until 0.9.5 that snapshots block undefine of

[libvirt] [PATCH 7/6] snapshot: prevent migration from stranding snapshot data

2011-08-12 Thread Eric Blake
Migration is another case of stranding metadata. And since snapshot metadata is arbitrarily large, there's no way to shoehorn it into the migration cookie of migration v3. A future patch will make it possible to manually recreate the snapshot metadata on the destination. But even that is

Re: [libvirt] RFCv2: virDomainSnapshotCreateXML enhancements

2011-08-12 Thread Eric Blake
On 08/12/2011 08:33 AM, Eric Blake wrote: On 08/11/2011 08:36 PM, Eric Blake wrote: In implementing this in virsh, I found that for backwards compatibility reasons, it would be easier to two flags instead of one, since both use cases seem plausible (do the bare minimum to remove my domain, but

[libvirt] [PATCH] snapshot: one less point of failure in qemu

2011-08-12 Thread Eric Blake
https://bugzilla.redhat.com/show_bug.cgi?id=727709 mentions that if qemu fails to create the snapshot (such as what happens on Fedora 15 qemu, which has qmp but where savevm is only in hmp, and where libvirt is old enough to not try the hmp fallback), then 'virsh snapshot-list dom' will show a

Re: [libvirt] [BUG?] killall -SIGHUP libvirtd / virStateReload

2011-08-12 Thread Eric Blake
On 08/12/2011 11:58 AM, Philipp Hahn wrote: Hello, did something happen to sending SIGHUP to libvirtd? I can't find where the hook for SIGHUP is installed and virStateReload() seems to be uncalled. In 0.8.4 that was handled from qemudDispatchSignalEvent(), which seems to be gone. At least the

Re: [libvirt] [PATCH] Fix domxml-from-native xen-sxpr for domain/clock/@offset='localtime'

2011-08-12 Thread Eric Blake
On 04/27/2011 07:20 AM, Philipp Hahn wrote: At least Xen-3.4.3 translates the /vm/localtime SXPR value to /domain/platform/localtime and /domain/image/{linux,hvm}/localtime when the domain is defined. When reading back that information libvirt still tries to read /domain/localtime, which now

[libvirt] Deadlock when using custom handlers

2011-08-12 Thread Guido Günther
Hi, virt-viewer is using it's own virEventRegisterImpl. With current libvirt this can deadlock when connection to nonexistant URIs like qemu+ssh:///unknownhost.example.com/system like: 23:47:00.338: 1526: debug : doRemoteOpen:503 : proceeding with name = qemu:///system 23:47:00.338: 1526:

[libvirt] [PATCH] build: silence gcc warning

2011-08-12 Thread Eric Blake
util/virpidfile.c: In function 'virPidFileAcquirePath': util/virpidfile.c:308:66: error: nested extern declaration of '_gl_verify_function2' [-Wnested-externs] * src/util/virpidfile.c (virPidFileAcquirePath): Move verify to top level. --- Pushing under the build-breaker rule.

Re: [libvirt] [PATCH 2/3] snapshot: save domain description with snapshot

2011-08-12 Thread Eric Blake
On 04/12/2011 12:16 AM, Philipp Hahn wrote: Save the domain description with the XML snapshot data. TODOs: - XML file is no longer nicely indented Cosmetic, and can be fixed later. - Fix esx driver - Fix vbox driver Do these need to save domain xml state in the first place? They aren't

Re: [libvirt] [PATCH] build: silence gcc warning

2011-08-12 Thread Eric Blake
On 08/12/2011 03:55 PM, Eric Blake wrote: util/virpidfile.c: In function 'virPidFileAcquirePath': util/virpidfile.c:308:66: error: nested extern declaration of '_gl_verify_function2' [-Wnested-externs] * src/util/virpidfile.c (virPidFileAcquirePath): Move verify to top level. --- Pushing

Re: [libvirt] [PATCH 1/3] Swap virDomain / virFomainSnapshot declaration

2011-08-12 Thread Eric Blake
On 04/12/2011 12:06 AM, Philipp Hahn wrote: 0.33 years(!) later: In preparation for storing the domain description with the snapshot, swap the order of declaration. Signed-off-by: Philipp Hahnh...@univention.de --- src/conf/domain_conf.h | 100

[libvirt] [PATCH 2/4 v2] pci: Add helper functions for sriov devices

2011-08-12 Thread Roopa Prabhu
From: Roopa Prabhu ropra...@cisco.com This patch adds the following helper functions: pciDeviceIsVirtualFunction: Function to check if a pci device is a sriov VF pciGetVirtualFunctionIndex: Function to get the VF index of a sriov VF pciDeviceNetName: Function to get the network device name of a

[libvirt] [PATCH 1/4 v2] pci: Move some pci sriov helper code out of node device driver to util/pci

2011-08-12 Thread Roopa Prabhu
From: Roopa Prabhu ropra...@cisco.com This patch moves some of the sriov related pci code from node_device driver to src/util/pci.[ch]. Some functions had to go thru name and argument list change to accommodate the move. Signed-off-by: Roopa Prabhu ropra...@cisco.com Signed-off-by: Christian

[libvirt] [PATCH 0/4 v2] macvtap: Support for sending port profile message for a SRIOV VF to its PF

2011-08-12 Thread Roopa Prabhu
This patch tries to fix getPhysFn in macvtap.c to get the physical function(PF) of the direct attach interface, if the interface is a SR-IOV VF. It moves some of the sriov pci device handling code from node_device_driver to src/util/pci.[ch]. This patch series implements the following 01/3 -

[libvirt] [PATCH 3/4 v2] interface: Add functions to get sriov PF/VF relationship of a net interface

2011-08-12 Thread Roopa Prabhu
From: Roopa Prabhu ropra...@cisco.com This patch adds the following functions to get PF/VF relationship of an SRIOV network interface: ifaceIsVirtualFunction: Function to check if a network interface is a SRIOV VF ifaceGetVirtualFunctionIndex: Function to get VF index if a network interface is a

[libvirt] [PATCH 4/4 v2] macvtap: Fix getPhysfn to get the PF of a direct attach network interface

2011-08-12 Thread Roopa Prabhu
From: Roopa Prabhu ropra...@cisco.com This patch renames getPhysfn to getPhysfnDev and adds code to get the Physical function and Virtual Function index of the direct attach linkdev (if the direct attach interface is a SRIOV VF). The idea is to send the port profile message to a PF if the direct

[libvirt] KVM Forum 2011

2011-08-12 Thread KVM Forum 2011 PC
For those who are travelling to the KVM Forum, looking forward to seeing you in Vancouver. And for those who can't make it, we'll be posting the presentations online as well as recording the presentations and making the videos available online (subject to presenter's approval). Here is the

[libvirt] [PATCH 3/3] snapshot: update rng to support full domain in xml

2011-08-12 Thread Eric Blake
* docs/schemas/domain.rng: Move guts... * docs/schemas/domaincommon.rng: ...to new file. * docs/schemas/domainsnapshot.rng: Allow new xml. * docs/schemas/Makefile.am (schema_DATA): Distribute new file. * tests/domainsnapshotxml2xmlout/full_domain.xml: New test. --- I've shortened this email by

[libvirt] [PATCH 1/3] snapshot: refactor domain xml output

2011-08-12 Thread Eric Blake
Minor semantic change - allow domain xml to be generated in place within a larger buffer, rather than having to go through a temporary string. * src/conf/domain_conf.c (virDomainDefFormatInternal): Add parameter. (virDomainDefFormat, virDomainObjFormat): Update callers. ---

[libvirt] [PATCH 2/3] snapshot: track full domain xml in snapshot

2011-08-12 Thread Eric Blake
Just like VM saved state images (virsh save), snapshots MUST track the inactive domain xml to detect any ABI incompatibilities. The indentation is not perfect, but functionality comes before form. * src/conf/domain_conf.h (_virDomainSnapshotDef): Add member. (virDomainSnapshotDefParseString,