[pve-devel] update disk config, always rescan all the storage, can we avoid that ?

Dietmar Maurer dietmar at proxmox.com
Wed Jun 5 10:53:15 CEST 2013


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


More information about the pve-devel mailing list