Bug 1017694 - virsh domjobinfo doesn't display the job information of VM
virsh domjobinfo doesn't display the job information of VM
Status: CLOSED NOTABUG
Product: Virtualization Tools
Classification: Community
Component: libvirt (Show other bugs)
unspecified
x86_64 Linux
unspecified Severity medium
: ---
: ---
Assigned To: Libvirt Maintainers
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-10-10 06:49 EDT by santwana
Modified: 2013-10-11 03:16 EDT (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-10-11 03:16:46 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description santwana 2013-10-10 06:49:23 EDT
Description of problem:

virsh domjobinfo doesn't display the o/p, even if job execution would be in progress within the guest.

virsh domjobinfo test
Job type:         None

echo $?
0

And evenif there is job running in the VM, the command is returning 0.

Version-Release number of selected component (if applicable):
libvirtd --version
libvirt 1.1.3

How reproducible:
Always

Steps to Reproduce:
1. When the VM is in a running state, execute some job in the guest.
2. Issue "virsh domjobinfo <guest>".
3. The command doesn't display any result:
virsh domjobinfo test
Job type:         None

Actual results:
virsh domjobinfo test
Job type:         None

Expected results:
virsh domjobinfo test
Job type:         None
It should display the job information in the VM.
Comment 1 Martin Kletzander 2013-10-10 08:26:53 EDT
What job are you running with the VM?  I cannot reproduce this with following steps (using dump):

Terminal 1:
 mkfifo asdf
 pv -B 1m -L 1m asdf >/dev/null # or anyhow read something/slowly from the file without closing it

Terminal 2:
 virsh dump 3 asdf

Terminal 3:
 virsh domjobinfo 3
 virsh domjobabort 3

My results:
 Terminal 2:
   virsh dump 3 asdf
  error: Failed to core dump domain 3 to asdf
  error: operation aborted: domain core dump job: canceled by client

 Terminal 3:
   virsh domjobinfo 3 
  Job type:         Unbounded   
  Time elapsed:     4000         ms
  Data processed:   5.093 MiB
  Data remaining:   1015.707 MiB
  Data total:       1.008 GiB
  Memory processed: 5.093 MiB
  Memory remaining: 1015.707 MiB
  Memory total:     1.008 GiB
  Constant pages:   460504      
  Normal pages:     78809       
  Normal data:      307.848 MiB
  Expected downtime: 30           ms
           ms

   virsh domjobabort 3

   echo $?
  0
Comment 2 santwana 2013-10-11 02:59:42 EDT
(In reply to Martin Kletzander from comment #1)
> What job are you running with the VM?  I cannot reproduce this with
> following steps (using dump):
> 
> Terminal 1:
>  mkfifo asdf
>  pv -B 1m -L 1m asdf >/dev/null # or anyhow read something/slowly from the
> file without closing it
> 
> Terminal 2:
>  virsh dump 3 asdf
> 
> Terminal 3:
>  virsh domjobinfo 3
>  virsh domjobabort 3
> 
> My results:
>  Terminal 2:
>    virsh dump 3 asdf
>   error: Failed to core dump domain 3 to asdf
>   error: operation aborted: domain core dump job: canceled by client
> 
>  Terminal 3:
>    virsh domjobinfo 3 
>   Job type:         Unbounded   
>   Time elapsed:     4000         ms
>   Data processed:   5.093 MiB
>   Data remaining:   1015.707 MiB
>   Data total:       1.008 GiB
>   Memory processed: 5.093 MiB
>   Memory remaining: 1015.707 MiB
>   Memory total:     1.008 GiB
>   Constant pages:   460504      
>   Normal pages:     78809       
>   Normal data:      307.848 MiB
>   Expected downtime: 30           ms
>            ms
> 
>    virsh domjobabort 3
> 
>    echo $?
>   0

Hello Martin,

Thanks so much for the steps provided. Earlier, I was also running "virsh dump" on the guest, but it was executed over very soon and "virsh domjobinfo" wasn't displaying any information simultaneously. 

After following the steps, the "virsh domjobinfo test" is displaying the desired o/p as expected:

virsh domjobinfo test
Job type:         Unbounded   
Time elapsed:     6489         ms
Data processed:   45.105 MiB
Data remaining:   1.030 GiB
Data total:       1.188 GiB
Memory processed: 45.105 MiB
Memory remaining: 1.030 GiB
Memory total:     1.188 GiB
Constant pages:   667476      
Normal pages:     1469035     
Normal data:      5.604 GiB
Expected downtime: 30           ms

However, the command is returning 0 on success , even if the command is successfully executed.
virsh domjobinfo test
Job type:         Unbounded   
Time elapsed:     6489         ms
Data processed:   45.105 MiB
Data remaining:   1.030 GiB
Data total:       1.188 GiB
Memory processed: 45.105 MiB
Memory remaining: 1.030 GiB
Memory total:     1.188 GiB
Constant pages:   667476      
Normal pages:     1469035     
Normal data:      5.604 GiB
Expected downtime: 30           ms

echo $?
0

Whereas, it should be returning 1 as the value.
The command is always returning 0 as the value, irrespective of any job being executed or not on the VM.

Please share your thoughts.

Thanks,
Santwana
Comment 3 Jiri Denemark 2013-10-11 03:16:46 EDT
All processes are expected to return 0 when they exit normally without an error. And virsh is no different in this. And even no running job is a normal situation and not an error.

Note You need to log in before you can comment on or make changes to this bug.