Re: [Libguestfs] [PATCH] -o rhv-upload: wait for VM creation task

2022-04-14 Thread Nir Soffer
On Thu, Apr 14, 2022 at 11:11 AM Richard W.M. Jones wrote: > > > Sorry, that patch was incomplete. Here's a better patch. > > Rich. > > commit d2c018676111de0d5fb895301fb9035c8763f5bb (HEAD -> master) > Author: Richard W.M. Jones > Date: Thu Apr 14 09:09:15 2022 +0100 > > -o rhv-upload: Us

Re: [Libguestfs] [PATCH] -o rhv-upload: wait for VM creation task

2022-04-14 Thread Richard W.M. Jones
Sorry, that patch was incomplete. Here's a better patch. Rich. commit d2c018676111de0d5fb895301fb9035c8763f5bb (HEAD -> master) Author: Richard W.M. Jones Date: Thu Apr 14 09:09:15 2022 +0100 -o rhv-upload: Use time.monotonic In Python >= 3.3 we can use a monotonic instead of

Re: [Libguestfs] [PATCH] -o rhv-upload: wait for VM creation task

2022-04-14 Thread Richard W.M. Jones
On Wed, Apr 13, 2022 at 09:32:14PM +0300, Nir Soffer wrote: > > +# Wait for the import job to finish > > +endt = time.time() + timeout > > Since we use python 3, it is better to use time.monotonic() > which is affected by system time changes. Interesting - we use time.time() quite a lot at the mo

Re: [Libguestfs] [PATCH] -o rhv-upload: wait for VM creation task

2022-04-13 Thread Nir Soffer
On Tue, Apr 12, 2022 at 9:35 PM Tomáš Golembiovský wrote: > > oVirt API call for VM creation finishes before the VM is actually > created. Entities may be still locked after virt-v2v terminates and if > user tries to perform (scripted) actions after virt-v2v those operations > may fail. To prevent

Re: [Libguestfs] [PATCH] -o rhv-upload: wait for VM creation task

2022-04-13 Thread Richard W.M. Jones
On Tue, Apr 12, 2022 at 08:34:27PM +0200, Tomáš Golembiovský wrote: > oVirt API call for VM creation finishes before the VM is actually > created. Entities may be still locked after virt-v2v terminates and if > user tries to perform (scripted) actions after virt-v2v those operations > may fail. To

Re: [Libguestfs] [PATCH] -o rhv-upload: wait for VM creation task

2022-04-13 Thread Tomáš Golembiovský
On Tue, Apr 12, 2022 at 08:34:27PM +0200, Tomáš Golembiovský wrote: > oVirt API call for VM creation finishes before the VM is actually > created. Entities may be still locked after virt-v2v terminates and if > user tries to perform (scripted) actions after virt-v2v those operations > may fail. To

[Libguestfs] [PATCH] -o rhv-upload: wait for VM creation task

2022-04-12 Thread Tomáš Golembiovský
oVirt API call for VM creation finishes before the VM is actually created. Entities may be still locked after virt-v2v terminates and if user tries to perform (scripted) actions after virt-v2v those operations may fail. To prevent this it is useful to monitor the task and wait for the completion. T