xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [Xen-devel] Running xenstored in Linux stubdom
@ 2019-09-04 15:45 Daniel Smith
  2019-09-04 16:12 ` Juergen Gross
  0 siblings, 1 reply; 5+ messages in thread
From: Daniel Smith @ 2019-09-04 15:45 UTC (permalink / raw)
  To: xen-devel; +Cc: jgross

Greetings,

I am attempting to see if I can get xenstored to run within a Linux
stubdom for a variety of reasons. The way I have it constructed at
this point is that embedded within the initramfs of dom0 is the linux
stubdom image along with the init-xenstore-domain helper. The init
script within the initramfs does basic Linux start setup, launches
udev and then attempts to start the stubdom using the helper binary.
The helper binary hangs and using strace shows the last calls before
hanging is,

write(3, "/tool/xenstored/domid\0:, 22) = 22
write(3, "1", 1)                                      = 1
read(3,

For the stubdom itself, its init script does the basic Linux start
setup and then executes xenstored in foreground. I have tested the
stubdom as a regular guest passing the --no-domain-init flag and I see
no issues with the domain starting and launching xenstored.

For a point of reference, I have been able to successfully use the
minios stubdom in place of the Linux stubdom. I have been reviewing
the minios version to see what I might be missing in the LInux version
to no avail. Perhaps others may have insight on what the issue may be.

Thank in advance,
Daniel P. Smith

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Xen-devel] Running xenstored in Linux stubdom
  2019-09-04 15:45 [Xen-devel] Running xenstored in Linux stubdom Daniel Smith
@ 2019-09-04 16:12 ` Juergen Gross
  2019-09-04 17:26   ` Daniel Smith
  0 siblings, 1 reply; 5+ messages in thread
From: Juergen Gross @ 2019-09-04 16:12 UTC (permalink / raw)
  To: Daniel Smith, xen-devel

On 04.09.19 17:45, Daniel Smith wrote:
> Greetings,
> 
> I am attempting to see if I can get xenstored to run within a Linux
> stubdom for a variety of reasons. The way I have it constructed at
> this point is that embedded within the initramfs of dom0 is the linux
> stubdom image along with the init-xenstore-domain helper. The init
> script within the initramfs does basic Linux start setup, launches
> udev and then attempts to start the stubdom using the helper binary.
> The helper binary hangs and using strace shows the last calls before
> hanging is,
> 
> write(3, "/tool/xenstored/domid\0:, 22) = 22
> write(3, "1", 1)                                      = 1
> read(3,
> 
> For the stubdom itself, its init script does the basic Linux start
> setup and then executes xenstored in foreground. I have tested the
> stubdom as a regular guest passing the --no-domain-init flag and I see
> no issues with the domain starting and launching xenstored.
> 
> For a point of reference, I have been able to successfully use the
> minios stubdom in place of the Linux stubdom. I have been reviewing
> the minios version to see what I might be missing in the LInux version
> to no avail. Perhaps others may have insight on what the issue may be.

The stubdom gets an event channel to use for dom0 xenbstore connection
via commandline parameter ("--event <event-nr>"). This needs to be used
in the stubdom for setting up the communication path.


Juergen

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Xen-devel] Running xenstored in Linux stubdom
  2019-09-04 16:12 ` Juergen Gross
@ 2019-09-04 17:26   ` Daniel Smith
  2019-09-06 18:01     ` Daniel Smith
  0 siblings, 1 reply; 5+ messages in thread
From: Daniel Smith @ 2019-09-04 17:26 UTC (permalink / raw)
  To: Juergen Gross; +Cc: xen-devel

On Wed, Sep 4, 2019 at 12:12 PM Juergen Gross <jgross@suse.com> wrote:
>
> The stubdom gets an event channel to use for dom0 xenbstore connection
> via commandline parameter ("--event <event-nr>"). This needs to be used
> in the stubdom for setting up the communication path.
>
>
> Juergen

Hi Juergen,

Thanks for the quick response! tracing through xenstored, looks like
that flag sets the variable dom0_event which is only used in the
xenstored_minios.c as the return value to the xenbus_evtchn() call. I
could naively short circuit xenbus_evtchn() under xenstored_posix.c to
return immediately if dom0_event has been set. If that works, I would
be glad to submit it back upstream if there is interest in
incorporating it.

Thanks again!
Daniel P. Smith

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Xen-devel] Running xenstored in Linux stubdom
  2019-09-04 17:26   ` Daniel Smith
@ 2019-09-06 18:01     ` Daniel Smith
  2019-09-09  9:08       ` Juergen Gross
  0 siblings, 1 reply; 5+ messages in thread
From: Daniel Smith @ 2019-09-06 18:01 UTC (permalink / raw)
  To: Juergen Gross; +Cc: xen-devel

On Wed, Sep 4, 2019 at 1:26 PM Daniel Smith <dpsmith.dev@gmail.com> wrote:
>
> On Wed, Sep 4, 2019 at 12:12 PM Juergen Gross <jgross@suse.com> wrote:
> >
> > The stubdom gets an event channel to use for dom0 xenbstore connection
> > via commandline parameter ("--event <event-nr>"). This needs to be used
> > in the stubdom for setting up the communication path.
> >
> >
> > Juergen
>
> Hi Juergen,
>
> Thanks for the quick response! tracing through xenstored, looks like
> that flag sets the variable dom0_event which is only used in the
> xenstored_minios.c as the return value to the xenbus_evtchn() call. I
> could naively short circuit xenbus_evtchn() under xenstored_posix.c to
> return immediately if dom0_event has been set. If that works, I would
> be glad to submit it back upstream if there is interest in
> incorporating it.

Hi again,

I made the change to short circuit the xenbus_evtchn and did testing
as a guest domain approach to confirm that i was parsing the
parameters correctly in initramfs script that init-xenstore-helper
passed. I am still it hanging after the attempt to write
/tool/xenstored/domid. At this point I was wondering if there might be
a way to get console output from the domain to try and troubleshoot if
xenstored is getting started when actually running as the actual
stubdom instead of as a guest?

Thanks in Advance!
Daniel P. Smith

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Xen-devel] Running xenstored in Linux stubdom
  2019-09-06 18:01     ` Daniel Smith
@ 2019-09-09  9:08       ` Juergen Gross
  0 siblings, 0 replies; 5+ messages in thread
From: Juergen Gross @ 2019-09-09  9:08 UTC (permalink / raw)
  To: Daniel Smith; +Cc: xen-devel

On 06.09.19 20:01, Daniel Smith wrote:
> On Wed, Sep 4, 2019 at 1:26 PM Daniel Smith <dpsmith.dev@gmail.com> wrote:
>>
>> On Wed, Sep 4, 2019 at 12:12 PM Juergen Gross <jgross@suse.com> wrote:
>>>
>>> The stubdom gets an event channel to use for dom0 xenbstore connection
>>> via commandline parameter ("--event <event-nr>"). This needs to be used
>>> in the stubdom for setting up the communication path.
>>>
>>>
>>> Juergen
>>
>> Hi Juergen,
>>
>> Thanks for the quick response! tracing through xenstored, looks like
>> that flag sets the variable dom0_event which is only used in the
>> xenstored_minios.c as the return value to the xenbus_evtchn() call. I
>> could naively short circuit xenbus_evtchn() under xenstored_posix.c to
>> return immediately if dom0_event has been set. If that works, I would
>> be glad to submit it back upstream if there is interest in
>> incorporating it.
> 
> Hi again,
> 
> I made the change to short circuit the xenbus_evtchn and did testing
> as a guest domain approach to confirm that i was parsing the
> parameters correctly in initramfs script that init-xenstore-helper
> passed. I am still it hanging after the attempt to write
> /tool/xenstored/domid. At this point I was wondering if there might be
> a way to get console output from the domain to try and troubleshoot if
> xenstored is getting started when actually running as the actual
> stubdom instead of as a guest?

I think you are not mapping dom0 xenbus page. Have a look at
xenbus_map() in xenstored_minios.c. You could do the alternative
handling depending on the --event parameter specified.


Juergen

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-09-09  9:09 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-04 15:45 [Xen-devel] Running xenstored in Linux stubdom Daniel Smith
2019-09-04 16:12 ` Juergen Gross
2019-09-04 17:26   ` Daniel Smith
2019-09-06 18:01     ` Daniel Smith
2019-09-09  9:08       ` Juergen Gross

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).