blockdev: support alloc-track driver for live-{import, restore}
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
This commit is contained in:
parent
418e5524a1
commit
3f8c946b38
1 changed files with 15 additions and 2 deletions
|
|
@ -123,10 +123,12 @@ my sub get_node_name {
|
|||
my $hash = substr(Digest::SHA::sha256_hex($info), 0, 30);
|
||||
|
||||
my $prefix = "";
|
||||
if ($type eq 'fmt') {
|
||||
$prefix = 'f';
|
||||
if ($type eq 'alloc-track') {
|
||||
$prefix = 'a';
|
||||
} elsif ($type eq 'file') {
|
||||
$prefix = 'e';
|
||||
} elsif ($type eq 'fmt') {
|
||||
$prefix = 'f';
|
||||
} elsif ($type eq 'zeroinit') {
|
||||
$prefix = 'z';
|
||||
} else {
|
||||
|
|
@ -375,6 +377,17 @@ sub generate_drive_blockdev {
|
|||
$child = { driver => 'zeroinit', file => $child, 'node-name' => "$node_name" };
|
||||
}
|
||||
|
||||
if (my $live_restore = $options->{'live-restore'}) {
|
||||
my $node_name = get_node_name('alloc-track', $drive_id, $drive->{file}, $options);
|
||||
$child = {
|
||||
driver => 'alloc-track',
|
||||
'auto-remove' => JSON::true,
|
||||
backing => $live_restore->{blockdev},
|
||||
file => $child,
|
||||
'node-name' => "$node_name",
|
||||
};
|
||||
}
|
||||
|
||||
# for fleecing and TPM backup, this is already the top node
|
||||
return $child if $options->{fleecing} || $options->{'tpm-backup'} || $options->{'no-throttle'};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue