Message ID | 20250731082707.3481718-4-yoann.congal@smile.fr |
---|---|
State | New |
Headers | show |
Series | [v3,1/4] runqemu: Add support for running compressed .zst rootfs images | expand |
On Thu, 31 Jul 2025 at 10:27, Yoann Congal via lists.openembedded.org <yoann.congal=smile.fr@lists.openembedded.org> wrote: > + if self.snapshot: > + msg = "Enabled. Changes on rootfs won't be kept after QEMU shutdown." > + else: > + msg = "Disabled. Changes on rootfs will be kept after QEMU shutdown." > + logoutput.append('SNAPSHOT: [%s]' % msg) msg is not a good name, snapshot_msg is better. I would also avoid the if-else block altogether, and just use a conditional expression after %: 'Enabled. ...' if self.snapshot else 'Disabled. ...' Alex
Le jeu. 31 juil. 2025 à 10:55, Alexander Kanavin <alex.kanavin@gmail.com> a écrit : > On Thu, 31 Jul 2025 at 10:27, Yoann Congal via lists.openembedded.org > <yoann.congal=smile.fr@lists.openembedded.org> wrote: > > + if self.snapshot: > > + msg = "Enabled. Changes on rootfs won't be kept after QEMU > shutdown." > > + else: > > + msg = "Disabled. Changes on rootfs will be kept after QEMU > shutdown." > > + logoutput.append('SNAPSHOT: [%s]' % msg) > > msg is not a good name, snapshot_msg is better. I would also avoid the > if-else block altogether, and just use a conditional expression after > %: > > 'Enabled. ...' if self.snapshot else 'Disabled. ...' > Thanks! I used that in v4. > > Alex >
diff --git a/scripts/runqemu b/scripts/runqemu index da53265219..99ea0a98ea 100755 --- a/scripts/runqemu +++ b/scripts/runqemu @@ -1053,6 +1053,11 @@ to your build configuration. logoutput.append('NFS_DIR: [%s]' % self.rootfs) else: logoutput.append('ROOTFS: [%s]' % self.rootfs) + if self.snapshot: + msg = "Enabled. Changes on rootfs won't be kept after QEMU shutdown." + else: + msg = "Disabled. Changes on rootfs will be kept after QEMU shutdown." + logoutput.append('SNAPSHOT: [%s]' % msg) if self.ovmf_bios: logoutput.append('OVMF: %s' % self.ovmf_bios) if (self.ovmf_secboot_pkkek1):