[libvirt] [PATCH v2] storage: Refresh storage pool after upload
Daniel P. Berrange
berrange at redhat.com
Wed Jul 30 09:17:21 UTC 2014
On Tue, Jul 29, 2014 at 04:41:55PM -0400, John Ferlan wrote:
> https://bugzilla.redhat.com/show_bug.cgi?id=1072653
>
> Upon successful upload of a volume, the target volume and storage pool
> were not updated to reflect any changes as a result of the upload. Make
> use of the existing stream close callback mechanism to force a backend
> pool refresh to occur in a separate thread once the stream closes. The
> separate thread should avoid potential deadlocks if the refresh needed
> to wait on some event from the event loop which is used to perform
> the stream callback.
>
> Signed-off-by: John Ferlan <jferlan at redhat.com>
> ---
>
> Update since v1 - as discussed in original posting, use virThreadCreate to
> generate a thread to handle the refresh callback:
>
> http://www.redhat.com/archives/libvir-list/2014-July/msg01395.html
>
> Avoid the Free callback function and have the thread do the memory free
> as long as thread creation was successful. Thus a couple of changes to
> function names were appropriate.
>
> Understood that this can wait for 1.2.8 - figured to get it ready to go
>
> NOTE: Still used pool refresh, since I found that without this patch
> applied a pool-dumpxml displayed the same allocation/available before
> and after the upload, so that data is not refreshed for each call as
> was my concern over using refreshVol vs. refreshPool
>
> # virsh pool-dumpxml default
> ...
> <allocation unit='bytes'>33852141568</allocation>
> <available unit='bytes'>110510419968</available>
> ...
> # virsh vol-upload test-qcow2-4g.img test.img default
> # virsh pool-dumpxml default
> ...
> <allocation unit='bytes'>33852141568</allocation>
> <available unit='bytes'>110510419968</available>
> ...
> #
>
> src/libvirt.c | 8 ++++
> src/libvirt_private.syms | 1 +
> src/storage/storage_driver.c | 103 +++++++++++++++++++++++++++++++++++++++++++
> tools/virsh.pod | 3 ++
> 4 files changed, 115 insertions(+)
ACK
Regards,
Daniel
--
|: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org -o- http://virt-manager.org :|
|: http://autobuild.org -o- http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|
More information about the libvir-list
mailing list