On Tue, Mar 14, 2023 at 4:35 AM David Woodhouse <dw...@infradead.org> wrote: > > From: David Woodhouse <d...@amazon.co.uk> > > When dm_restrict is set, QEMU isn't permitted to update the XenStore node > to indicate its running status. Previously, the xs_write() call would fail > but the failure was ignored. > > However, in refactoring to allow for emulated XenStore operations, a new > call to xs_open() was added. That one didn't fail gracefully, causing a > fatal error when running in dm_restrict mode. > > Partially revert the offending patch, removing the additional call to > xs_open() because the global 'xenstore' variable is still available; it > just needs to be used with qemu_xen_xs_write() now instead of directly > with the xs_write() libxenstore function. > > Also make the whole thing conditional on !xen_domid_restrict. There's no > point even registering the state change handler to attempt to update the > XenStore node when we know it's destined to fail. > > Fixes: ba2a92db1ff6 ("hw/xen: Add xenstore operations to allow redirection to > internal emulation") > Reported-by: Jason Andryuk <jandr...@gmail.com> > Co-developed-by: Jason Andryuk <jandr...@gmail.com> > Not-Signed-off-by: Jason Andryuk <jandr...@gmail.com> > Signed-off-by: David Woodhouse <d...@amazon.co.uk> > Will-be-Tested-by: Jason Andryuk <jandr...@gmail.com>
Signed-off-by: Jason Andryuk <jandr...@gmail.com> Tested-by: Jason Andryuk <jandr...@gmail.com> Thanks, David. -Jason