Coverity fixes for xenconsole
cover Coverity fixes for xenconsole
Signed-off-by Andrew Cooper <[email protected]>
Signature · 1 line
1.7.10.4
PATCH 1/2 tools/xenconsole: Use xc_domain_getinfo() correctly
Coverity ID: 1055018
Signed-off-by Andrew Cooper <[email protected]>
CC Ian Campbell <[email protected]>
CC Ian Jackson <[email protected]>
--- tools/console/client/main.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
tools/console/client/main.c +5 -1
@@ -339,7 +339,11 @@ int main(int argc, char **argv)xc_interface *xc_handle =xc_interface_open (0 ,0 ,0 );if (xc_handle ==NULL )err (errno,"Could not open xc interface" ); -xc_domain_getinfo (xc_handle, domid,1 , &xcinfo); +if ( (xc_domain_getinfo (xc_handle, domid,1 , &xcinfo) !=1 ) || + (xcinfo.domid != domid) ) { +xc_interface_close (xc_handle); +err (errno,"Failed to get domain information" ); + }/* default to pv console for pv guests and serial for hvm guests */ if (xcinfo.hvm) type =CONSOLE_SERIAL ;
Signature · 1 line
1.7.10.4
Re: [PATCH 1/2] tools/xenconsole: Use xc_domain_getinfo() correctly
Andrew Cooper writes ("[PATCH 1/2] tools/xenconsole: Use xc_domain_getinfo() correctly"):
Quoted 4 lines
Coverity ID: 1055018
Signed-off-by Andrew Cooper <[email protected]>CC Ian Campbell <[email protected]>
Acked-by Ian Jackson <[email protected]>
Committed-by Ian Jackson <[email protected]>
Also on the backports list.
Ian.
PATCH 2/2 tools/xenconsoled: Fix file handle leaks
In reply to Andrew CooperCoverity ID: 715218 1055876 1055877
Signed-off-by Andrew Cooper <[email protected]>
CC Ian Campbell <[email protected]>
CC Ian Jackson <[email protected]>
--- tools/console/daemon/io.c | 2 ++ tools/console/daemon/utils.c | 1 + 2 files changed, 3 insertions(+)
tools/console/daemon/io.c +2 -0
@@ -278,6 +278,7 @@ static int create_hv_log(void)dolog (LOG_ERR ,"Failed to log opening timestamp " "in %s: %d (%s)" , logfile, errno,strerror (errno)); +close (fd);return -1 ; } }
@@ -323,6 +324,7 @@ static int create_domain_log(struct domain *dom)dolog (LOG_ERR ,"Failed to log opening timestamp " "in %s: %d (%s)" , logfile, errno,strerror (errno)); +close (fd);return -1 ; } }
tools/console/daemon/utils.c +1 -0
@@ -104,6 +104,7 @@ void daemonize(const char *pidfile)signal (SIGTSTP ,SIG_IGN );signal (SIGTTOU ,SIG_IGN );signal (SIGTTIN ,SIG_IGN ); +close (fd); }bool xen_setup (void )
Signature · 1 line
1.7.10.4
Re: [PATCH 2/2] tools/xenconsoled: Fix file handle leaks
Andrew Cooper writes ("[PATCH 2/2] tools/xenconsoled: Fix file handle leaks"):
Quoted 4 lines
Coverity ID: 715218 1055876 1055877
Signed-off-by Andrew Cooper <[email protected]>CC Ian Campbell <[email protected]>
Acked-by Ian Jackson <[email protected]>
Committed-by Ian Jackson <[email protected]>
Also, on the backport list.
Ian.