All of lore.kernel.org
 help / color / mirror / Atom feed
* The order of contents saved in "/var/run/xenstored/db" is reversed
@ 2016-04-17 10:28 Sunguodong
  2016-04-17 12:20 ` Wei Liu
  0 siblings, 1 reply; 3+ messages in thread
From: Sunguodong @ 2016-04-17 10:28 UTC (permalink / raw)
  To: xen-devel; +Cc: Fanhenglong

Hi all,

I have a question about oxenstored, please help if someone knows.
Oxenstored saves store information to "/var/run/xenstored/db" when it quits, but the contents is reversed.
For example, 
before restart oxenstored, the output of 'xenstore-ls -f' is:
...
/local/domain/0/memory/target = "8388608"
/local/domain/0/memory/static-max = "4294967292"
/local/domain/0/memory/freemem-slack = "0"
...
after restart oxenstored, the output is:
...
/local/domain/0/memory/freemem-slack = "0"
/local/domain/0/memory/static-max = "4294967292"
/local/domain/0/memory/target = "8388608"
...

I found why when I read the code:
When a new element is added to node list, it is added to the head of the list, so the newest element will always be saved first, and then restored first.

Then question is:
1.What is the reason for this, is this done on purpose?
2.What is the impact of doing so if I save the store information in the original order(first come first saved, and first saved first restored ^_^)?

Looking forward to your reply, thank you!

Regards,
Jason

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

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

* Re: The order of contents saved in "/var/run/xenstored/db" is reversed
  2016-04-17 10:28 The order of contents saved in "/var/run/xenstored/db" is reversed Sunguodong
@ 2016-04-17 12:20 ` Wei Liu
  2016-04-18  7:35   ` Sunguodong
  0 siblings, 1 reply; 3+ messages in thread
From: Wei Liu @ 2016-04-17 12:20 UTC (permalink / raw)
  To: Sunguodong; +Cc: Fanhenglong, Wei Liu, xen-devel

On Sun, Apr 17, 2016 at 10:28:24AM +0000, Sunguodong wrote:
> Hi all,
> 
> I have a question about oxenstored, please help if someone knows.
> Oxenstored saves store information to "/var/run/xenstored/db" when it quits, but the contents is reversed.
> For example, 
> before restart oxenstored, the output of 'xenstore-ls -f' is:
> ...
> /local/domain/0/memory/target = "8388608"
> /local/domain/0/memory/static-max = "4294967292"
> /local/domain/0/memory/freemem-slack = "0"
> ...
> after restart oxenstored, the output is:
> ...
> /local/domain/0/memory/freemem-slack = "0"
> /local/domain/0/memory/static-max = "4294967292"
> /local/domain/0/memory/target = "8388608"
> ...
> 
> I found why when I read the code:
> When a new element is added to node list, it is added to the head of the list, so the newest element will always be saved first, and then restored first.
> 
> Then question is:
> 1.What is the reason for this, is this done on purpose?
> 2.What is the impact of doing so if I save the store information in the original order(first come first saved, and first saved first restored ^_^)?
> 

Why do you care much about what order they appear in the output? I don't
think the tools should make assumption on the order they appear and the
order doesn't matter.

In any case, if you need to have consistent view:

 xenstore-ls -f | sort

Wei.


> Looking forward to your reply, thank you!
> 
> Regards,
> Jason
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

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

* Re: The order of contents saved in "/var/run/xenstored/db" is reversed
  2016-04-17 12:20 ` Wei Liu
@ 2016-04-18  7:35   ` Sunguodong
  0 siblings, 0 replies; 3+ messages in thread
From: Sunguodong @ 2016-04-18  7:35 UTC (permalink / raw)
  To: Wei Liu; +Cc: Fanhenglong, xen-devel



> -----Original Message-----
> From: Wei Liu [mailto:wei.liu2@citrix.com]
> Sent: Sunday, April 17, 2016 8:21 PM
> To: Sunguodong
> Cc: xen-devel@lists.xen.org; Fanhenglong; Wei Liu
> Subject: Re: [Xen-devel] The order of contents saved in
> "/var/run/xenstored/db" is reversed
> 
> On Sun, Apr 17, 2016 at 10:28:24AM +0000, Sunguodong wrote:
> > Hi all,
> >
> > I have a question about oxenstored, please help if someone knows.
> > Oxenstored saves store information to "/var/run/xenstored/db" when it
> quits, but the contents is reversed.
> > For example,
> > before restart oxenstored, the output of 'xenstore-ls -f' is:
> > ...
> > /local/domain/0/memory/target = "8388608"
> > /local/domain/0/memory/static-max = "4294967292"
> > /local/domain/0/memory/freemem-slack = "0"
> > ...
> > after restart oxenstored, the output is:
> > ...
> > /local/domain/0/memory/freemem-slack = "0"
> > /local/domain/0/memory/static-max = "4294967292"
> > /local/domain/0/memory/target = "8388608"
> > ...
> >
> > I found why when I read the code:
> > When a new element is added to node list, it is added to the head of
> the list, so the newest element will always be saved first, and then
> restored first.
> >
> > Then question is:
> > 1.What is the reason for this, is this done on purpose?
> > 2.What is the impact of doing so if I save the store information in
> the original order(first come first saved, and first saved first
> restored ^_^)?
> >
> 
> Why do you care much about what order they appear in the output? I
I was debugging it, and just confused about that. I was thinking if there
are any features relied on the order and affected when oxenstored restored
in reverse order. 

> don't
> think the tools should make assumption on the order they appear and the
> order doesn't matter.
OK, I get it, thank you.

> 
> In any case, if you need to have consistent view:
> 
>  xenstore-ls -f | sort
> 
> Wei.
> 
> 
> > Looking forward to your reply, thank you!
> >
> > Regards,
> > Jason
> >
> > _______________________________________________
> > Xen-devel mailing list
> > Xen-devel@lists.xen.org
> > http://lists.xen.org/xen-devel
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

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

end of thread, other threads:[~2016-04-18  7:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-17 10:28 The order of contents saved in "/var/run/xenstored/db" is reversed Sunguodong
2016-04-17 12:20 ` Wei Liu
2016-04-18  7:35   ` Sunguodong

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.