Re: [PATCH] qemuMigrationIsAllowed: Forbid migration of rebooting domain

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

 



On Thu, Nov 21, 2013 at 03:26:33PM +0100, Michal Privoznik wrote:
> https://bugzilla.redhat.com/show_bug.cgi?id=744967
> 
> If a domain is rebooting and a migrate API is called meanwhile we would
> have to transfer the fakeReboot attribute to the destination in order to
> prevent domain doing plain shutdown over there. What about forbidding
> this silly corner case instead? Same goes for saving a domain to a file.
> 
> Signed-off-by: Michal Privoznik <mprivozn@xxxxxxxxxx>
> ---
>  src/qemu/qemu_migration.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
> index e87ea85..6dffbb1 100644
> --- a/src/qemu/qemu_migration.c
> +++ b/src/qemu/qemu_migration.c
> @@ -1399,6 +1399,14 @@ qemuMigrationIsAllowed(virQEMUDriverPtr driver, virDomainObjPtr vm,
>      size_t i;
>  
>      if (vm) {
> +        qemuDomainObjPrivatePtr priv = vm->privateData;
> +
> +        if (priv->fakeReboot) {
> +            virReportError(VIR_ERR_OPERATION_INVALID, "%s",
> +                           _("domain is rebooting"));
> +            return false;
> +        }
> +
>          if (qemuProcessAutoDestroyActive(driver, vm)) {
>              virReportError(VIR_ERR_OPERATION_INVALID,
>                             "%s", _("domain is marked for auto destroy"));

If the guest never responds to the 'shutdown' request, then we'll never
do the reboot and so the 'fakeReboot' flag won't get cleared. In such a
case it would be valid, and even desirable, to be able to migrate or
save to a file.

At the end of the day fake-reboot is a crappy solution with a number of
unfixable edge cases. IMHO this is at most a documentation issue and we
shouldn't try to do anything more clever.

Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|

--
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]