From: "Louis McLennan" Subject: HVM domain with PCI passthrough cannot reboot Date: Thu, 21 Apr 2011 01:39:16 +1000 Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_014B_01CBFFC4.ED35A5A0" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org This is a multi-part message in MIME format. ------=_NextPart_000_014B_01CBFFC4.ED35A5A0 Content-Type: multipart/alternative; boundary="----=_NextPart_001_014C_01CBFFC4.ED35A5A0" ------=_NextPart_001_014C_01CBFFC4.ED35A5A0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable When rebooting a win7 domu with PCI pass-through enabled in Xen = Hypervisor 4.1. I encountered the following error. VmError: failed to assign device 01:00.0: maybe it has already been = assigned to other domain, or maybe it doesn't exist. However, one could create the domain with no issues right after this = error appeared. Suggesting something in the reboot process is not = waiting for all PCI devices to detach. At this time I=E2=80=99m working around this issue by inserting a timer = before the VM gets created. I=E2=80=99ve added (domain_reboot_timeout 10) to my xend-config.sxp and = modified some files as seen in attached. As I don=E2=80=99t know python = and I apologise for the slackness of my approach. At this time I=E2=80=99m only passing through a Sound Card, USB = Controller and an ATI Graphics card. Perhaps this is hardware related. I = have applied a patch for the ATI card to work. However, this issue was = present when the ATI card was not listed in the config. As below you can = see it reporting the same thing with the USB Controller. VmError: failed to assign device 00:1b.0: maybe it has already been = assigned to other domain, or maybe it doesn't exist. Thanks, Louis ------=_NextPart_001_014C_01CBFFC4.ED35A5A0 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
When rebooting a win7 domu with PCI pass-through enabled in Xen = Hypervisor=20 4.1. I encountered the following error.
 
VmError: failed to assign device 01:00.0: maybe it has already been = assigned to other domain, or maybe it doesn't exist.
 
However, one could create the domain with no issues right after = this error=20 appeared. Suggesting something in the reboot process is not waiting for = all PCI=20 devices to detach.
 
At this time I=E2=80=99m working around this issue by inserting a = timer before the=20 VM gets created.
I=E2=80=99ve added (domain_reboot_timeout 10) to my xend-config.sxp = and modified=20 some files as seen in attached. As I don=E2=80=99t know python and I = apologise for the=20 slackness of my approach.
 
At this time I=E2=80=99m only passing through a Sound Card, USB = Controller and an=20 ATI Graphics card. Perhaps this is hardware related. I have applied a = patch for=20 the ATI card to work. However, this issue was present when the ATI card = was not=20 listed in the config. As below you can see it reporting the same thing = with the=20 USB Controller.
 
VmError: failed to assign device 00:1b.0: maybe it has already been = assigned to other domain, or maybe it doesn't exist.
 
Thanks,
Louis
------=_NextPart_001_014C_01CBFFC4.ED35A5A0-- ------=_NextPart_000_014B_01CBFFC4.ED35A5A0 Content-Type: text/plain; name="diff.txt" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="diff.txt" diff -Naur a/tools/python/xen/xend/XendDomainInfo.py = b/tools/python/xen/xend/XendDomainInfo.py --- a/tools/python/xen/xend/XendDomainInfo.py 2011-03-25 = 20:42:51.000000000 +1000 +++ b/tools/python/xen/xend/XendDomainInfo.py 2011-04-21 = 00:32:28.890271200 +1000 @@ -120,7 +120,8 @@ @return: An up and running XendDomainInfo instance @raise VmError: Invalid configuration or failure to start. """ - + reboot_timeout_domain =3D = XendOptions.instance().get_domain_reboot_timeout_timeout() + time.sleep(reboot_timeout_domain) log.debug("XendDomainInfo.create_from_dict(%s)", scrub_password(config_dict)) vm =3D XendDomainInfo(XendConfig.XendConfig(xapi =3D config_dict)) diff -Naur a/tools/python/xen/xend/XendOptions.py = b/tools/python/xen/xend/XendOptions.py --- a/tools/python/xen/xend/XendOptions.py 2011-03-25 20:42:51.000000000 = +1000 +++ b/tools/python/xen/xend/XendOptions.py 2011-04-21 00:50:53.582456000 = +1000 @@ -150,6 +150,8 @@ """Default timeout for device destruction.""" device_destroy_timeout_default =3D 100 =20 + domain_reboot_timeout_default =3D 0 + """By default, we use the strict check for HVM guest. (For PV = guest, we use loose check automatically if necessary.""" pci_dev_assign_strict_check_default =3D True @@ -429,6 +431,10 @@ return self.get_config_int("device-destroy-timeout", self.device_destroy_timeout_default) =20 + def get_domain_reboot_timeout_timeout(self): + return self.get_config_int("domain_reboot_timeout", + self.domain_reboot_timeout_default) + def get_pci_dev_assign_strict_check(self): return self.get_config_bool("pci-passthrough-strict-check", = self.pci_dev_assign_strict_check_default) ------=_NextPart_000_014B_01CBFFC4.ED35A5A0 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel ------=_NextPart_000_014B_01CBFFC4.ED35A5A0--