From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marek =?utf-8?Q?Marczykowski-G=C3=B3recki?= Subject: Re: [PATCH 3/3] libxl: don't try to manipulate json config for stubdomain Date: Wed, 19 Oct 2016 12:32:59 +0200 Message-ID: <20161019103259.GC559@mail-itl> References: <1476755613-3921-1-git-send-email-marmarek@invisiblethingslab.com> <1476755613-3921-4-git-send-email-marmarek@invisiblethingslab.com> <20161019093804.GG2639@citrix.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============5384381353057383754==" Return-path: In-Reply-To: <20161019093804.GG2639@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" To: Wei Liu Cc: Samuel Thibault , Ian Jackson , xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org --===============5384381353057383754== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="Y5rl02BVI9TCfPar" Content-Disposition: inline --Y5rl02BVI9TCfPar Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Oct 19, 2016 at 10:38:04AM +0100, Wei Liu wrote: > On Tue, Oct 18, 2016 at 03:53:33AM +0200, Marek Marczykowski-G=C3=B3reck= i wrote: > > Stubdomain do not have it's own config file - its configuration is > > derived from target domains. Do not try to manipulate it when attachin= g > > PCI device. > >=20 > > This bug prevented starting HVM with stubdomain and PCI passthrough > > device attached. > >=20 > > Signed-off-by: Marek Marczykowski-G=C3=B3recki > > --- > > tools/libxl/libxl_pci.c | 24 +++++++++++++++--------- > > 1 file changed, 15 insertions(+), 9 deletions(-) > >=20 > > diff --git a/tools/libxl/libxl_pci.c b/tools/libxl/libxl_pci.c > > index 3805d30..5ad70c5 100644 > > --- a/tools/libxl/libxl_pci.c > > +++ b/tools/libxl/libxl_pci.c > > @@ -151,14 +151,18 @@ static int libxl__device_pci_add_xenstore(libxl_= _gc *gc, uint32_t domid, libxl_d > > GCNEW(device); > > libxl__device_from_pcidev(gc, domid, pcidev, device); > > =20 > > - lock =3D libxl__lock_domain_userdata(gc, domid); > > - if (!lock) { > > - rc =3D ERROR_LOCK_FAIL; > > - goto out; > > - } > > + /* Stubdomain config is derived from its target domain, it doesn'= t have > > + its own file */ > > + if (!libxl_is_stubdom(CTX, domid, NULL)) { > > + lock =3D libxl__lock_domain_userdata(gc, domid); > > + if (!lock) { > > + rc =3D ERROR_LOCK_FAIL; > > + goto out; > > + } > > =20 >=20 > What makes PCI devices special with regard to other devices? In other > words, do we need to make similar changes to other devices as well? I think PCI is special because libxl doesn't bother to update stubdomain configuration for other device types at all... If I try dynamic attach of network device to a HVM (with stubdomain), it gets attached _only_ to the target domain. So HVM without any PV drivers is out of luck. Is it supposed to work with qemu in dom0? --=20 Best Regards, Marek Marczykowski-G=C3=B3recki Invisible Things Lab A: Because it messes up the order in which people normally read text. Q: Why is top-posting such a bad thing? --Y5rl02BVI9TCfPar Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBCAAGBQJYB0vaAAoJENuP0xzK19csIQMH/2cgmperR4apnukdhpVrpWLZ oXMce0AU7BEE2UDAksn7ShzLFoPN+7ZOLMThs7ADwkUR/qXSAx6JXBQ+zqvaDifo RG4uKug8ydcbXYX3N8n9hApiZJEIkbz5NJtOilSoFhXzjxbUSyLfE33KOoHynNro cD6smz6+oCPWeu1blMvH+3c+Tv0kaXIjQ/PEiFo3PMm17qpZIsXZXV1HXSH2f0I+ SOcBlKKNQTJiAgvpRiGAbpDSaY1PAxp+8ZsPZbMhnXNUWk1xLwpvc6pERSi9Llaw o+AWfXr7d6QGZ1oGqoQQKudRU5a4yUQ0D3+x7NR0GhOf9pGazgPp51x+GHYCAz4= =FRbW -----END PGP SIGNATURE----- --Y5rl02BVI9TCfPar-- --===============5384381353057383754== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KWGVuLWRldmVs IG1haWxpbmcgbGlzdApYZW4tZGV2ZWxAbGlzdHMueGVuLm9yZwpodHRwczovL2xpc3RzLnhlbi5v cmcveGVuLWRldmVsCg== --===============5384381353057383754==--