mirror of
https://github.com/virt-manager/virt-manager.git
synced 2024-10-26 17:25:22 +03:00
choosecd: Check path-in-use collision (bz 1028197)
This commit is contained in:
parent
765b1ed7d6
commit
66096a7eeb
@ -1531,7 +1531,7 @@ class vmmAddHardware(vmmGObjectUI):
|
||||
return False
|
||||
|
||||
# Disk collision
|
||||
names = disk.is_conflict_disk(conn)
|
||||
names = disk.is_conflict_disk()
|
||||
if names:
|
||||
res = self.err.yes_no(
|
||||
_('Disk "%s" is already in use by other guests %s') %
|
||||
|
@ -112,6 +112,15 @@ class vmmChooseCD(vmmGObjectUI):
|
||||
except Exception, e:
|
||||
return self.err.val_err(_("Invalid Media Path"), e)
|
||||
|
||||
names = self.disk.is_conflict_disk()
|
||||
if names:
|
||||
res = self.err.yes_no(
|
||||
_('Disk "%s" is already in use by other guests %s') %
|
||||
(self.disk.path, names),
|
||||
_("Do you really want to use the disk?"))
|
||||
if not res:
|
||||
return False
|
||||
|
||||
uihelpers.check_path_search_for_qemu(self.err, self.conn, path)
|
||||
|
||||
self.emit("cdrom-chosen", self.disk, path)
|
||||
|
@ -1817,7 +1817,7 @@ class vmmCreate(vmmGObjectUI):
|
||||
return False
|
||||
|
||||
# Disk collision
|
||||
names = disk.is_conflict_disk(self.guest.conn)
|
||||
names = disk.is_conflict_disk()
|
||||
if names:
|
||||
res = self.err.yes_no(
|
||||
_('Disk "%s" is already in use by other guests %s') %
|
||||
|
@ -488,7 +488,7 @@ def disk_prompt(conn, origpath, origsize, origsparse,
|
||||
"""
|
||||
Check if disk is inuse by another guest
|
||||
"""
|
||||
names = dev.is_conflict_disk(conn)
|
||||
names = dev.is_conflict_disk()
|
||||
if not names:
|
||||
return False
|
||||
|
||||
|
@ -798,7 +798,7 @@ class VirtualDisk(VirtualDevice):
|
||||
return (False, None)
|
||||
return self._storage_creator.is_size_conflict()
|
||||
|
||||
def is_conflict_disk(self, conn):
|
||||
def is_conflict_disk(self, conn=None):
|
||||
"""
|
||||
check if specified storage is in use by any other VMs on passed
|
||||
connection.
|
||||
|
Loading…
Reference in New Issue
Block a user