From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id 59615B5C6 for ; Wed, 9 Aug 2023 13:06:49 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 3555814231 for ; Wed, 9 Aug 2023 13:06:49 +0200 (CEST) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [94.136.29.106]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS for ; Wed, 9 Aug 2023 13:06:48 +0200 (CEST) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 566E6433B3 for ; Wed, 9 Aug 2023 13:06:48 +0200 (CEST) Message-ID: <50dca6c9-135f-1713-3c07-590253f3dd26@proxmox.com> Date: Wed, 9 Aug 2023 13:06:43 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.1 To: Proxmox VE development discussion , Filip Schauer References: <20230808120058.343536-1-f.schauer@proxmox.com> Content-Language: en-US From: Fiona Ebner In-Reply-To: <20230808120058.343536-1-f.schauer@proxmox.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-SPAM-LEVEL: Spam detection results: 0 AWL 2.018 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment NICE_REPLY_A -4.14 Looks like a legit reply (A) SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: Re: [pve-devel] [PATCH v2 qemu] fix #1534: vma: Add extract filter for disk images X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Aug 2023 11:06:49 -0000 Am 08.08.23 um 14:00 schrieb Filip Schauer: > @@ -1772,7 +1772,7 @@ index 0000000000..304f02bc84 > + "vma list \n" > + "vma config [-c config]\n" > + "vma create [-c config] pathname ...\n" > -+ "vma extract [-r ] \n" > ++ "vma extract [-f ] [-r ] \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 [-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",