mirror of
https://github.com/virt-manager/virt-manager.git
synced 2025-01-03 01:18:00 +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>
|
<type arch="i686" machine="pc">hvm</type>
|
||||||
<boot dev="cdrom"/>
|
<boot dev="cdrom"/>
|
||||||
<loader readonly="yes" type="pflash">/usr/share/ovmf/ovmf-efi.fd</loader>
|
<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>
|
</os>
|
||||||
<features>
|
<features>
|
||||||
<acpi/>
|
<acpi/>
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
<type arch='i686' machine='pc'>hvm</type>
|
<type arch='i686' machine='pc'>hvm</type>
|
||||||
<boot dev='cdrom'/>
|
<boot dev='cdrom'/>
|
||||||
<loader readonly='yes' type='pflash'>/usr/share/ovmf/ovmf-efi.fd</loader>
|
<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>
|
</os>
|
||||||
<features>
|
<features>
|
||||||
<acpi/>
|
<acpi/>
|
||||||
|
@ -476,17 +476,21 @@ class Cloner(object):
|
|||||||
if not self._nvram_diskinfo:
|
if not self._nvram_diskinfo:
|
||||||
return
|
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
|
new_nvram_path = self._new_nvram_path
|
||||||
if new_nvram_path is None:
|
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(
|
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 = DeviceDisk(self.conn)
|
||||||
new_nvram.set_source_path(new_nvram_path)
|
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
|
if (diskinfo.is_clone_requested() and
|
||||||
new_nvram.wants_storage_creation() and
|
new_nvram.wants_storage_creation() and
|
||||||
|
Loading…
Reference in New Issue
Block a user