Re: [PATCH] qemu: Fix a regression of domjobabort

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

 



2011/8/1 Osier Yang <jyang@xxxxxxxxxx>:
> Introduced by f9a837da73a11ef, the condition is not changed after
> the else clause is removed. So now it quit with "domain is not
> running" when the domain is running. However, when the domain is
> not running, it reports "no job is active".
>
> How to reproduce:
>
> 1)
> % virsh start $domain
> % virsh domjobabort $domain
> error: Requested operation is not valid: domain is not running
>
> 2)
> % virsh destroy $domain
> % virsh domjobabort $domain
> error: Requested operation is not valid: no job is active on the domain
>
> 3)
> % virsh save $domain /tmp/$domain.save
>
> Before above commands finished, try to abort job in another terminal
>
> % virsh domabortjob $domain
> error: Requested operation is not valid: domain is not running
>
> ---
>  src/qemu/qemu_driver.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
> index b673fd5..cce1c68 100644
> --- a/src/qemu/qemu_driver.c
> +++ b/src/qemu/qemu_driver.c
> @@ -8065,7 +8065,7 @@ static int qemuDomainAbortJob(virDomainPtr dom) {
>     if (qemuDomainObjBeginJob(driver, vm, QEMU_JOB_ABORT) < 0)
>         goto cleanup;
>
> -    if (virDomainObjIsActive(vm)) {
> +    if (!virDomainObjIsActive(vm)) {
>         qemuReportError(VIR_ERR_OPERATION_INVALID,
>                         "%s", _("domain is not running"));
>         goto endjob;

ACK, makes condition and error message match again.

-- 
Matthias Bolte
http://photron.blogspot.com

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