Andrew Cooper
2013-Mar-13 12:52 UTC
[PATCH 2 of 5 v4] tools/libxc: Helper function for XEN_SYSCTL_consoleringsize
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com> --- Changes since v2: * Tweak style and errno in case of invalid pointer. diff -r 89f3c6846f6b -r 0bd32c19873e tools/libxc/xc_misc.c --- a/tools/libxc/xc_misc.c +++ b/tools/libxc/xc_misc.c @@ -100,6 +100,26 @@ int xc_readconsolering(xc_interface *xch return ret; } +int xc_consoleringsize(xc_interface *xch, uint64_t *psize) +{ + int ret = -1; + DECLARE_SYSCTL; + + if ( !psize ) + { + errno = EINVAL; + return ret; + } + + sysctl.cmd = XEN_SYSCTL_consoleringsize; + ret = do_sysctl(xch, &sysctl); + + if ( !ret ) + *psize = sysctl.u.consoleringsize.size; + + return ret; +} + int xc_send_debug_keys(xc_interface *xch, char *keys) { int ret, len = strlen(keys); diff -r 89f3c6846f6b -r 0bd32c19873e tools/libxc/xenctrl.h --- a/tools/libxc/xenctrl.h +++ b/tools/libxc/xenctrl.h @@ -998,6 +998,7 @@ int xc_readconsolering(xc_interface *xch char *buffer, unsigned int *pnr_chars, int clear, int incremental, uint32_t *pindex); +int xc_consoleringsize(xc_interface *xch, uint64_t *psize); int xc_send_debug_keys(xc_interface *xch, char *keys);
Andrew Cooper
2013-Apr-05 14:47 UTC
Re: [PATCH 2 of 5 v4] tools/libxc: Helper function for XEN_SYSCTL_consoleringsize
On 13/03/13 12:52, Andrew Cooper wrote:> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>Keir/Jan: Ping? This is a hypervisor change.> > --- > Changes since v2: > * Tweak style and errno in case of invalid pointer. > > diff -r 89f3c6846f6b -r 0bd32c19873e tools/libxc/xc_misc.c > --- a/tools/libxc/xc_misc.c > +++ b/tools/libxc/xc_misc.c > @@ -100,6 +100,26 @@ int xc_readconsolering(xc_interface *xch > return ret; > } > > +int xc_consoleringsize(xc_interface *xch, uint64_t *psize) > +{ > + int ret = -1; > + DECLARE_SYSCTL; > + > + if ( !psize ) > + { > + errno = EINVAL; > + return ret; > + } > + > + sysctl.cmd = XEN_SYSCTL_consoleringsize; > + ret = do_sysctl(xch, &sysctl); > + > + if ( !ret ) > + *psize = sysctl.u.consoleringsize.size; > + > + return ret; > +} > + > int xc_send_debug_keys(xc_interface *xch, char *keys) > { > int ret, len = strlen(keys); > diff -r 89f3c6846f6b -r 0bd32c19873e tools/libxc/xenctrl.h > --- a/tools/libxc/xenctrl.h > +++ b/tools/libxc/xenctrl.h > @@ -998,6 +998,7 @@ int xc_readconsolering(xc_interface *xch > char *buffer, > unsigned int *pnr_chars, > int clear, int incremental, uint32_t *pindex); > +int xc_consoleringsize(xc_interface *xch, uint64_t *psize); > > int xc_send_debug_keys(xc_interface *xch, char *keys); > > > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xen.org > http://lists.xen.org/xen-devel
Andrew Cooper
2013-Apr-05 14:50 UTC
Re: [PATCH 2 of 5 v4] tools/libxc: Helper function for XEN_SYSCTL_consoleringsize
On 05/04/13 15:47, Andrew Cooper wrote:> On 13/03/13 12:52, Andrew Cooper wrote: >> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com> > Keir/Jan: Ping? This is a hypervisor change.Apologies - this is actually a tools change. Ian/Ian?> >> --- >> Changes since v2: >> * Tweak style and errno in case of invalid pointer. >> >> diff -r 89f3c6846f6b -r 0bd32c19873e tools/libxc/xc_misc.c >> --- a/tools/libxc/xc_misc.c >> +++ b/tools/libxc/xc_misc.c >> @@ -100,6 +100,26 @@ int xc_readconsolering(xc_interface *xch >> return ret; >> } >> >> +int xc_consoleringsize(xc_interface *xch, uint64_t *psize) >> +{ >> + int ret = -1; >> + DECLARE_SYSCTL; >> + >> + if ( !psize ) >> + { >> + errno = EINVAL; >> + return ret; >> + } >> + >> + sysctl.cmd = XEN_SYSCTL_consoleringsize; >> + ret = do_sysctl(xch, &sysctl); >> + >> + if ( !ret ) >> + *psize = sysctl.u.consoleringsize.size; >> + >> + return ret; >> +} >> + >> int xc_send_debug_keys(xc_interface *xch, char *keys) >> { >> int ret, len = strlen(keys); >> diff -r 89f3c6846f6b -r 0bd32c19873e tools/libxc/xenctrl.h >> --- a/tools/libxc/xenctrl.h >> +++ b/tools/libxc/xenctrl.h >> @@ -998,6 +998,7 @@ int xc_readconsolering(xc_interface *xch >> char *buffer, >> unsigned int *pnr_chars, >> int clear, int incremental, uint32_t *pindex); >> +int xc_consoleringsize(xc_interface *xch, uint64_t *psize); >> >> int xc_send_debug_keys(xc_interface *xch, char *keys); >> >> >> _______________________________________________ >> 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
Ian Campbell
2013-Apr-11 13:18 UTC
Re: [PATCH 2 of 5 v4] tools/libxc: Helper function for XEN_SYSCTL_consoleringsize
On Fri, 2013-04-05 at 15:50 +0100, Andrew Cooper wrote:> On 05/04/13 15:47, Andrew Cooper wrote: > > On 13/03/13 12:52, Andrew Cooper wrote: > >> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com> > > Keir/Jan: Ping? This is a hypervisor change. > > Apologies - this is actually a tools change. Ian/Ian?Acked-by: Ian Campbell <ian.campbell@citrix.com>