Re: [libvirt] [PATCH 3/6] fix migration of paused vms upon failure

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Paolo Bonzini wrote:
> This makes a small change on the failed-migration path.  Up to now,
> all VMs that failed non-live migration after the "stop" command
> were restarted.  This must not be done when the VM was paused in
> the first place.

OK, yes, after thinking about this, I agree with this semantic.  However, I
don't really agree with the implementation below.  Here's why:

If your domain is already paused, then you'll be issuing a "qemuMonitorStopCPUs"
command unnecessarily.  That by itself isn't a huge deal; it will essentially be
a no-op.  But you will also generate an event of "VIR_DOMAIN_EVENT_SUSPENDED",
which is wrong; you didn't really suspend the domain, an earlier command did.  I
think the implementation should be something more along the lines of:

paused = 0;
if (!(flags & VIR_MIGRATE_LIVE) && vm->state == VIR_DOMAIN_RUNNING) {
     stop_cpus();
     generate_event();
     paused = 1;
     vm->state = PAUSED;
}

Make sense?

One other thing to possibly investigate is whether the "vm->state ==
VIR_DOMAIN_RUNNING" is sufficient.  Can we (legitimately) be in state
VIR_DOMAIN_NOSTATE or VIR_DOMAIN_BLOCKED, yet still be "running"?  I'm not sure,
but I'd want to make sure before using that as a condition.

-- 
Chris Lalancette

--
Libvir-list mailing list
Libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]