From: Stefan Hajnoczi <stefanha@gmail.com>
To: Stefan Berger <stefanb@linux.ibm.com>
Cc: Stefan Hajnoczi <stefanha@redhat.com>,
qemu-devel@nongnu.org, pkrempa@redhat.com
Subject: Re: swtpm persistent state snapshots by copying .permall file
Date: Thu, 11 Sep 2025 06:23:26 -0400 [thread overview]
Message-ID: <CAJSP0QVfaFjtuDqSiEozOmPVUMYzXWaSO21qUp1pHAgo1-Uvqg@mail.gmail.com> (raw)
In-Reply-To: <8623c898-a0e1-42d2-8afa-35b64e41cc50@linux.ibm.com>
On Wed, Sep 10, 2025 at 7:14 PM Stefan Berger <stefanb@linux.ibm.com> wrote:
> On 9/10/25 5:08 PM, Stefan Hajnoczi wrote:
> > Hi Stefan,
> > I am investigating QEMU devices with persistent state like swtpm for a
> > specific snapshot use case. The VM is paused while disk images and other
> > persistent state files are snapshotted. This creates a crash-consistent
> > snapshot similar to booting after power failure on a real machine. No
> > RAM or volatile device state is collected.
> >
> > My concern is how to ensure the swtpm's persistent state is captured as
> > consistently as possible, but I'm not very familiar with the code. I
> > wanted to run the following by you:
> >
> > - Using --tpmstate dir= will write the persistent state to a new
> > temporary file and then atomically replace the old .permall file using
> > rename(2).
>
> This is correct for the directory backend. We also have the file backend
> where a single file is keeping all the different types of state.
>
> >
> > - If the VM is paused and a copy of the .permall file is taken, then
> > this copy is consistent. It may not reflect any in-progress changes
> > being written into a new temporary file, but that doesn't matter from
>
> Correct.
>
> > the snapshot point of view since the VM is paused and it hasn't seen
> > the completion of in-progress TPM operations.
>
> >
> > - The .volatilestate and .savestate files do not need to be captured in
> > the snapshot since the goal is just to achieve crash consistency.
>
> Yes, I think so since the .volatilestate state would be written only in
> case of VM suspend or migration and the .savestate only upon suspend-to-RAM.
>
> >
> > Does this sound reasonable or have I missed something?
>
> No, I think this sounds reasonable.
Thanks for confirming!
Stefan
prev parent reply other threads:[~2025-09-11 10:24 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-10 21:08 swtpm persistent state snapshots by copying .permall file Stefan Hajnoczi
2025-09-10 23:13 ` Stefan Berger
2025-09-11 10:23 ` Stefan Hajnoczi [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAJSP0QVfaFjtuDqSiEozOmPVUMYzXWaSO21qUp1pHAgo1-Uvqg@mail.gmail.com \
--to=stefanha@gmail.com \
--cc=pkrempa@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanb@linux.ibm.com \
--cc=stefanha@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).