> >>If the update function return the special task ID mentioned we know
> >>everything went OK (synchronous case) .
> >>
> >>if we get a normal task ID, we can span TaskProgress (like we do in
> >>the snapshot GUI).
> Oh ok, got it! so no need to add new api :)
> 
> Do you want to return special taskid for all disk add/remove, or only for some
> "slow" storages.

Again, you do not know in advance what is slow.

So the idea is to use fork_worker() for everything, but wait up to 10 second to 
see
it the task finish within that time, something like:

my $upid = fork_worker()

my $task_finisched = 0;

for ($i = 0; $i < 10; $i++) {
        sleep(1);
        last if $task_finished = check_if_task_is_running($upid);
}

return $task_finished ? 'OK' : $upid;
_______________________________________________
pve-devel mailing list
[email protected]
http://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

Reply via email to