Skip to contentSkip to conversation

tools/xl: Add 'xen_version' to `xl info`

PATCH Applied Andrew Cooper 4 participants 8 messages Jul 10, 2013 – Jul 12, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tools/xl: Add 'xen_version' to `xl info`

Getting the full Xen version in an easily scriptable way is awkward, especially if trying to piece together from xen_{major,minor,extra}.

This reflects $(XEN_FULLVERSION) in the build system (but under a more sensible name, as $(XEN_VERSION) is just the major number).

---
 tools/libxl/xl_cmdimpl.c |    2 ++
 1 file changed, 2 insertions(+)
tools/libxl/xl_cmdimpl.c +2 -0
index 8a478ba..d365f90 100644
@@ -4582,6 +4582,8 @@ static void output_xeninfo(void)
     printf("xen_major              : %d\n", info->xen_version_major);
     printf("xen_minor              : %d\n", info->xen_version_minor);
     printf("xen_extra              : %s\n", info->xen_version_extra);
+    printf("xen_version            : %d.%d%s\n", info->xen_version_major,
+           info->xen_version_minor, info->xen_version_extra);
     printf("xen_caps               : %s\n", info->capabilities);
     printf("xen_scheduler          : %s\n", libxl_scheduler_to_string(sched));
     printf("xen_pagesize           : %u\n", info->pagesize);
Signature · 1 line
1.7.10.4
Acked-by on v1 1/1
#1 lore raw
Quoted 7 lines · Andrew Cooper

Getting the full Xen version in an easily scriptable way is awkward, especially if trying to piece together from xen_{major,minor,extra}.

This reflects $(XEN_FULLVERSION) in the build system (but under a more sensible name, as $(XEN_VERSION) is just the major number).

Quoted 17 lines
---
 tools/libxl/xl_cmdimpl.c |    2 ++
 1 file changed, 2 insertions(+)
tools/libxl/xl_cmdimpl.c +2 -0
index 8a478ba..d365f90 100644
@@ -4582,6 +4582,8 @@ static void output_xeninfo(void)
     printf("xen_major              : %d\n", info->xen_version_major);
     printf("xen_minor              : %d\n", info->xen_version_minor);
     printf("xen_extra              : %s\n", info->xen_version_extra);
+    printf("xen_version            : %d.%d%s\n", info->xen_version_major,
+           info->xen_version_minor, info->xen_version_extra);
     printf("xen_caps               : %s\n", info->capabilities);
     printf("xen_scheduler          : %s\n", libxl_scheduler_to_string(sched));
     printf("xen_pagesize           : %u\n", info->pagesize);
#2 lore raw
In reply to Andrew Cooper
Quoted 7 lines · Andrew Cooper

Getting the full Xen version in an easily scriptable way is awkward, especially if trying to piece together from xen_{major,minor,extra}.

This reflects $(XEN_FULLVERSION) in the build system (but under a more sensible name, as $(XEN_VERSION) is just the major number).

I can see the point, but it seems a bit redundant to have the version info printed twice.

This makes me wonder if it might make sense to have options to print just individual items; e.g.:

xl info --xen_version

or perhaps

xi info --format="%{xen_version}"

or something.

-George

#3 lore raw
Quoted 17 lines · George Dunlap
Quoted 7 lines · Andrew Cooper

Getting the full Xen version in an easily scriptable way is awkward, especially if trying to piece together from xen_{major,minor,extra}.

This reflects $(XEN_FULLVERSION) in the build system (but under a more sensible name, as $(XEN_VERSION) is just the major number).

I can see the point, but it seems a bit redundant to have the version info printed twice.

This makes me wonder if it might make sense to have options to print just individual items; e.g.:

xl info --xen_version

Quoted 7 lines

or perhaps

xi info --format="%{xen_version}"

or something.

-George

Ah - that was part 2 which I am working on in my copious free time.

At the moment, xl info takes no parameters, or an -h or -n.

I was thinking it could be modifed to optionally take a positional paramater, such as

xl info xen_version

Even with this however, my original point still stands. Getting the version number is awkward.

~Andrew

#4 lore raw
Quoted 29 lines · Andrew Cooper
Quoted 17 lines · George Dunlap
Quoted 7 lines · Andrew Cooper

Getting the full Xen version in an easily scriptable way is awkward, especially if trying to piece together from xen_{major,minor,extra}.

This reflects $(XEN_FULLVERSION) in the build system (but under a more sensible name, as $(XEN_VERSION) is just the major number).

I can see the point, but it seems a bit redundant to have the version info printed twice.

This makes me wonder if it might make sense to have options to print just individual items; e.g.:

xl info --xen_version

Quoted 7 lines

or perhaps

xi info --format="%{xen_version}"

or something.

-George

Ah - that was part 2 which I am working on in my copious free time.

At the moment, xl info takes no parameters, or an -h or -n.

Quoted 7 lines

I was thinking it could be modifed to optionally take a positional paramater, such as

xl info xen_version

Even with this however, my original point still stands. Getting the version number is awkward.

Is there actually a reason to print it separately at all? Why not replace the individual lines with the unified line?

-George

#5 lore raw
Quoted 35 lines · George Dunlap
Quoted 34 lines · Andrew Cooper
Quoted 17 lines · George Dunlap
Quoted 7 lines · Andrew Cooper

Getting the full Xen version in an easily scriptable way is awkward, especially if trying to piece together from xen_{major,minor,extra}.

This reflects $(XEN_FULLVERSION) in the build system (but under a more sensible name, as $(XEN_VERSION) is just the major number).

I can see the point, but it seems a bit redundant to have the version info printed twice.

This makes me wonder if it might make sense to have options to print just individual items; e.g.:

xl info --xen_version

Quoted 7 lines

or perhaps

xi info --format="%{xen_version}"

or something.

-George

Ah - that was part 2 which I am working on in my copious free time.

At the moment, xl info takes no parameters, or an -h or -n.

I was thinking it could be modifed to optionally take a positional paramater, such as

xl info xen_version

Quoted 8 lines
Quoted 2 lines

Even with this however, my original point still stands. Getting the version number is awkward.

Is there actually a reason to print it separately at all? Why not replace the individual lines with the unified line?

-George

So as not to break anyone currently relying on xl info | grep ^xen_major | cut -d ':' -f 2 and friend

~Andrew

#6 lore raw
In reply to George Dunlap
Quoted 1 line · George Dunlap

On 11/07/13 10:10, Andrew Cooper wrote:

[...]

Quoted 6 lines
Quoted 3 lines

Even with this however, my original point still stands. Getting the version number is awkward.

Is there actually a reason to print it separately at all? Why not replace the individual lines with the unified line?

Please don't do that. I'm sure that there are scripts out there that stitch together the parts into a version string. They'll break if we remove the parts.

--msw

Applied
#7 lore raw

Re: [PATCH] tools/xl: Add 'xen_version' to `xl info` [and 3 more messages]

In reply to Andrew Cooper

Andrew Cooper writes ("[PATCH] tools/xl: Add 'xen_version' to xl info"):

Quoted 5 lines

Getting the full Xen version in an easily scriptable way is awkward, especially if trying to piece together from xen_{major,minor,extra}.

This reflects $(XEN_FULLVERSION) in the build system (but under a more sensible name, as $(XEN_VERSION) is just the major number).

Applied, thanks.

Matt Wilson writes ("Re: [Xen-devel] [PATCH] tools/xl: Add 'xen_version' to xl info"):

Quoted 7 lines · George Dunlap
Quoted 2 lines

Is there actually a reason to print it separately at all? Why not replace the individual lines with the unified line?

Please don't do that. I'm sure that there are scripts out there that stitch together the parts into a version string. They'll break if we remove the parts.

Quite.

Thanks,
Ian.