[pve-devel] [PATCH storage v2 1/4] Disks API: allow also unused disks for db/wal

Dominik Csapak d.csapak at proxmox.com
Tue Jun 4 12:35:21 CEST 2019


since we will create a pv/vg/lv on it with nautilus

Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
changes from v1:
* switch test for used and lvm
* pull 'not' out and reverse tests -> this makes it more understandable
  when a disk is a valid journal
 PVE/API2/Disks.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/PVE/API2/Disks.pm b/PVE/API2/Disks.pm
index ce4acee..89ed57d 100644
--- a/PVE/API2/Disks.pm
+++ b/PVE/API2/Disks.pm
@@ -137,7 +137,7 @@ __PACKAGE__->register_method ({
 	    my $entry = $disks->{$disk};
 	    if ($type eq 'journal_disks') {
 		next if $entry->{osdid} >= 0;
-		next if !$entry->{gpt} && $entry->{used} ne 'LVM';
+		next if !($entry->{gpt} || !$entry->{used} || $entry->{used} eq 'LVM');
 	    } elsif ($type eq 'unused') {
 		next if $entry->{used};
 	    } elsif ($type ne '') {
-- 
2.11.0





More information about the pve-devel mailing list