Received: from eggs.gnu.org ([2001:4830:134:3::10]:60300) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XFDn9-0004o4-1y for qemu-devel@nongnu.org; Wed, 06 Aug 2014 22:51:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XFDn1-0004A1-IH for qemu-devel@nongnu.org; Wed, 06 Aug 2014 22:50:59 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:57415) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XFDn1-00049x-9U for qemu-devel@nongnu.org; Wed, 06 Aug 2014 22:50:51 -0400 Date: Thu, 7 Aug 2014 02:50:46 +0000 From: Serge Hallyn Message-ID: <20140807025046.GB18303@ubuntumail> References: <1406920333-8297-1-git-send-email-alex@alex.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1406920333-8297-1-git-send-email-alex@alex.org.uk> Subject: Re: [Qemu-devel] [PATCH v2 0/2] Add machine type pc-1.0-qemu-kvm for live migrate compatibility with qemu-kvm List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alex Bligh Cc: Ryan Harper , Serge Hallyn , "Michael S. Tsirkin" , Libvirt , "quintela@redhat.com" , Alexander Graf , qemu-devel@nongnu.org, Cole Robinson , Amit Shah , Bruce Rogers , Andreas =?iso-8859-1?Q?F=E4rber?= , "Serge E. Hallyn" This worked for me when migrating by hand. I'm trying to make it work through libvirt, using the following patch. (So whether to have pc-1.0 be treated as qemu's or qemu-kvm's pc-1.0 is specifed using a boolean in /etc/libvirt/qemu.conf) Qemu starts with decent looking args, but for some reason the the migration is failing - still looking through the logfile to figure out why. Now sadly my tests are being further slowed down by qcow corruption on my host, but I don't think that was the cause of my failure. Index: libvirt-1.2.6/src/qemu/qemu_conf.c =================================================================== --- libvirt-1.2.6.orig/src/qemu/qemu_conf.c +++ libvirt-1.2.6/src/qemu/qemu_conf.c @@ -230,6 +230,8 @@ virQEMUDriverConfigPtr virQEMUDriverConf cfg->migrationPortMin = QEMU_MIGRATION_PORT_MIN; cfg->migrationPortMax = QEMU_MIGRATION_PORT_MAX; + cfg->incoming_assume_qemukvm = false; + #if defined HAVE_MNTENT_H && defined HAVE_GETMNTENT_R /* For privileged driver, try and find hugepage mount automatically. * Non-privileged driver requires admin to create a dir for the @@ -355,6 +357,7 @@ int virQEMUDriverConfigLoadFile(virQEMUD goto cleanup; \ } + GET_VALUE_BOOL("incoming_assume_qemukvm", cfg->incoming_assume_qemukvm); GET_VALUE_BOOL("vnc_auto_unix_socket", cfg->vncAutoUnixSocket); GET_VALUE_BOOL("vnc_tls", cfg->vncTLS); GET_VALUE_BOOL("vnc_tls_x509_verify", cfg->vncTLSx509verify); Index: libvirt-1.2.6/src/qemu/qemu_conf.h =================================================================== --- libvirt-1.2.6.orig/src/qemu/qemu_conf.h +++ libvirt-1.2.6/src/qemu/qemu_conf.h @@ -168,6 +168,8 @@ struct _virQEMUDriverConfig { char *migrationAddress; int migrationPortMin; int migrationPortMax; + /* Whether incoming pc-1.0 migration should come from qemu-kvm */ + bool incoming_assume_qemukvm; bool logTimestamp; }; Index: libvirt-1.2.6/src/qemu/qemu_migration.c =================================================================== --- libvirt-1.2.6.orig/src/qemu/qemu_migration.c +++ libvirt-1.2.6/src/qemu/qemu_migration.c @@ -2131,6 +2131,16 @@ static char if (!qemuDomainDefCheckABIStability(driver, vm->def, def)) goto cleanup; + if (driver->config->incoming_assume_qemukvm) { + if (STREQ_NULLABLE(vm->def->os.machine, "pc-1.0")) { + VIR_FREE(vm->def->os.machine); + VIR_FREE(def->os.machine); + if (VIR_STRDUP(vm->def->os.machine, "pc-1.0-qemu-kvm") < 0 || + VIR_STRDUP(def->os.machine, "pc-1.0-qemu-kvm") < 0) + goto cleanup; + } + } + rv = qemuDomainDefFormatLive(driver, def, false, true); } else { rv = qemuDomainDefFormatLive(driver, vm->def, false, true); @@ -2461,6 +2471,13 @@ qemuMigrationPrepareAny(virQEMUDriverPtr goto endjob; } + if (driver->config->incoming_assume_qemukvm) { + if (STREQ_NULLABLE(vm->def->os.machine, "pc-1.0")) { + VIR_FREE(vm->def->os.machine); + if (VIR_STRDUP(vm->def->os.machine, "pc-1.0-qemu-kvm") < 0) + goto endjob; + } + } /* Start the QEMU daemon, with the same command-line arguments plus * -incoming $migrateFrom */ Index: libvirt-1.2.6/src/qemu/qemu_command.c =================================================================== --- libvirt-1.2.6.orig/src/qemu/qemu_command.c +++ libvirt-1.2.6/src/qemu/qemu_command.c @@ -7093,6 +7093,7 @@ qemuBuildCommandLine(virConnectPtr conn, virArch hostarch = virArchFromHost(); virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver); + VIR_DEBUG("conn=%p driver=%p def=%p mon=%p json=%d " "qemuCaps=%p migrateFrom=%s migrateFD=%d " "snapshot=%p vmop=%d", @@ -7172,6 +7173,11 @@ qemuBuildCommandLine(virConnectPtr conn, if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_ENABLE_FIPS)) virCommandAddArg(cmd, "-enable-fips"); + VIR_DEBUG("qemu_command: os.machine is %s\n", def->os.machine); + if (STREQ_NULLABLE(def->os.machine, "pc-1.0-qemu-kvm")) { + virCommandAddArgList(cmd, "-global", + "virtio-net-pci.romfile=pxe-virtio.rom.12.04", NULL); + } if (qemuBuildMachineArgStr(cmd, def, qemuCaps) < 0) goto error;