From: Kevin Wolf <kwolf@redhat.com>
To: Andrey Drobyshev <andrey.drobyshev@virtuozzo.com>
Cc: "Daniel P. Berrangé" <berrange@redhat.com>,
qemu-devel@nongnu.org, peterx@redhat.com, stefanha@redhat.com,
vsementsov@yandex-team.ru, den@virtuozzo.com
Subject: Re: [PATCH 4/4] scripts/qemugdb: coroutine: Add option for obtaining detailed trace in coredump
Date: Fri, 28 Nov 2025 14:18:18 +0100 [thread overview]
Message-ID: <aSmhGomQvDyiQ57z@redhat.com> (raw)
In-Reply-To: <ce8c9c03-5dfe-4f0f-8394-e9ba95f0f09a@virtuozzo.com>
Am 28.11.2025 um 13:24 hat Andrey Drobyshev geschrieben:
> On 11/27/25 6:39 PM, Kevin Wolf wrote:
> > Am 27.11.2025 um 15:31 hat Andrey Drobyshev geschrieben:
> >> As for reflink copy, this might've been a great solution. However, it
> >> would largely depend on the FS used. E.g. in my system coredumpctl
> >> places uncompressed coredump at /var/tmp, which is mounted as ext4. And
> >> in this case:
> >>
> >> # cp --reflink /var/tmp/coredump-MQCZQc /root
> >> cp: failed to clone '/root/coredump-MQCZQc' from
> >> '/var/tmp/coredump-MQCZQc': Invalid cross-device link
> >>
> >> # cp --reflink /var/tmp/coredump-MQCZQc /var/tmp/coredump.ref
> >> cp: failed to clone '/var/tmp/coredump.ref' from
> >> '/var/tmp/coredump-MQCZQc': Operation not supported
> >>
> >> Apparently, ext4 doesn't support reflink copy. xfs and btrfs do. But I
> >> guess our implementation better be FS-agnostic.
> >
> > Yes, we might still need a slow copy fallback for those filesystems,
> > i.e. essentially a 'cp --reflink=auto'. For myself, coredumps will
> > generally live on XFS, so I would benefit from creating that copy in the
> > same filesystem where the coredump lives, and for you it shouldn't hurt
> > at least.
> >
> > Another thought... it's a bit crazy, but... we're QEMU, we have our own
> > tools for this. We could create a qcow2 overlay for the coredump and
> > export it using FUSE! :-D (Probably not very practical because you need
> > the right paths for the binaries, but I had to mention it.)
> >
> > Kevin
>
> We can surely add reflink copying as a fast path option which we try
> first. That's cheap to implement. The real issue is designing a
> sensible fallback approach.
I mean, as far as I am concerned, you can keep what you already have as
the fallback approach. Reflink copy if possible, and otherwise a slow
full copy.
Or if the coredump can be written to, you could do the in-place editing,
though I would save the original content in a file that could survive a
crash. And after finishing the operation, the original content
definitely should be written back.
> As for creating an overlay... That's an interesting option but it would
> require everybody who wants to use this stuff configure their QEMU build
> with --enable-fuse. We, for instance, don't have it enabled in our
> builds, as I'm sure many others.
>
> Of course we can think of an NBD export for such an overlay instead of
> FUSE. But it'll then require root user to write to /dev/nbd0. Also not
> very acceptable.
>
> Quick overlayfs mount with lowerdir=/var/tmp could also solve this. But
> again, root is required. Not good.
>
> So the most robust option, I guess, is the one suggested by Daniel:
> copying some kind of minimal viable coredump part/range instead of the
> whole file, which is just enough for producing valid backtrace. The
> only thing left is figuring out which part to copy. That might require
> some tricky ELF structure parsing.
All of these solutions are interesting, but honestly feel a bit too
complex for a simple debugging script.
Kevin
next prev parent reply other threads:[~2025-11-28 13:18 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-25 14:21 [PATCH 0/4] Fixes and improvements for scripts/qemugdb commands andrey.drobyshev
2025-11-25 14:21 ` [PATCH 1/4] scripts/qemugdb: mtree: Fix OverflowError in mtree with 128-bit addresses andrey.drobyshev
2025-11-25 14:21 ` [PATCH 2/4] scripts/qemugdb: timers: Fix KeyError in 'qemu timers' command andrey.drobyshev
2025-11-25 14:21 ` [PATCH 3/4] scripts/qemugdb: timers: Improve 'qemu timers' command readability andrey.drobyshev
2025-11-25 14:21 ` [PATCH 4/4] scripts/qemugdb: coroutine: Add option for obtaining detailed trace in coredump andrey.drobyshev
2025-11-26 20:58 ` Stefan Hajnoczi
2025-11-27 13:14 ` Andrey Drobyshev
2025-11-27 14:48 ` Stefan Hajnoczi
2025-11-27 16:13 ` Andrey Drobyshev
2025-11-27 9:56 ` Kevin Wolf
2025-11-27 10:02 ` Daniel P. Berrangé
2025-11-27 14:31 ` Andrey Drobyshev
2025-11-27 14:55 ` Daniel P. Berrangé
2025-11-27 16:39 ` Kevin Wolf
2025-11-28 12:24 ` Andrey Drobyshev
2025-11-28 13:18 ` Kevin Wolf [this message]
2025-12-02 16:36 ` Andrey Drobyshev
2025-11-26 20:59 ` [PATCH 0/4] Fixes and improvements for scripts/qemugdb commands Stefan Hajnoczi
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=aSmhGomQvDyiQ57z@redhat.com \
--to=kwolf@redhat.com \
--cc=andrey.drobyshev@virtuozzo.com \
--cc=berrange@redhat.com \
--cc=den@virtuozzo.com \
--cc=peterx@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.com \
--cc=vsementsov@yandex-team.ru \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.