dom0/core: clone support for HVM
This commit is contained in:
parent
abb9e64e3f
commit
b4b639cbb3
@ -2118,6 +2118,15 @@ class QubesHVm(QubesVm):
|
|||||||
def is_appvm(self):
|
def is_appvm(self):
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
def get_clone_attrs(self):
|
||||||
|
attrs = super(QubesHVm, self).get_clone_attrs()
|
||||||
|
attrs.remove('kernel')
|
||||||
|
attrs.remove('uses_default_kernel')
|
||||||
|
attrs.remove('kernelopts')
|
||||||
|
attrs.remove('uses_default_kernelopts')
|
||||||
|
attrs.remove('maxmem')
|
||||||
|
return attrs
|
||||||
|
|
||||||
def create_on_disk(self, verbose, source_template = None):
|
def create_on_disk(self, verbose, source_template = None):
|
||||||
if dry_run:
|
if dry_run:
|
||||||
return
|
return
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
from qubes.qubes import QubesVmCollection
|
from qubes.qubes import QubesVmCollection
|
||||||
from qubes.qubes import QubesAppVm, QubesTemplateVm
|
from qubes.qubes import QubesAppVm, QubesTemplateVm, QubesHVm
|
||||||
from qubes.qubes import QubesException
|
from qubes.qubes import QubesException
|
||||||
from optparse import OptionParser;
|
from optparse import OptionParser;
|
||||||
import sys
|
import sys
|
||||||
@ -62,6 +62,8 @@ def main():
|
|||||||
dst_vm = qvm_collection.add_new_appvm(name=dstname, template_vm=src_vm.template_vm,
|
dst_vm = qvm_collection.add_new_appvm(name=dstname, template_vm=src_vm.template_vm,
|
||||||
updateable=src_vm.updateable, label=src_vm.label,
|
updateable=src_vm.updateable, label=src_vm.label,
|
||||||
dir_path=options.dir_path)
|
dir_path=options.dir_path)
|
||||||
|
elif isinstance(src_vm, QubesHVm):
|
||||||
|
dst_vm = qvm_collection.add_new_hvm(name=dstname, label=src_vm.label)
|
||||||
else:
|
else:
|
||||||
print >> sys.stderr, "ERROR: Clone not supported for this type of VM"
|
print >> sys.stderr, "ERROR: Clone not supported for this type of VM"
|
||||||
exit(1)
|
exit(1)
|
||||||
|
Loading…
Reference in New Issue
Block a user