[pve-devel] update disk config, always rescan all the storage, can we avoid that ?
Alexandre DERUMIER
aderumier at odiso.com
Wed Jun 5 11:48:12 CEST 2013
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" <dietmar at proxmox.com>
À: "Alexandre DERUMIER" <aderumier at odiso.com>
Cc: pve-devel at pve.proxmox.com
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;
More information about the pve-devel
mailing list