VirtualDisk: Drop is_parse conditional if changing device

We can easily push this up to the caller, nothing really changes the
device of an existing device in practice.
This commit is contained in:
Cole Robinson 2013-07-14 09:15:24 -04:00
parent d3dbbe9f54
commit 6506fb2995
2 changed files with 2 additions and 8 deletions

View File

@ -271,8 +271,8 @@ class XMLParseTest(unittest.TestCase):
check("path", "/dev/loop0", None)
check("device", "cdrom", "floppy")
check("read_only", True, False)
check("target", None, "fde")
check("bus", None, "fdc")
check("target", "hdc", "fde")
check("bus", "ide", "fdc")
check("error_policy", "stop", None)
check = self._make_checker(disk6)

View File

@ -449,12 +449,6 @@ class VirtualDisk(VirtualDevice):
def get_device(self):
return self._device
def set_device(self, val):
if val == self._device:
return
if self._is_parse():
self.bus = None
self.target = None
self._device = val
device = XMLProperty(get_device, set_device,
xpath="./@device")