[pve-devel] update disk config, always rescan all the storage, can we avoid that ?
Dietmar Maurer
dietmar at proxmox.com
Fri Jun 7 13:25:00 CEST 2013
Hi Alexandre,
I just committed a first version:
https://git.proxmox.com/?p=qemu-server.git;a=commitdiff;h=5555edea95d07f78b7281703270f185f5b9f105a
We now have two different API entry points:
POST {vmid}/config
PUT {vmid}/config
So we can still use the old API call.
Further comments are inside the code.
I also added some code to pve-manager:
https://git.proxmox.com/?p=pve-manager.git;a=commitdiff;h=b2c71ac94c74ac067172e0970deef9569fbf1bbb
but that is currently not used.
Where do you think should we use the new API?
> 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 -----
> > >>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