mirror of
https://github.com/virt-manager/virt-manager.git
synced 2024-12-21 09:34:12 +03:00
cloner: Handle .qcow2 nvram extension
We were hardcoding .fd extension, but it can be different nowadays Signed-off-by: Cole Robinson <crobinso@redhat.com>
This commit is contained in:
parent
276aa4a72e
commit
8eb87af411
@ -8,7 +8,7 @@
|
||||
<type arch="i686" machine="pc">hvm</type>
|
||||
<boot dev="cdrom"/>
|
||||
<loader readonly="yes" type="pflash">/usr/share/ovmf/ovmf-efi.fd</loader>
|
||||
<nvram>/nvram/clone-orig-clone_VARS.fd</nvram>
|
||||
<nvram>/nvram/clone-orig-clone_VARS.fakeext</nvram>
|
||||
</os>
|
||||
<features>
|
||||
<acpi/>
|
||||
|
@ -8,7 +8,7 @@
|
||||
<type arch='i686' machine='pc'>hvm</type>
|
||||
<boot dev='cdrom'/>
|
||||
<loader readonly='yes' type='pflash'>/usr/share/ovmf/ovmf-efi.fd</loader>
|
||||
<nvram>/nvram/clone-orig_VARS.fd</nvram>
|
||||
<nvram>/nvram/clone-orig_VARS.fakeext</nvram>
|
||||
</os>
|
||||
<features>
|
||||
<acpi/>
|
||||
|
@ -476,17 +476,21 @@ class Cloner(object):
|
||||
if not self._nvram_diskinfo:
|
||||
return
|
||||
|
||||
diskinfo = self._nvram_diskinfo
|
||||
old_nvram = DeviceDisk(self.conn)
|
||||
old_nvram_path = diskinfo.disk.get_source_path()
|
||||
old_nvram.set_source_path(old_nvram_path)
|
||||
|
||||
new_nvram_path = self._new_nvram_path
|
||||
if new_nvram_path is None:
|
||||
nvram_dir = os.path.dirname(self._new_guest.os.nvram)
|
||||
ext = os.path.splitext(old_nvram_path)[1]
|
||||
nvram_dir = os.path.dirname(old_nvram_path)
|
||||
new_nvram_path = os.path.join(
|
||||
nvram_dir, "%s_VARS.fd" % self._new_guest.name)
|
||||
nvram_dir, "%s_VARS%s" %
|
||||
(os.path.basename(self._new_guest.name), ext or ".fd"))
|
||||
|
||||
diskinfo = self._nvram_diskinfo
|
||||
new_nvram = DeviceDisk(self.conn)
|
||||
new_nvram.set_source_path(new_nvram_path)
|
||||
old_nvram = DeviceDisk(self.conn)
|
||||
old_nvram.set_source_path(diskinfo.disk.get_source_path())
|
||||
|
||||
if (diskinfo.is_clone_requested() and
|
||||
new_nvram.wants_storage_creation() and
|
||||
|
Loading…
Reference in New Issue
Block a user