From: "Fabian Grünbichler" <f.gruenbichler@proxmox.com>
To: Fabian Ebner <f.ebner@proxmox.com>, pve-devel@lists.proxmox.com
Subject: Re: [pve-devel] [PATCH qemu-server 04/10] refactor map_storage to map_id
Date: Tue, 09 Nov 2021 13:44:13 +0100 [thread overview]
Message-ID: <1636461801.r9tpxgsubv.astroid@nora.none> (raw)
In-Reply-To: <ea17c562-2089-2b4c-f1fc-b40c94b2dbce@proxmox.com>
On November 9, 2021 10:06 am, Fabian Ebner wrote:
> I feel like map_id should be moved to pve-common, so that it can be
> re-used in other places (pve-container will need it too), and so that no
> package boundary needs to be crossed if we ever need to adapt the
> internals of the idmap.
yeah, likely some other parts as well (either to guest-common, common or
storage, once we extend this mechanism to cover ZFS replication and
container migration)
>
> Am 05.11.21 um 14:03 schrieb Fabian Grünbichler:
>> since we are going to reuse the same mechanism/code for network bridge
>> mapping.
>>
>> Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
>> ---
>> PVE/QemuMigrate.pm | 6 +++---
>> PVE/QemuServer.pm | 6 ++++--
>> 2 files changed, 7 insertions(+), 5 deletions(-)
>>
>> diff --git a/PVE/QemuMigrate.pm b/PVE/QemuMigrate.pm
>> index ae3eaf1..779f5ee 100644
>> --- a/PVE/QemuMigrate.pm
>> +++ b/PVE/QemuMigrate.pm
>> @@ -342,7 +342,7 @@ sub prepare {
>> my $targetsid = $sid;
>> # NOTE: we currently ignore shared source storages in mappings so skip here too for now
>> if (!$scfg->{shared}) {
>> - $targetsid = PVE::QemuServer::map_storage($self->{opts}->{storagemap}, $sid);
>> + $targetsid = PVE::QemuServer::map_id($self->{opts}->{storagemap}, $sid);
>> }
>>
>> my $target_scfg = PVE::Storage::storage_check_enabled($storecfg, $targetsid, $self->{node});
>> @@ -408,7 +408,7 @@ sub scan_local_volumes {
>>
>> next if @{$dl->{$storeid}} == 0;
>>
>> - my $targetsid = PVE::QemuServer::map_storage($self->{opts}->{storagemap}, $storeid);
>> + my $targetsid = PVE::QemuServer::map_id($self->{opts}->{storagemap}, $storeid);
>> # check if storage is available on target node
>> my $target_scfg = PVE::Storage::storage_check_enabled(
>> $storecfg,
>> @@ -479,7 +479,7 @@ sub scan_local_volumes {
>> my $targetsid = $sid;
>> # NOTE: we currently ignore shared source storages in mappings so skip here too for now
>> if (!$scfg->{shared}) {
>> - $targetsid = PVE::QemuServer::map_storage($self->{opts}->{storagemap}, $sid);
>> + $targetsid = PVE::QemuServer::map_id($self->{opts}->{storagemap}, $sid);
>> }
>>
>> PVE::Storage::storage_check_enabled($storecfg, $targetsid, $self->{node});
>> diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
>> index a0e1809..23e7b08 100644
>> --- a/PVE/QemuServer.pm
>> +++ b/PVE/QemuServer.pm
>> @@ -120,7 +120,9 @@ PVE::JSONSchema::register_standard_option('pve-qemu-machine', {
>> });
>>
>>
>> -sub map_storage {
>> +# maps source to target ID
>> +# currently used for targetstorage and targetbridge when migrating
>> +sub map_id {
>> my ($map, $source) = @_;
>>
>> return $source if !defined($map);
>> @@ -5264,7 +5266,7 @@ sub vm_migrate_alloc_nbd_disks {
>> # volume is not available there, fall back to the default format.
>> # Otherwise use the same format as the original.
>> if (!$storagemap->{identity}) {
>> - $storeid = map_storage($storagemap, $storeid);
>> + $storeid = map_id($storagemap, $storeid);
>> my ($defFormat, $validFormats) = PVE::Storage::storage_default_format($storecfg, $storeid);
>> my $scfg = PVE::Storage::storage_config($storecfg, $storeid);
>> my $fileFormat = qemu_img_format($scfg, $volname);
>>
>
next prev parent reply other threads:[~2021-11-09 12:44 UTC|newest]
Thread overview: 49+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-05 13:03 [pve-devel] [PATCH-series qemu-server++ 0/22] remote migration Fabian Grünbichler
2021-11-05 13:03 ` [pve-devel] [PATCH proxmox 1/1] websocket: adapt for client connection Fabian Grünbichler
2021-11-05 13:03 ` [pve-devel] [PATCH proxmox-websocket-tunnel 1/4] initial commit Fabian Grünbichler
2021-11-05 13:03 ` [pve-devel] [PATCH proxmox-websocket-tunnel 2/4] add tunnel implementation Fabian Grünbichler
2021-11-09 12:54 ` Dominik Csapak
2021-11-11 9:58 ` Fabian Grünbichler
2021-11-05 13:03 ` [pve-devel] [PATCH proxmox-websocket-tunnel 3/4] add fingerprint validation Fabian Grünbichler
2021-11-05 13:03 ` [pve-devel] [PATCH proxmox-websocket-tunnel 4/4] add packaging Fabian Grünbichler
2021-11-05 13:03 ` [pve-devel] [PATCH access-control 1/2] tickets: add tunnel ticket Fabian Grünbichler
2021-11-05 13:03 ` [pve-devel] [PATCH access-control 2/2] ticket: normalize path for verification Fabian Grünbichler
2021-11-05 13:03 ` [pve-devel] [PATCH common 1/3] schema: rename storagepair to storage-pair Fabian Grünbichler
2021-11-11 13:18 ` [pve-devel] applied: " Thomas Lamprecht
2021-11-05 13:03 ` [pve-devel] [PATCH common 2/3] schema: add pve-bridge-id option/format/pair Fabian Grünbichler
2021-11-11 13:18 ` [pve-devel] applied: " Thomas Lamprecht
2021-11-05 13:03 ` [pve-devel] [PATCH common 3/3] schema: add proxmox-remote format/option Fabian Grünbichler
2021-11-11 13:18 ` [pve-devel] applied: " Thomas Lamprecht
2021-11-05 13:03 ` [pve-devel] [PATCH guest-common 1/1] migrate: handle migration_network with remote migration Fabian Grünbichler
2021-11-08 13:50 ` Fabian Ebner
2021-11-10 12:03 ` Fabian Ebner
2021-11-05 13:03 ` [pve-devel] [PATCH http-server 1/1] webproxy: handle unflushed write buffer Fabian Grünbichler
2021-11-08 14:15 ` Fabian Ebner
2021-11-08 15:45 ` Fabian Grünbichler
2021-11-05 13:03 ` [pve-devel] [PATCH qemu-server 01/10] d/control: add pve-ha-manager to B-D Fabian Grünbichler
2021-11-11 13:18 ` [pve-devel] applied: " Thomas Lamprecht
2021-11-05 13:03 ` [pve-devel] [PATCH qemu-server 02/10] adapt to renamed storage-pair format Fabian Grünbichler
2021-11-11 13:18 ` [pve-devel] applied: " Thomas Lamprecht
2021-11-05 13:03 ` [pve-devel] [PATCH qemu-server 03/10] migrate: factor out storage checks Fabian Grünbichler
2021-11-11 13:18 ` [pve-devel] applied: " Thomas Lamprecht
2021-11-05 13:03 ` [pve-devel] [PATCH qemu-server 04/10] refactor map_storage to map_id Fabian Grünbichler
2021-11-09 9:06 ` Fabian Ebner
2021-11-09 12:44 ` Fabian Grünbichler [this message]
2021-11-05 13:03 ` [pve-devel] [PATCH qemu-server 05/10] schema: use pve-bridge-id Fabian Grünbichler
2021-11-05 13:03 ` [pve-devel] [PATCH qemu-server 06/10] update_vm: allow simultaneous setting of boot-order and dev Fabian Grünbichler
2021-11-05 13:03 ` [pve-devel] [PATCH qemu-server 07/10] mtunnel: add API endpoints Fabian Grünbichler
2021-11-09 12:46 ` Fabian Ebner
2021-11-10 7:40 ` Fabian Ebner
2021-11-11 11:07 ` Fabian Grünbichler
2021-11-11 11:04 ` Fabian Grünbichler
2021-11-05 13:03 ` [pve-devel] [PATCH qemu-server 08/10] migrate: refactor remote VM/tunnel start Fabian Grünbichler
2021-11-09 14:04 ` Fabian Ebner
2021-11-05 13:03 ` [pve-devel] [PATCH qemu-server 09/10] migrate: add remote migration handling Fabian Grünbichler
2021-11-10 11:17 ` Fabian Ebner
2021-11-11 12:25 ` Fabian Grünbichler
2021-11-11 12:57 ` Fabian Ebner
2021-11-05 13:03 ` [pve-devel] [PATCH qemu-server 10/10] api: add remote migrate endpoint Fabian Grünbichler
2021-11-10 12:29 ` Fabian Ebner
2021-11-11 12:33 ` Fabian Grünbichler
2021-11-09 16:07 ` [pve-devel] [PATCH-series qemu-server++ 0/22] remote migration DERUMIER, Alexandre
2021-11-10 12:42 ` Fabian Ebner
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=1636461801.r9tpxgsubv.astroid@nora.none \
--to=f.gruenbichler@proxmox.com \
--cc=f.ebner@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox