Use vm.name instead vm object

This helps create_new_vm since we don't have the vm yet
This commit is contained in:
donoban 2021-03-14 13:21:24 +01:00
parent 31f4297c7d
commit 094ec99829
No known key found for this signature in database
GPG Key ID: 141310D8E3ED08A5
2 changed files with 5 additions and 4 deletions

View File

@ -38,7 +38,7 @@ class VMBootFromDeviceWindow(ui_bootfromdevice.Ui_BootDialog,
self.setupUi(self)
self.setWindowTitle(
self.tr("Boot {vm} from device").format(vm=self.vm.name))
self.tr("Boot {vm} from device").format(vm=self.vm))
self.buttonBox.accepted.connect(self.save_and_apply)
self.buttonBox.rejected.connect(self.reject)
@ -74,7 +74,7 @@ class VMBootFromDeviceWindow(ui_bootfromdevice.Ui_BootDialog,
def __warn_if_running__(self):
try:
if self.vm.is_running():
if self.qubesapp.domains[self.vm].is_running():
QtWidgets.QMessageBox.warning(
self,
self.tr("Warning!"),
@ -104,7 +104,8 @@ class VMBootFromDeviceWindow(ui_bootfromdevice.Ui_BootDialog,
)
device_choice = []
for domain in self.vm.app.domains:
for domain in self.qubesapp.domains:
try:
for device in domain.devices["block"]:
device_choice.append((str(device), device))

View File

@ -1025,7 +1025,7 @@ class VMSettingsWindow(ui_settingsdlg.Ui_SettingsDialog, QtWidgets.QDialog):
def boot_from_cdrom_button_pressed(self):
boot_dialog = bootfromdevice.VMBootFromDeviceWindow(
self.vm, self.qapp, self.qubesapp, self)
self.vm.name, self.qapp, self.qubesapp, self)
if boot_dialog.exec_():
self.save_and_apply()
qvm_start.main(['--cdrom', boot_dialog.cdrom_location, self.vm.name])