qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* Using loadvm with snapshot
@ 2021-08-12  0:09 Gabriel Southern
  2021-08-17 16:26 ` Dr. David Alan Gilbert
  0 siblings, 1 reply; 7+ messages in thread
From: Gabriel Southern @ 2021-08-12  0:09 UTC (permalink / raw)
  To: qemu-devel

Hi,

Are there plans to support using -loadvm with -snapshot?

I saw some past discussion on mailing list including bug that was closed earlier this year but no recent activity:

https://lore.kernel.org/qemu-devel/162424905685.11837.7303570061857383641.malone@loganberry.canonical.com/

Testing with latest qemu it looks like -loadvm still does not work when combined with -snapshot.

I'm curious how complex it would be to implement this feature and if it may show up on QEMU roadmap in the future. Or if there is alterative command that can be used to save the state of a running VM and then use the same qcow to run multiple QEMU instances loading this VM state running in snapshot mode.

Thanks,

-Gabriel


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

* Re: Using loadvm with snapshot
  2021-08-12  0:09 Using loadvm with snapshot Gabriel Southern
@ 2021-08-17 16:26 ` Dr. David Alan Gilbert
  2021-08-17 18:48   ` Peter Maydell
  0 siblings, 1 reply; 7+ messages in thread
From: Dr. David Alan Gilbert @ 2021-08-17 16:26 UTC (permalink / raw)
  To: Gabriel Southern; +Cc: qemu-devel

* Gabriel Southern (gsouther@qti.qualcomm.com) wrote:
> Hi,
> 
> Are there plans to support using -loadvm with -snapshot?
> 
> I saw some past discussion on mailing list including bug that was closed earlier this year but no recent activity:
> 
> https://lore.kernel.org/qemu-devel/162424905685.11837.7303570061857383641.malone@loganberry.canonical.com/
> 
> Testing with latest qemu it looks like -loadvm still does not work when combined with -snapshot.
> 
> I'm curious how complex it would be to implement this feature and if it may show up on QEMU roadmap in the future. Or if there is alterative command that can be used to save the state of a running VM and then use the same qcow to run multiple QEMU instances loading this VM state running in snapshot mode.

One thing that might work for you is migrate to a file;

 (qemu)  migrate_set_parameter max-bandwidth 100G
 (qemu) migrate "exec:cat > myfile.mig"
 (qemu) q


qemu -incoming "exec:cat myfile.mig"

Dave
> 
> Thanks,
> 
> -Gabriel
> 
-- 
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK



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

* Re: Using loadvm with snapshot
  2021-08-17 16:26 ` Dr. David Alan Gilbert
@ 2021-08-17 18:48   ` Peter Maydell
  2021-08-17 18:53     ` Dr. David Alan Gilbert
  2021-08-24 15:20     ` Kevin Wolf
  0 siblings, 2 replies; 7+ messages in thread
From: Peter Maydell @ 2021-08-17 18:48 UTC (permalink / raw)
  To: Dr. David Alan Gilbert; +Cc: qemu-devel, Gabriel Southern

On Tue, 17 Aug 2021 at 17:27, Dr. David Alan Gilbert
<dgilbert@redhat.com> wrote:
>
> * Gabriel Southern (gsouther@qti.qualcomm.com) wrote:
> > Hi,
> >
> > Are there plans to support using -loadvm with -snapshot?
> >
> > I saw some past discussion on mailing list including bug that was closed earlier this year but no recent activity:
> >
> > https://lore.kernel.org/qemu-devel/162424905685.11837.7303570061857383641.malone@loganberry.canonical.com/
> >
> > Testing with latest qemu it looks like -loadvm still does not work when combined with -snapshot.
> >
> > I'm curious how complex it would be to implement this feature and if it may show up on QEMU roadmap in the future. Or if there is alterative command that can be used to save the state of a running VM and then use the same qcow to run multiple QEMU instances loading this VM state running in snapshot mode.

Do you know why -loadvm and -snapshot don't work together?
It doesn't on the face of it seem like they would be incompatible...

-- PMM


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

* Re: Using loadvm with snapshot
  2021-08-17 18:48   ` Peter Maydell
@ 2021-08-17 18:53     ` Dr. David Alan Gilbert
  2021-08-24 15:20     ` Kevin Wolf
  1 sibling, 0 replies; 7+ messages in thread
From: Dr. David Alan Gilbert @ 2021-08-17 18:53 UTC (permalink / raw)
  To: Peter Maydell; +Cc: qemu-devel, Gabriel Southern

* Peter Maydell (peter.maydell@linaro.org) wrote:
> On Tue, 17 Aug 2021 at 17:27, Dr. David Alan Gilbert
> <dgilbert@redhat.com> wrote:
> >
> > * Gabriel Southern (gsouther@qti.qualcomm.com) wrote:
> > > Hi,
> > >
> > > Are there plans to support using -loadvm with -snapshot?
> > >
> > > I saw some past discussion on mailing list including bug that was closed earlier this year but no recent activity:
> > >
> > > https://lore.kernel.org/qemu-devel/162424905685.11837.7303570061857383641.malone@loganberry.canonical.com/
> > >
> > > Testing with latest qemu it looks like -loadvm still does not work when combined with -snapshot.
> > >
> > > I'm curious how complex it would be to implement this feature and if it may show up on QEMU roadmap in the future. Or if there is alterative command that can be used to save the state of a running VM and then use the same qcow to run multiple QEMU instances loading this VM state running in snapshot mode.
> 
> Do you know why -loadvm and -snapshot don't work together?
> It doesn't on the face of it seem like they would be incompatible...

No I don't; I've never actually used -loadvm - given that both the
snapshot mechanism and the load/savevm mechanism are fairly special
qcow2 hacks, it'll be a qcow2 level thing.

Dave

> -- PMM
> 
-- 
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK



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

* Re: Using loadvm with snapshot
  2021-08-17 18:48   ` Peter Maydell
  2021-08-17 18:53     ` Dr. David Alan Gilbert
@ 2021-08-24 15:20     ` Kevin Wolf
  2021-08-24 15:25       ` Peter Maydell
  1 sibling, 1 reply; 7+ messages in thread
From: Kevin Wolf @ 2021-08-24 15:20 UTC (permalink / raw)
  To: Peter Maydell; +Cc: Dr. David Alan Gilbert, Gabriel Southern, qemu-devel

Am 17.08.2021 um 20:48 hat Peter Maydell geschrieben:
> On Tue, 17 Aug 2021 at 17:27, Dr. David Alan Gilbert
> <dgilbert@redhat.com> wrote:
> >
> > * Gabriel Southern (gsouther@qti.qualcomm.com) wrote:
> > > Hi,
> > >
> > > Are there plans to support using -loadvm with -snapshot?
> > >
> > > I saw some past discussion on mailing list including bug that was closed earlier this year but no recent activity:
> > >
> > > https://lore.kernel.org/qemu-devel/162424905685.11837.7303570061857383641.malone@loganberry.canonical.com/
> > >
> > > Testing with latest qemu it looks like -loadvm still does not work when combined with -snapshot.
> > >
> > > I'm curious how complex it would be to implement this feature and if it may show up on QEMU roadmap in the future. Or if there is alterative command that can be used to save the state of a running VM and then use the same qcow to run multiple QEMU instances loading this VM state running in snapshot mode.
> 
> Do you know why -loadvm and -snapshot don't work together?
> It doesn't on the face of it seem like they would be incompatible...

Probably because -snapshot first adds a temporary qcow2 overlay to the
image, and then -loadvm fails because the newly created temporary
overlay doesn't contain the requested snapshot.

Internal and external snapshots don't really mix well.

Kevin



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

* Re: Using loadvm with snapshot
  2021-08-24 15:20     ` Kevin Wolf
@ 2021-08-24 15:25       ` Peter Maydell
  2021-08-24 16:20         ` Kevin Wolf
  0 siblings, 1 reply; 7+ messages in thread
From: Peter Maydell @ 2021-08-24 15:25 UTC (permalink / raw)
  To: Kevin Wolf; +Cc: Dr. David Alan Gilbert, Gabriel Southern, qemu-devel

On Tue, 24 Aug 2021 at 16:21, Kevin Wolf <kwolf@redhat.com> wrote:
>
> Am 17.08.2021 um 20:48 hat Peter Maydell geschrieben:
> > On Tue, 17 Aug 2021 at 17:27, Dr. David Alan Gilbert
> > <dgilbert@redhat.com> wrote:
> > >
> > > * Gabriel Southern (gsouther@qti.qualcomm.com) wrote:
> > > > Hi,
> > > >
> > > > Are there plans to support using -loadvm with -snapshot?
> > > >
> > > > I saw some past discussion on mailing list including bug that was closed earlier this year but no recent activity:
> > > >
> > > > https://lore.kernel.org/qemu-devel/162424905685.11837.7303570061857383641.malone@loganberry.canonical.com/
> > > >
> > > > Testing with latest qemu it looks like -loadvm still does not work when combined with -snapshot.
> > > >
> > > > I'm curious how complex it would be to implement this feature and if it may show up on QEMU roadmap in the future. Or if there is alterative command that can be used to save the state of a running VM and then use the same qcow to run multiple QEMU instances loading this VM state running in snapshot mode.
> >
> > Do you know why -loadvm and -snapshot don't work together?
> > It doesn't on the face of it seem like they would be incompatible...
>
> Probably because -snapshot first adds a temporary qcow2 overlay to the
> image, and then -loadvm fails because the newly created temporary
> overlay doesn't contain the requested snapshot.

That sounds like the bug could be fixed by having "find the
snapshot" look not just in the overlay but also down into
the underlying image?

-- PMM


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

* Re: Using loadvm with snapshot
  2021-08-24 15:25       ` Peter Maydell
@ 2021-08-24 16:20         ` Kevin Wolf
  0 siblings, 0 replies; 7+ messages in thread
From: Kevin Wolf @ 2021-08-24 16:20 UTC (permalink / raw)
  To: Peter Maydell; +Cc: Dr. David Alan Gilbert, Gabriel Southern, qemu-devel

Am 24.08.2021 um 17:25 hat Peter Maydell geschrieben:
> On Tue, 24 Aug 2021 at 16:21, Kevin Wolf <kwolf@redhat.com> wrote:
> >
> > Am 17.08.2021 um 20:48 hat Peter Maydell geschrieben:
> > > On Tue, 17 Aug 2021 at 17:27, Dr. David Alan Gilbert
> > > <dgilbert@redhat.com> wrote:
> > > >
> > > > * Gabriel Southern (gsouther@qti.qualcomm.com) wrote:
> > > > > Hi,
> > > > >
> > > > > Are there plans to support using -loadvm with -snapshot?
> > > > >
> > > > > I saw some past discussion on mailing list including bug that was closed earlier this year but no recent activity:
> > > > >
> > > > > https://lore.kernel.org/qemu-devel/162424905685.11837.7303570061857383641.malone@loganberry.canonical.com/
> > > > >
> > > > > Testing with latest qemu it looks like -loadvm still does not work when combined with -snapshot.
> > > > >
> > > > > I'm curious how complex it would be to implement this feature and if it may show up on QEMU roadmap in the future. Or if there is alterative command that can be used to save the state of a running VM and then use the same qcow to run multiple QEMU instances loading this VM state running in snapshot mode.
> > >
> > > Do you know why -loadvm and -snapshot don't work together?
> > > It doesn't on the face of it seem like they would be incompatible...
> >
> > Probably because -snapshot first adds a temporary qcow2 overlay to the
> > image, and then -loadvm fails because the newly created temporary
> > overlay doesn't contain the requested snapshot.
> 
> That sounds like the bug could be fixed by having "find the
> snapshot" look not just in the overlay but also down into
> the underlying image?

In this specific case yes, because we know that the overlay was just
created and is still empty.

In the general case, loading internal snapshots on a backing file would
be wrong because the data in the overlay would be from a different time
than the data in the backing file, probably causing data corruption.

Kevin



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

end of thread, other threads:[~2021-08-24 16:22 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-12  0:09 Using loadvm with snapshot Gabriel Southern
2021-08-17 16:26 ` Dr. David Alan Gilbert
2021-08-17 18:48   ` Peter Maydell
2021-08-17 18:53     ` Dr. David Alan Gilbert
2021-08-24 15:20     ` Kevin Wolf
2021-08-24 15:25       ` Peter Maydell
2021-08-24 16:20         ` 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).