Skip to content
This repository was archived by the owner on Jan 22, 2026. It is now read-only.

Commit 4f2e79d

Browse files
committed
VirtualHostDevice: Don't error if nodedev dettach isn't supportted.
1 parent bf11098 commit 4f2e79d

1 file changed

Lines changed: 12 additions & 6 deletions

File tree

virtinst/VirtualHostDevice.py

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@
2020
import VirtualDevice
2121
import NodeDeviceParser
2222
import logging
23+
import libvirt
2324

25+
from virtinst import support
2426
from virtinst import _util
2527
from virtinst import _virtinst as _
2628

@@ -216,12 +218,16 @@ def setup(self, conn = None):
216218
return
217219

218220
try:
219-
# Do this as a sanity check, so that we don't fail at domain
220-
# start time. This is independent of the 'managed' state, since
221-
# this should work regardless.
222-
node = conn.nodeDeviceLookupByName(self._nodedev.name)
223-
node.dettach()
224-
node.reset()
221+
try:
222+
# Do this as a sanity check, so that we don't fail at domain
223+
# start time. This is independent of the 'managed' state, since
224+
# this should work regardless.
225+
node = conn.nodeDeviceLookupByName(self._nodedev.name)
226+
node.dettach()
227+
node.reset()
228+
except libvirt.libvirtError, e:
229+
if not support.is_error_nosupport(e):
230+
raise
225231
except Exception, e:
226232
raise RuntimeError(_("Could not detach PCI device: %s" % str(e)))
227233

0 commit comments

Comments
 (0)