mmm ok, I understand now.

(I don't known to much how exactly to implemented this, if you can do it, it 
could be fine :)


----- Mail original ----- 

De: "Dietmar Maurer" <[email protected]> 
À: "Alexandre DERUMIER" <[email protected]> 
Cc: [email protected] 
Envoyé: Mercredi 5 Juin 2013 10:53:15 
Objet: RE: [pve-devel] update disk config, always rescan all the storage, can 
we avoid that ? 

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