[libvirt] [PATCH] qemu: Make migration fail when port profile association fails on the dst host

Eric Blake eblake at redhat.com
Wed Mar 28 16:46:31 UTC 2012


On 03/27/2012 02:27 PM, Christian Benvenuti (benve) wrote:
> In the current V3 migration protocol, Libvirt does not
> check the result of the function
> 
>   qemuMigrationVPAssociatePortProfiles
> 
> This means that it is possible for a migration to complete
> successfully even when the VM loses network connectivity on
> the destination host.
> 
> With this change libvirt aborts the migration
> (during the "finish" step) when the above function fails, that
> is to say when at least one of the port profile associations fails.
> 
> Signed-off by: Christian Benvenuti <benve at cisco.com>
> 
> ---
>  src/qemu/qemu_migration.c |   20 ++++++++++++++++----
>  1 files changed, 16 insertions(+), 4 deletions(-)


> @@ -2731,13 +2731,17 @@ qemuMigrationVPAssociatePortProfiles(virDomainDefPtr def) {
>                                                 virDomainNetGetActualDirectDev(net),
>                                                 -1,
>                                                 def->uuid,
> -                                               VIR_NETDEV_VPORT_PROFILE_OP_MIGRATE_IN_FINISH, false) < 0)
> +                                               VIR_NETDEV_VPORT_PROFILE_OP_MIGRATE_IN_FINISH,
> +                                               false) < 0) {
> +                VIR_ERROR("Port profile Associate failed for %s", net->ifname);
>                  goto err_exit;

VIR_ERROR is logged, but not propagated back to the caller; besides,
'make syntax-check' warned that it was not a translated error message.
I'm applying this to convert to our preferred error reporting:

diff --git i/src/qemu/qemu_migration.c w/src/qemu/qemu_migration.c
index c30c40b..49a260d 100644
--- i/src/qemu/qemu_migration.c
+++ w/src/qemu/qemu_migration.c
@@ -2733,7 +2733,9 @@
qemuMigrationVPAssociatePortProfiles(virDomainDefPtr def) {
                                                def->uuid,

VIR_NETDEV_VPORT_PROFILE_OP_MIGRATE_IN_FINISH,
                                                false) < 0) {
-                VIR_ERROR("Port profile Associate failed for %s",
net->ifname);
+                qemuReportError(VIR_ERR_OPERATION_FAILED,
+                                _("Port profile Associate failed for %s"),
+                                net->ifname);
                 goto err_exit;
             }
             VIR_DEBUG("Port profile Associate succeeded for %s",
net->ifname);



ACK with that fixed, so I added you to AUTHORS (let me know if you
prefer an alternate spelling), and pushed.

-- 
Eric Blake   eblake at redhat.com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 620 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20120328/8d2493a1/attachment-0001.sig>


More information about the libvir-list mailing list