qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] Question about bdrv_co_invalidate_cache
@ 2019-07-01 16:42 Yury Kotov
  2019-07-02  8:07 ` Kevin Wolf
  0 siblings, 1 reply; 2+ messages in thread
From: Yury Kotov @ 2019-07-01 16:42 UTC (permalink / raw)
  To: Kevin Wolf, Max Reitz, Juan Quintela, Dr. David Alan Gilbert
  Cc: open list:All patches CC here

Hi,

I just want to clarify the purpose of bdrv_co_invalidate_cache callback.
IIUC on of the purposes of this callback is to "activate" BDRV (opposite of the
bdrv_inactivate callback) on migration end, right?

E.g, if we have a custom BDRV which is backed by some network block storage with
exclusive mount then on migration end bdrv_inactivate callback have to unmount
this storage and bdrv_co_invalidate_cache have to mount it.

I'm not sure because of the name of bdrv_co_invalidate_cache callback. It looks
like something that can be called in very different context, not only migration
(may be not now, but in the future).

If there is another approach for my example, tell me about it, please.
We have such custom BDRV with exclusive mount and want to realize migration
support correctly.

Thanks!

Regards,
Yury


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [Qemu-devel] Question about bdrv_co_invalidate_cache
  2019-07-01 16:42 [Qemu-devel] Question about bdrv_co_invalidate_cache Yury Kotov
@ 2019-07-02  8:07 ` Kevin Wolf
  0 siblings, 0 replies; 2+ messages in thread
From: Kevin Wolf @ 2019-07-02  8:07 UTC (permalink / raw)
  To: Yury Kotov
  Cc: open list:All patches CC here, Juan Quintela,
	Dr. David Alan Gilbert, Max Reitz

Am 01.07.2019 um 18:42 hat Yury Kotov geschrieben:
> Hi,
> 
> I just want to clarify the purpose of bdrv_co_invalidate_cache callback.
> IIUC on of the purposes of this callback is to "activate" BDRV (opposite of the
> bdrv_inactivate callback) on migration end, right?
> 
> E.g, if we have a custom BDRV which is backed by some network block storage with
> exclusive mount then on migration end bdrv_inactivate callback have to unmount
> this storage and bdrv_co_invalidate_cache have to mount it.
> 
> I'm not sure because of the name of bdrv_co_invalidate_cache callback. It looks
> like something that can be called in very different context, not only migration
> (may be not now, but in the future).
> 
> If there is another approach for my example, tell me about it, please.
> We have such custom BDRV with exclusive mount and want to realize migration
> support correctly.

Yes, you can consider bdrv_co_invalidate_cache/bdrv_co_inactivate a pair
of functions to activate/inactivate images. I think all of their callers
are related to migration currently, but it shouldn't make a difference
for you.

The name .bdrv_co_invalidate_cache hints at what usually needs to be
done on migration completion: Any previously read (meta)data must be
invalidated because the migration source (or more genereally: a second
process where the image was activated) may still have written to the
image.

Kevin


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-07-02  8:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-07-01 16:42 [Qemu-devel] Question about bdrv_co_invalidate_cache Yury Kotov
2019-07-02  8:07 ` Kevin Wolf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).