Skip to content

Commit

Permalink
fix: correctly change topology when no previous model (#1909)
Browse files Browse the repository at this point in the history
Thanks to Susana Aguilar
  • Loading branch information
frankiejol authored Feb 7, 2023
1 parent 24efd81 commit 8fee945
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/Ravada/Domain/KVM.pm
Original file line number Diff line number Diff line change
Expand Up @@ -3348,7 +3348,11 @@ sub _change_xml($xml, $name, $data) {
if ($node->textContent ne $text) {
my ($n_text) = $node->findnodes("text()");
eval {
$n_text->setData($text);
if (!$n_text) {
$node->appendText($text);
} else {
$n_text->setData($text);
}
};
confess $@."\n".Dumper($node->toString,$name,$data)
if $@;
Expand Down
3 changes: 3 additions & 0 deletions t/request/30_hardware.t
Original file line number Diff line number Diff line change
Expand Up @@ -1283,6 +1283,9 @@ sub _test_cpu_topology_old_cpu($domain) {
$cpu->removeAttribute('match');

my ($model) = $cpu->findnodes('model');
$cpu->removeChild($model);

$domain->reload_config($doc);

my $model_exp = 'kvm64';

Expand Down

0 comments on commit 8fee945

Please sign in to comment.