Re: [libvirt] [PATCH 1/3] Re-factor qemu version parsing

2009-06-11 Thread Daniel P. Berrange
On Wed, Jun 10, 2009 at 09:02:39PM +0100, Mark McLoughlin wrote: This patch is purely re-factoring without any functional changes to make way for the next patch. The main thing achieved by the refactoring is that we now have easier access to the parenthesised string that KVM folks seem to

Re: [libvirt] [PATCH 1/3] Re-factor qemu version parsing

2009-06-11 Thread Daniel Veillard
On Wed, Jun 10, 2009 at 09:02:39PM +0100, Mark McLoughlin wrote: This patch is purely re-factoring without any functional changes to make way for the next patch. The main thing achieved by the refactoring is that we now have easier access to the parenthesised string that KVM folks seem to

Re: [libvirt] [PATCH 1/3] Re-factor qemu version parsing

2009-06-11 Thread Mark McLoughlin
On Thu, 2009-06-11 at 15:49 +0200, Daniel Veillard wrote: +#define QEMU_VERSION_STRQEMU PC emulator version +#define KVM_VER_PREFIX (kvm- + +static int qemudParseHelpStr(const char *help, + unsigned int *flags, +

Re: [libvirt] [PATCH 1/3] Re-factor qemu version parsing

2009-06-10 Thread Daniel P. Berrange
On Wed, Jun 10, 2009 at 01:17:35PM +0100, Mark McLoughlin wrote: This patch is purely re-factoring without any functional changes to make way for the next patch. The main thing achieved by the refactoring is that we now have easier access to the parenthesised string that KVM folks seem to

Re: [libvirt] [PATCH 1/3] Re-factor qemu version parsing

2009-06-10 Thread Mark McLoughlin
On Wed, 2009-06-10 at 13:21 +0100, Daniel P. Berrange wrote: +char *eol = strchr(help, '\n'); +if (eol) *eol = '\0'; IIUC this NULL terminates the 'help' string on the first line, which will surely break -if (!kvm_version -sscanf(help, QEMU PC emulator

[libvirt] [PATCH 1/3] Re-factor qemu version parsing

2009-06-10 Thread Mark McLoughlin
This patch is purely re-factoring without any functional changes to make way for the next patch. The main thing achieved by the refactoring is that we now have easier access to the parenthesised string that KVM folks seem to delight in changing. Signed-off-by: Mark McLoughlin mar...@redhat.com