[libvirt] PATCH: Enable migration with QEMU >= 0.10.0

The KVM migration code was added to QEMU for the 0.10.0 release, so we should enable this in libvirt now. Daniel diff -r be7993675e07 src/qemu_conf.c --- a/src/qemu_conf.c Thu Apr 30 14:49:27 2009 +0100 +++ b/src/qemu_conf.c Thu Apr 30 15:08:45 2009 +0100 @@ -473,16 +473,13 @@ int qemudExtractVersionInfo(const char * /* * Handling of -incoming arg with varying features - * -incoming tcp (kvm >= 79) - * -incoming exec (kvm >= 80) + * -incoming tcp (kvm >= 79, qemu >= 0.10.0) + * -incoming exec (kvm >= 80, qemu >= 0.10.0) * -incoming stdio (all earlier kvm) * * NB, there was a pre-kvm-79 'tcp' support, but it * was broken, because it blocked the monitor console * while waiting for data, so pretend it doesn't exist - * - * XXX when next QEMU release after 0.9.1 arrives, - * we'll need to add MIGRATE_QEMU_TCP/EXEC here too */ if (kvm_version >= 79) { flags |= QEMUD_CMD_FLAG_MIGRATE_QEMU_TCP; @@ -490,6 +487,9 @@ int qemudExtractVersionInfo(const char * flags |= QEMUD_CMD_FLAG_MIGRATE_QEMU_EXEC; } else if (kvm_version > 0) { flags |= QEMUD_CMD_FLAG_MIGRATE_KVM_STDIO; + } else if (version >= 10000) { + flags |= QEMUD_CMD_FLAG_MIGRATE_QEMU_TCP; + flags |= QEMUD_CMD_FLAG_MIGRATE_QEMU_EXEC; } if (retversion) -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|

On Thu, Apr 30, 2009 at 03:09:05PM +0100, Daniel P. Berrange wrote:
The KVM migration code was added to QEMU for the 0.10.0 release, so we should enable this in libvirt now.
Oh, right, ACK, Grepping for TODO and XXX in */*.c gives an impressibve list ... Daniel -- Daniel Veillard | libxml Gnome XML XSLT toolkit http://xmlsoft.org/ daniel@veillard.com | Rpmfind RPM search engine http://rpmfind.net/ http://veillard.com/ | virtualization library http://libvirt.org/

Daniel P. Berrange schrieb:
The KVM migration code was added to QEMU for the 0.10.0 release, so we should enable this in libvirt now.
Daniel
Hello Why is in qemu_conf.c caps initialized with 0 for offlineMigrate and liveMigrate? qemu_conf.c line 364 ff virCapsPtr qemudCapsInit(void) { struct utsname utsname; virCapsPtr caps; int i; /* Really, this never fails - look at the man-page. */ uname (&utsname); if ((caps = virCapabilitiesNew(utsname.machine, 0, 0)) == NULL) virsh capabilities does not return <migration_features> Is this a bug or doesn't it matter and is a mere cosmetical issue? in virCapabilitiesNew() in capabilities.c line 51 and 52 caps->host.offlineMigrate and caps->host.liveMigrate is so set to 0. Should this be fixed and both set to 1 when setting caps with virCapabilitiesNew because if i do so i get the with: if ((caps = virCapabilitiesNew(utsname.machine, 0, 0)) == NULL) [root@rr010 ~]# virsh capabilities <capabilities> <host> <cpu> <arch>x86_64</arch> </cpu> <topology> <cells num='1'> <cell id='0'> <cpus num='4'> <cpu id='0'/> <cpu id='1'/> <cpu id='2'/> <cpu id='3'/> </cpus> </cell> </cells> </topology> </host> with: if ((caps = virCapabilitiesNew(utsname.machine, 1, 1)) == NULL) [root@rr016 ~]# virsh capabilities <capabilities> <host> <cpu> <arch>x86_64</arch> </cpu> <migration_features> <live/> </migration_features> <topology> <cells num='1'> <cell id='0'> <cpus num='2'> <cpu id='0'/> <cpu id='1'/> </cpus> </cell> </cells> </topology> </host>

On Wed, May 13, 2009 at 10:43:39PM +0200, Gerrit Slomma wrote:
Daniel P. Berrange schrieb:
The KVM migration code was added to QEMU for the 0.10.0 release, so we should enable this in libvirt now.
Daniel
Hello
Why is in qemu_conf.c caps initialized with 0 for offlineMigrate and liveMigrate?
qemu_conf.c line 364 ff
virCapsPtr qemudCapsInit(void) { struct utsname utsname; virCapsPtr caps; int i;
/* Really, this never fails - look at the man-page. */ uname (&utsname);
if ((caps = virCapabilitiesNew(utsname.machine, 0, 0)) == NULL)
virsh capabilities does not return <migration_features> Is this a bug or doesn't it matter and is a mere cosmetical issue?
That's a bug. It also doesn't specify the supported URI formats Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|

Daniel P. Berrange schrieb:
On Wed, May 13, 2009 at 10:43:39PM +0200, Gerrit Slomma wrote:
Daniel P. Berrange schrieb:
The KVM migration code was added to QEMU for the 0.10.0 release, so we should enable this in libvirt now.
Daniel
Hello
Why is in qemu_conf.c caps initialized with 0 for offlineMigrate and liveMigrate?
qemu_conf.c line 364 ff
virCapsPtr qemudCapsInit(void) { struct utsname utsname; virCapsPtr caps; int i;
/* Really, this never fails - look at the man-page. */ uname (&utsname);
if ((caps = virCapabilitiesNew(utsname.machine, 0, 0)) == NULL)
virsh capabilities does not return <migration_features> Is this a bug or doesn't it matter and is a mere cosmetical issue?
That's a bug. It also doesn't specify the supported URI formats
Daniel
So could this patch for the now be applied? --- a/src/qemu_conf.c 2009-04-20 11:08:15.000000000 +0200 +++ b/src/qemu_conf.c 2009-05-13 22:28:31.000000000 +0200 @@ -370,7 +370,7 @@ uname (&utsname); if ((caps = virCapabilitiesNew(utsname.machine, - 0, 0)) == NULL) + 1, 1)) == NULL) goto no_memory; /* Using KVM's mac prefix for QEMU too */ would look up for the URI formats too if i have some time to spare. Gerrit

On Thu, May 14, 2009 at 09:28:04PM +0200, Gerrit Slomma wrote:
So could this patch for the now be applied?
--- a/src/qemu_conf.c 2009-04-20 11:08:15.000000000 +0200 +++ b/src/qemu_conf.c 2009-05-13 22:28:31.000000000 +0200 @@ -370,7 +370,7 @@ uname (&utsname);
if ((caps = virCapabilitiesNew(utsname.machine, - 0, 0)) == NULL) + 1, 1)) == NULL) goto no_memory;
/* Using KVM's mac prefix for QEMU too */
would look up for the URI formats too if i have some time to spare.
Hum, shouldn't we check for the version of QEmu being used first ? If you sit on #virt it's very frequent to see people with code base more than one year old, and we can't really expect everybody to upgrade every 6 months. Or did I miss something ? Daniel -- Daniel Veillard | libxml Gnome XML XSLT toolkit http://xmlsoft.org/ daniel@veillard.com | Rpmfind RPM search engine http://rpmfind.net/ http://veillard.com/ | virtualization library http://libvirt.org/

On Fri, May 15, 2009 at 10:40:55AM +0200, Daniel Veillard wrote:
On Thu, May 14, 2009 at 09:28:04PM +0200, Gerrit Slomma wrote:
So could this patch for the now be applied?
--- a/src/qemu_conf.c 2009-04-20 11:08:15.000000000 +0200 +++ b/src/qemu_conf.c 2009-05-13 22:28:31.000000000 +0200 @@ -370,7 +370,7 @@ uname (&utsname);
if ((caps = virCapabilitiesNew(utsname.machine, - 0, 0)) == NULL) + 1, 1)) == NULL) goto no_memory;
/* Using KVM's mac prefix for QEMU too */
would look up for the URI formats too if i have some time to spare.
Hum, shouldn't we check for the version of QEmu being used first ? If you sit on #virt it's very frequent to see people with code base more than one year old, and we can't really expect everybody to upgrade every 6 months. Or did I miss something ?
This is really reflecting the host driver capabilities as a whole, rather than whether it will succeed for a particular VM. The libvirt driver supports migrate, but certain QEMU binaries may not, in which case the app would get an appropriate error message later when invoking the API. You can have multiple QEMU binaries with different capabilies on the same host, so we can't accurately represent that here. Regards, Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|

On Fri, May 15, 2009 at 10:26:57AM +0100, Daniel P. Berrange wrote:
On Fri, May 15, 2009 at 10:40:55AM +0200, Daniel Veillard wrote:
On Thu, May 14, 2009 at 09:28:04PM +0200, Gerrit Slomma wrote:
So could this patch for the now be applied?
--- a/src/qemu_conf.c 2009-04-20 11:08:15.000000000 +0200 +++ b/src/qemu_conf.c 2009-05-13 22:28:31.000000000 +0200 @@ -370,7 +370,7 @@ uname (&utsname);
if ((caps = virCapabilitiesNew(utsname.machine, - 0, 0)) == NULL) + 1, 1)) == NULL) goto no_memory;
haha, now I remember where I had seen it :-)
/* Using KVM's mac prefix for QEMU too */
would look up for the URI formats too if i have some time to spare.
Hum, shouldn't we check for the version of QEmu being used first ? If you sit on #virt it's very frequent to see people with code base more than one year old, and we can't really expect everybody to upgrade every 6 months. Or did I miss something ?
This is really reflecting the host driver capabilities as a whole, rather than whether it will succeed for a particular VM. The libvirt driver supports migrate, but certain QEMU binaries may not, in which case the app would get an appropriate error message later when invoking the API. You can have multiple QEMU binaries with different capabilies on the same host, so we can't accurately represent that here.
Hum, okay, makes sense. Daniel -- Daniel Veillard | libxml Gnome XML XSLT toolkit http://xmlsoft.org/ daniel@veillard.com | Rpmfind RPM search engine http://rpmfind.net/ http://veillard.com/ | virtualization library http://libvirt.org/
participants (3)
-
Daniel P. Berrange
-
Daniel Veillard
-
Gerrit Slomma