Re: [PATCH for-6.0? 1/3] job: Add job_wait_unpaused() for block-job-complete

2021-04-09 Thread John Snow
On 4/9/21 5:57 AM, Max Reitz wrote: Just as a PS, in a reply to one of Vladimir’s mails (da048f58-43a6-6811-6ad2-0d7899737...@redhat.com) I was wondering whether it even makes sense for mirror to do all the stuff it does in mirror_complete() to do it there.  Aren’t all of those things that

Re: [PATCH for-6.0? 1/3] job: Add job_wait_unpaused() for block-job-complete

2021-04-09 Thread Max Reitz
On 09.04.21 12:07, Vladimir Sementsov-Ogievskiy wrote: 09.04.2021 12:51, Max Reitz wrote: On 08.04.21 19:26, Vladimir Sementsov-Ogievskiy wrote: 08.04.2021 20:04, John Snow wrote: On 4/8/21 12:58 PM, Vladimir Sementsov-Ogievskiy wrote: job-complete command is async. Can we instead just add a

Re: [PATCH for-6.0? 1/3] job: Add job_wait_unpaused() for block-job-complete

2021-04-09 Thread Kevin Wolf
Am 09.04.2021 um 11:31 hat Max Reitz geschrieben: > On 08.04.21 18:55, John Snow wrote: > > On 4/8/21 12:20 PM, Max Reitz wrote: > > > +    /* Similarly, if the job is still drained, waiting will not > > > help either */ > > > +    if (job->pause_count > 0) { > > > +    error_setg(errp, "Job

Re: [PATCH for-6.0? 1/3] job: Add job_wait_unpaused() for block-job-complete

2021-04-09 Thread Vladimir Sementsov-Ogievskiy
09.04.2021 12:51, Max Reitz wrote: On 08.04.21 19:26, Vladimir Sementsov-Ogievskiy wrote: 08.04.2021 20:04, John Snow wrote: On 4/8/21 12:58 PM, Vladimir Sementsov-Ogievskiy wrote: job-complete command is async. Can we instead just add a boolean like job->completion_requested, and set it if

Re: [PATCH for-6.0? 1/3] job: Add job_wait_unpaused() for block-job-complete

2021-04-09 Thread Max Reitz
On 09.04.21 11:44, Kevin Wolf wrote: Am 08.04.2021 um 18:55 hat John Snow geschrieben: On 4/8/21 12:20 PM, Max Reitz wrote: block-job-complete can only be applied when the job is READY, not when it is on STANDBY (ready, but paused). Draining a job technically pauses it (which makes a READY

Re: [PATCH for-6.0? 1/3] job: Add job_wait_unpaused() for block-job-complete

2021-04-09 Thread Max Reitz
On 08.04.21 19:26, Vladimir Sementsov-Ogievskiy wrote: 08.04.2021 20:04, John Snow wrote: On 4/8/21 12:58 PM, Vladimir Sementsov-Ogievskiy wrote: job-complete command is async. Can we instead just add a boolean like job->completion_requested, and set it if job-complete called in STANDBY

Re: [PATCH for-6.0? 1/3] job: Add job_wait_unpaused() for block-job-complete

2021-04-09 Thread Kevin Wolf
Am 08.04.2021 um 18:55 hat John Snow geschrieben: > On 4/8/21 12:20 PM, Max Reitz wrote: > > block-job-complete can only be applied when the job is READY, not when > > it is on STANDBY (ready, but paused). Draining a job technically pauses > > it (which makes a READY job enter STANDBY), and

Re: [PATCH for-6.0? 1/3] job: Add job_wait_unpaused() for block-job-complete

2021-04-09 Thread Max Reitz
On 08.04.21 18:58, Vladimir Sementsov-Ogievskiy wrote: 08.04.2021 19:20, Max Reitz wrote: block-job-complete can only be applied when the job is READY, not when it is on STANDBY (ready, but paused).  Draining a job technically pauses it (which makes a READY job enter STANDBY), and ending the

Re: [PATCH for-6.0? 1/3] job: Add job_wait_unpaused() for block-job-complete

2021-04-09 Thread Max Reitz
On 08.04.21 18:55, John Snow wrote: On 4/8/21 12:20 PM, Max Reitz wrote: block-job-complete can only be applied when the job is READY, not when it is on STANDBY (ready, but paused).  Draining a job technically pauses it (which makes a READY job enter STANDBY), and ending the drained section

Re: [PATCH for-6.0? 1/3] job: Add job_wait_unpaused() for block-job-complete

2021-04-08 Thread Vladimir Sementsov-Ogievskiy
08.04.2021 20:04, John Snow wrote: On 4/8/21 12:58 PM, Vladimir Sementsov-Ogievskiy wrote: job-complete command is async. Can we instead just add a boolean like job->completion_requested, and set it if job-complete called in STANDBY state, and on job_resume job_complete will be called

Re: [PATCH for-6.0? 1/3] job: Add job_wait_unpaused() for block-job-complete

2021-04-08 Thread John Snow
On 4/8/21 12:58 PM, Vladimir Sementsov-Ogievskiy wrote: job-complete command is async. Can we instead just add a boolean like job->completion_requested, and set it if job-complete called in STANDBY state, and on job_resume job_complete will be called automatically if this boolean is true?

Re: [PATCH for-6.0? 1/3] job: Add job_wait_unpaused() for block-job-complete

2021-04-08 Thread Vladimir Sementsov-Ogievskiy
08.04.2021 19:20, Max Reitz wrote: block-job-complete can only be applied when the job is READY, not when it is on STANDBY (ready, but paused). Draining a job technically pauses it (which makes a READY job enter STANDBY), and ending the drained section does not synchronously resume it, but only

Re: [PATCH for-6.0? 1/3] job: Add job_wait_unpaused() for block-job-complete

2021-04-08 Thread John Snow
On 4/8/21 12:20 PM, Max Reitz wrote: block-job-complete can only be applied when the job is READY, not when it is on STANDBY (ready, but paused). Draining a job technically pauses it (which makes a READY job enter STANDBY), and ending the drained section does not synchronously resume it, but