From: Fiona Ebner <f.ebner@proxmox.com>
To: Proxmox VE development discussion <pve-devel@lists.proxmox.com>,
Filip Schauer <f.schauer@proxmox.com>
Subject: Re: [pve-devel] [PATCH v2 qemu] fix #1534: vma: Add extract filter for disk images
Date: Wed, 9 Aug 2023 13:06:43 +0200 [thread overview]
Message-ID: <50dca6c9-135f-1713-3c07-590253f3dd26@proxmox.com> (raw)
In-Reply-To: <20230808120058.343536-1-f.schauer@proxmox.com>
Am 08.08.23 um 14:00 schrieb Filip Schauer:
> @@ -1772,7 +1772,7 @@ index 0000000000..304f02bc84
> + "vma list <filename>\n"
> + "vma config <filename> [-c config]\n"
> + "vma create <filename> [-c config] pathname ...\n"
> -+ "vma extract <filename> [-r <fifo>] <targetdir>\n"
> ++ "vma extract <filename> [-f <filter>] [-r <fifo>] <targetdir>\n"
Not sure about calling it "filter" now, I feel like "drive-list" or
similar would be more obvious to a user, except...
> + "vma verify <filename> [-v]\n"
> + ;
> +
(...)
> ++
> ++ if (strncmp(token, di->devname, comma - token) == 0) {
...you actually make it a list of prefixes that should match, not a list
of drive names by using "comma - token" ;) E.g. -f "drive" will match
all those that start with "drive" and the empty one will match all.
> ++ skip = true;
This is the wrong way around: skip should be true iff none of the given
file names match.
> ++ filter_bitmap[i] = true;
This is fine, it should indicate what is included.
You only set the filter bitmap if a filter option is given...
(...)
> @@ -2190,7 +2216,7 @@ index 0000000000..304f02bc84
> + if (!readmap) {
> + for (i = 1; i < 255; i++) {
> + VmaDeviceInfo *di = vma_reader_get_device_info(vmar, i);
> -+ if (di && (i != vmstate_stream)) {
> ++ if (di && filter_bitmap[i]) {
...so the renaming will not happen anymore when extracting everything,
without a filter.
Maybe it's better called rename_bitmap or rename_required, because that
is the only use.
> + char *tmpfn = g_strdup_printf("%s/tmp-disk-%s.raw",
> + dirname, di->devname);
> + char *fn = g_strdup_printf("%s/disk-%s.raw",
prev parent reply other threads:[~2023-08-09 11:06 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-08 12:00 Filip Schauer
2023-08-09 11:06 ` Fiona Ebner [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=50dca6c9-135f-1713-3c07-590253f3dd26@proxmox.com \
--to=f.ebner@proxmox.com \
--cc=f.schauer@proxmox.com \
--cc=pve-devel@lists.proxmox.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 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.