mirror of
https://git.proxmox.com/git/qemu-server
synced 2025-08-06 09:36:10 +00:00
move get_drive_id() helper to drive module
No functional change intended. Signed-off-by: Fiona Ebner <f.ebner@proxmox.com> Reviewed-by: Fabian Grünbichler <f.gruenbichler@proxmox.com> Tested-by: Friedrich Weber <f.weber@proxmox.com>
This commit is contained in:
parent
caddaa62c7
commit
9f95aa78c7
@ -1319,18 +1319,13 @@ sub print_keyboarddevice_full {
|
||||
return "usb-kbd,id=keyboard,bus=ehci.0,port=2";
|
||||
}
|
||||
|
||||
my sub get_drive_id {
|
||||
my ($drive) = @_;
|
||||
return "$drive->{interface}$drive->{index}";
|
||||
}
|
||||
|
||||
sub print_drivedevice_full {
|
||||
my ($storecfg, $conf, $vmid, $drive, $bridges, $arch, $machine_type) = @_;
|
||||
|
||||
my $device = '';
|
||||
my $maxdev = 0;
|
||||
|
||||
my $drive_id = get_drive_id($drive);
|
||||
my $drive_id = PVE::QemuServer::Drive::get_drive_id($drive);
|
||||
if ($drive->{interface} eq 'virtio') {
|
||||
my $pciaddr = print_pci_addr("$drive_id", $bridges, $arch, $machine_type);
|
||||
$device = "virtio-blk-pci,drive=drive-$drive_id,id=${drive_id}${pciaddr}";
|
||||
@ -1470,7 +1465,7 @@ sub print_drive_commandline_full {
|
||||
|
||||
my $path;
|
||||
my $volid = $drive->{file};
|
||||
my $drive_id = get_drive_id($drive);
|
||||
my $drive_id = PVE::QemuServer::Drive::get_drive_id($drive);
|
||||
|
||||
my ($storeid, $volname) = PVE::Storage::parse_volume_id($volid, 1);
|
||||
my $scfg = $storeid ? PVE::Storage::storage_config($storecfg, $storeid) : undef;
|
||||
|
@ -748,6 +748,11 @@ sub print_drive {
|
||||
return PVE::JSONSchema::print_property_string($drive, $fmt, $skip);
|
||||
}
|
||||
|
||||
sub get_drive_id {
|
||||
my ($drive) = @_;
|
||||
return "$drive->{interface}$drive->{index}";
|
||||
}
|
||||
|
||||
sub get_bootdisks {
|
||||
my ($conf) = @_;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user