[libvirt] [PATCH] qemu: snapshot: Report better error when create internal snapshot with passthrough devices

Peter Krempa pkrempa at redhat.com
Fri Dec 5 10:03:04 UTC 2014


On 12/03/14 12:12, Shanzhi Yu wrote:
> When create internal system checkpoint snapshot, it will not works if
> guest has passthrough devices attached. It will report error:
> 
> error: operation failed: Error -22 while writing VM
> With this patch, it will report erro:
> 
> error: Requested operation is not valid: domain has assigned non-USB host devices
> 
> Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=874418#c19
> ---
>  src/qemu/qemu_driver.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
> index 5dc62b0..0fdee26 100644
> --- a/src/qemu/qemu_driver.c
> +++ b/src/qemu/qemu_driver.c
> @@ -12902,6 +12902,9 @@ qemuDomainSnapshotCreateActiveInternal(virConnectPtr conn,
>          }
>      }
>  
> +    if (!qemuMigrationIsAllowed(driver, vm, vm->def, false, false))
> +        goto cleanup;
> +

This check can be moved to the top of the function. The check will be
executed without any change to the guest at that point. (the CPUs won't
be stopped briefly in case the VM cannot be snapshotted)

>      if (qemuDomainObjEnterMonitorAsync(driver, vm,
>                                         QEMU_ASYNC_JOB_SNAPSHOT) < 0) {
>          resume = false;
> 

I'm going to push this patch in a while with the check moved upwards and
the commit message touched up.

Peter


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


More information about the libvir-list mailing list