Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
frankiejol committed Jan 22, 2024
2 parents a801811 + 61b53c8 commit 369a0df
Show file tree
Hide file tree
Showing 12 changed files with 1,187 additions and 46 deletions.
2 changes: 0 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,4 @@

**Bugfixes**

- Do not insert network twice [\#2005]

**Refactors**
2 changes: 1 addition & 1 deletion lib/Ravada.pm
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package Ravada;
use warnings;
use strict;

our $VERSION = '2.1.6';
our $VERSION = '2.2.0';

use utf8;

Expand Down
7 changes: 6 additions & 1 deletion lib/Ravada/Domain.pm
Original file line number Diff line number Diff line change
Expand Up @@ -912,6 +912,8 @@ sub _pre_prepare_base($self, $user, $request = undef ) {
sleep 1;
}
}
$self->_unlock_host_devices() if !$self->is_active;

# $self->_post_remove_base();
if (!$self->is_local) {
my $vm_local = Ravada::VM->open( type => $self->vm );
Expand Down Expand Up @@ -2275,7 +2277,10 @@ sub _pre_remove_domain($self, $user, @) {
warn "Warning: $@" if $@;
}
$self->pre_remove();
$self->_remove_iptables() if $self->is_known();
if ($self->is_known) {
$self->_remove_iptables();
$self->_unlock_host_devices();
}
eval { $self->shutdown_now($user) if $self->is_active };
warn "Warning: $@" if $@;

Expand Down
26 changes: 26 additions & 0 deletions lib/Ravada/HostDevice/Templates.pm
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,32 @@ our @TEMPLATES_KVM = (
# ]
# }
#

,
{ name => "GPU Mediated Device"
,list_command => "mdevctl list"
,list_filter => '.*'
,template_args => encode_json(
{ uuid => '^(.*?) '}
)
,templates => [{
path => '/domain/devices/hostdev'
,template =>
"<hostdev mode='subsystem' type='mdev' managed='no' model='vfio-pci' display='on'>
<source>
<address uuid='<%= \$uuid %>'/>
</source>
<address type='pci' domain='0x0000' bus='0x00' slot='0x0d' function='0x0'/>
</hostdev>"
}
,{
path => '/domain/features/kvm'
,type => 'unique_node'
,template => "<kvm><hidden state='on'/></kvm>"

}
]
}
);

our @TEMPLATES_VOID = (
Expand Down
Loading

0 comments on commit 369a0df

Please sign in to comment.