Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Projets publics
Ravada-Mirror
Commits
ebf850d3
Commit
ebf850d3
authored
Jun 29, 2021
by
frankiejol
Browse files
refactor: refresh backing store after spinoff
Suggested by @fv3rdugo
parent
f8494e49
Changes
2
Show whitespace changes
Inline
Side-by-side
lib/Ravada/Domain.pm
View file @
ebf850d3
...
@@ -931,6 +931,7 @@ sub spinoff {
...
@@ -931,6 +931,7 @@ sub spinoff {
next
if
!
$bf
;
next
if
!
$bf
;
$volume
->
spinoff
;
$volume
->
spinoff
;
}
}
$self
->
_set_volumes_backing_store
()
if
$self
->
type
eq
'
KVM
';
}
}
...
...
t/vm/s10_spinoff.t
View file @
ebf850d3
...
@@ -13,6 +13,24 @@ use Test::Ravada;
...
@@ -13,6 +13,24 @@ use Test::Ravada;
##############################################################
##############################################################
sub
test_xml
($domain) {
my
$doc
=
XML::
LibXML
->
load_xml
(
string
=>
$domain
->
domain
->
get_xml_description
);
for
my
$disk
(
$doc
->
findnodes
('
/domain/devices/disk
'))
{
my
$is_disk
;
my
$bs
=
'';
for
my
$child
(
$disk
->
childNodes
)
{
$is_disk
++
if
$child
->
nodeName
eq
'
source
';
if
(
$child
->
nodeName
eq
'
backingStore
'
)
{
(
$bs
)
=
$child
->
findnodes
("
source
");
$bs
=
$bs
->
toString
;
}
}
next
if
!
$is_disk
;
is
(
$bs
,'');
}
}
sub
test_spinoff
($base) {
sub
test_spinoff
($base) {
my
$clone
=
$base
->
clone
(
name
=>
new_domain_name
,
user
=>
user_admin
);
my
$clone
=
$base
->
clone
(
name
=>
new_domain_name
,
user
=>
user_admin
);
is
(
$clone
->
id_base
,
$base
->
id
);
is
(
$clone
->
id_base
,
$base
->
id
);
...
@@ -26,6 +44,8 @@ sub test_spinoff($base) {
...
@@ -26,6 +44,8 @@ sub test_spinoff($base) {
$clone
=
Ravada::
Domain
->
open
(
$clone
->
id
);
$clone
=
Ravada::
Domain
->
open
(
$clone
->
id
);
is
(
$clone
->
id_base
,
undef
)
or
exit
;
is
(
$clone
->
id_base
,
undef
)
or
exit
;
test_xml
(
$clone
)
if
$clone
->
type
eq
'
KVM
';
for
my
$vol
(
$clone
->
list_volumes_info
)
{
for
my
$vol
(
$clone
->
list_volumes_info
)
{
next
if
ref
(
$vol
)
=~
/ISO/
;
next
if
ref
(
$vol
)
=~
/ISO/
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment