[Libvir] Re: [PATCH 2/7] Fix issues with QEMU monitor interface.

2007-08-13 Thread Daniel Veillard
On Sun, Aug 12, 2007 at 07:11:34PM -0400, Jim Paris wrote: Due to the TTY layer, sending \n to the qemu monitor translates into \r\n when received. This triggers a bug in older versions of QEMU (KVM = 33) because the same command is executed twice, and still has problems with fixed QEMU

[Libvir] Re: [PATCH 1/7] Fix memory leak

2007-08-13 Thread Daniel Veillard
On Sun, Aug 12, 2007 at 07:11:33PM -0400, Jim Paris wrote: Signed-off-by: Jim Paris [EMAIL PROTECTED] --- src/qemu_driver.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/src/qemu_driver.c b/src/qemu_driver.c index 7c75d9c..b05c3f6 100644 ---

Re: [Libvir] [PATCH] Block device and network stats

2007-08-13 Thread Daniel Veillard
On Fri, Aug 10, 2007 at 03:35:08PM +0100, Richard W.M. Jones wrote: This is the implementation (currently Xen, local only). Thanks ! +++ include/libvirt/libvirt.h.in 10 Aug 2007 14:30:21 - @@ -14,6 +14,9 @@ #ifndef __VIR_VIRLIB_H__ #define __VIR_VIRLIB_H__ +#include

[Libvir] Re: [PATCH 3/7] Add option to pass stdin fd to virExec

2007-08-13 Thread Daniel Veillard
On Sun, Aug 12, 2007 at 07:11:35PM -0400, Jim Paris wrote: If nonzero, uses the supplied fd instead of /dev/null. Update callers accordingly. Looks fine to me, we already have stdout and stderr, it's sensible. +1 Daniel -- Red Hat Virtualization group http://redhat.com/virtualization/

[Libvir] Re: [PATCH 2/7] Fix issues with QEMU monitor interface.

2007-08-13 Thread Daniel P. Berrange
On Mon, Aug 13, 2007 at 05:59:15AM -0400, Daniel Veillard wrote: On Sun, Aug 12, 2007 at 07:11:34PM -0400, Jim Paris wrote: Due to the TTY layer, sending \n to the qemu monitor translates into \r\n when received. This triggers a bug in older versions of QEMU (KVM = 33) because the same

[Libvir] Re: [PATCH 3/7] Add option to pass stdin fd to virExec

2007-08-13 Thread Daniel P. Berrange
On Mon, Aug 13, 2007 at 06:01:42AM -0400, Daniel Veillard wrote: On Sun, Aug 12, 2007 at 07:11:35PM -0400, Jim Paris wrote: If nonzero, uses the supplied fd instead of /dev/null. Update callers accordingly. Looks fine to me, we already have stdout and stderr, it's sensible. +1 Looks OK,

Re: [Libvir] [PATCH] Block device and network stats

2007-08-13 Thread Daniel Veillard
On Mon, Aug 13, 2007 at 12:45:39PM +0100, Daniel P. Berrange wrote: On Mon, Aug 13, 2007 at 05:45:27AM -0400, Daniel Veillard wrote: On Fri, Aug 10, 2007 at 03:35:08PM +0100, Richard W.M. Jones wrote: This is the implementation (currently Xen, local only). Thanks ! +++

[Libvir] Re: [PATCH 2/7] Fix issues with QEMU monitor interface.

2007-08-13 Thread Jim Paris
Daniel Veillard wrote: +/* Copy data, skipping 3-byte escape sequences */ +for (i = 0; i got; i++) { +if (data[i] == '\033') +skip = 3; +if (skip) +skip--; +else +

[Libvir] Re: [PATCH 6/7] Add KVM save support using migration.

2007-08-13 Thread Daniel Veillard
On Sun, Aug 12, 2007 at 07:11:38PM -0400, Jim Paris wrote: The save file format consists of a header, XML for the domain, and the raw QEMU/KVM migration data stream. -static int qemudDomainSave(virDomainPtr dom, -const char *path ATTRIBUTE_UNUSED) { +#define

[Libvir] [PATCH] Fix issues with QEMU monitor interface.

2007-08-13 Thread Jim Paris
Due to the TTY layer, sending \n to the qemu monitor translates into \r\n when received. This triggers a bug in older versions of QEMU (KVM = 33) because the same command is executed twice, and still has problems with fixed QEMU because the (qemu) prompt is printed twice. Switch all monitor

[Libvir] [PATCH] Add qemudEscapeShellArg for passing commandlines to qemu.

2007-08-13 Thread Jim Paris
Use this to escape a shell argument in a commandline passed to qemu. First we need to escape certain characters to get them through the qemu monitor interface. On the shell side, the argument will be enclosed in single quotes, so the only character that needs special treatment is the single quote

[Libvir] [PATCH] Add KVM save support using migration.

2007-08-13 Thread Jim Paris
The save file format consists of a header, XML for the domain, and the raw QEMU/KVM migration data stream. Signed-off-by: Jim Paris [EMAIL PROTECTED] --- src/qemu_driver.c | 112 ++-- 1 files changed, 107 insertions(+), 5 deletions(-) diff --git

[Libvir] [PATCH 0/7] QEMU/KVM save/restore support, take 3

2007-08-13 Thread Jim Paris
Here's take 3 of the QEMU/KVM save/restore support. Thanks for your input. Changes since last time: - Remove escape sequence filtering, it's not necessary. - Clean up stdin handling in virExec, use -1 to signify unused - Add signal-safe read/write wrappers that handle EINTR and use them. -

[Libvir] [PATCH] Add migration support to QEMU startup.

2007-08-13 Thread Jim Paris
Adds new fields in qemu_vm structure. vm-migrateFrom specifies the argument to -incoming. vm-stdin specifies the file descriptor to pass to virExec as stdin, which will be used for the -incoming stdio case. Signed-off-by: Jim Paris [EMAIL PROTECTED] --- src/qemu_conf.c | 13 -

[Libvir] [PATCH] Add KVM restore support using migration.

2007-08-13 Thread Jim Paris
Signed-off-by: Jim Paris [EMAIL PROTECTED] --- src/qemu_driver.c | 113 +++-- 1 files changed, 109 insertions(+), 4 deletions(-) diff --git a/src/qemu_driver.c b/src/qemu_driver.c index f2c4316..b0b6d62 100644 --- a/src/qemu_driver.c +++

[Libvir] [PATCH] Add signal-safe read/write wrappers

2007-08-13 Thread Jim Paris
Adds saferead() and safewrite(), which are like read() and write() except that they retry in case of EINTR. Signed-off-by: Jim Paris [EMAIL PROTECTED] --- src/util.c | 37 + src/util.h |2 ++ 2 files changed, 39 insertions(+), 0 deletions(-) diff --git

Re: [Libvir] [PATCH 0/7] QEMU/KVM save/restore support, take 3

2007-08-13 Thread Jim Paris
Sorry, I'm still trying to learn these tools ... those subjects weren't numbered. The order should be: Subject: [PATCH 1/7] Fix issues with QEMU monitor interface. Subject: [PATCH 2/7] Add option to pass stdin fd to virExec Subject: [PATCH 3/7] Add migration support to QEMU startup. Subject:

Re: [Libvir] [PATCH] Fix issues with QEMU monitor interface.

2007-08-13 Thread Daniel P. Berrange
On Mon, Aug 13, 2007 at 02:17:04PM -0400, Jim Paris wrote: Due to the TTY layer, sending \n to the qemu monitor translates into \r\n when received. This triggers a bug in older versions of QEMU (KVM = 33) because the same command is executed twice, and still has problems with fixed QEMU

Re: [Libvir] [PATCH] Add option to pass stdin fd to virExec

2007-08-13 Thread Daniel P. Berrange
On Mon, Aug 13, 2007 at 02:17:05PM -0400, Jim Paris wrote: If non-negative, uses the supplied fd instead of /dev/null. Update callers accordingly. Commited to CVS Regards, Dan. -- |=- Red Hat, Engineering, Emerging Technologies, Boston. +1 978 392 2496 -=| |=- Perl modules:

Re: [Libvir] [PATCH] Add migration support to QEMU startup.

2007-08-13 Thread Daniel P. Berrange
On Mon, Aug 13, 2007 at 02:17:06PM -0400, Jim Paris wrote: Adds new fields in qemu_vm structure. vm-migrateFrom specifies the argument to -incoming. vm-stdin specifies the file descriptor to pass to virExec as stdin, which will be used for the -incoming stdio case. Committed to CVS

Re: [Libvir] [PATCH] Add qemudEscapeShellArg for passing commandlines to qemu.

2007-08-13 Thread Daniel P. Berrange
On Mon, Aug 13, 2007 at 02:17:07PM -0400, Jim Paris wrote: Use this to escape a shell argument in a commandline passed to qemu. First we need to escape certain characters to get them through the qemu monitor interface. On the shell side, the argument will be enclosed in single quotes, so the

Re: [Libvir] [PATCH] Add signal-safe read/write wrappers

2007-08-13 Thread Daniel P. Berrange
On Mon, Aug 13, 2007 at 02:17:08PM -0400, Jim Paris wrote: Adds saferead() and safewrite(), which are like read() and write() except that they retry in case of EINTR. Good stuff, committed to CVS. Regards, Dan. -- |=- Red Hat, Engineering, Emerging Technologies, Boston. +1 978 392 2496 -=|

Re: [Libvir] [PATCH] Add KVM save support using migration.

2007-08-13 Thread Daniel P. Berrange
On Mon, Aug 13, 2007 at 02:17:09PM -0400, Jim Paris wrote: The save file format consists of a header, XML for the domain, and the raw QEMU/KVM migration data stream. I've comitted this Regards, Dan. -- |=- Red Hat, Engineering, Emerging Technologies, Boston. +1 978 392 2496 -=| |=-

Re: [Libvir] [PATCH] Add KVM restore support using migration.

2007-08-13 Thread Daniel P. Berrange
Committed this too. Works very nicely - and wow it is fast to save restore. Dan. -- |=- Red Hat, Engineering, Emerging Technologies, Boston. +1 978 392 2496 -=| |=- Perl modules: http://search.cpan.org/~danberr/ -=| |=- Projects:

Re: [Libvir] [PATCH 0/7] QEMU/KVM save/restore support, take 3

2007-08-13 Thread Daniel P. Berrange
On Mon, Aug 13, 2007 at 02:17:03PM -0400, Jim Paris wrote: Here's take 3 of the QEMU/KVM save/restore support. Thanks for your input. Changes since last time: - Remove escape sequence filtering, it's not necessary. - Clean up stdin handling in virExec, use -1 to signify unused - Add

Re: [Libvir] [PATCH 0/7] QEMU/KVM save/restore support, take 3

2007-08-13 Thread Daniel Veillard
On Tue, Aug 14, 2007 at 03:19:24AM +0100, Daniel P. Berrange wrote: On Mon, Aug 13, 2007 at 02:17:03PM -0400, Jim Paris wrote: Here's take 3 of the QEMU/KVM save/restore support. Thanks for your input. Changes since last time: - Remove escape sequence filtering, it's not necessary.