Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com> -- 1.7.10.4
Andrew Cooper
2013-Nov-25 11:06 UTC
[PATCH 1/2] tools/xenconsole: Use xc_domain_getinfo() correctly
Coverity ID: 1055018
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
CC: Ian Campbell <Ian.Campbell@citrix.com>
CC: Ian Jackson <Ian.Jackson@eu.citrix.com>
---
tools/console/client/main.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/tools/console/client/main.c b/tools/console/client/main.c
index 523fc23..38c856a 100644
--- a/tools/console/client/main.c
+++ b/tools/console/client/main.c
@@ -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;
--
1.7.10.4
Coverity ID: 715218 1055876 1055877 Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com> CC: Ian Campbell <Ian.Campbell@citrix.com> CC: Ian Jackson <Ian.Jackson@eu.citrix.com> --- tools/console/daemon/io.c | 2 ++ tools/console/daemon/utils.c | 1 + 2 files changed, 3 insertions(+) diff --git a/tools/console/daemon/io.c b/tools/console/daemon/io.c index 250550a..007ecf4 100644 --- a/tools/console/daemon/io.c +++ b/tools/console/daemon/io.c @@ -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; } } diff --git a/tools/console/daemon/utils.c b/tools/console/daemon/utils.c index aab6f42..71dd185 100644 --- a/tools/console/daemon/utils.c +++ b/tools/console/daemon/utils.c @@ -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) -- 1.7.10.4
Ian Jackson
2013-Nov-25 12:20 UTC
Re: [PATCH 2/2] tools/xenconsoled: Fix file handle leaks
Andrew Cooper writes ("[PATCH 2/2] tools/xenconsoled: Fix file handle
leaks"):> Coverity ID: 715218 1055876 1055877
>
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
> CC: Ian Campbell <Ian.Campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
Also, on the backport list.
Ian.
Ian Jackson
2013-Nov-25 12:21 UTC
Re: [PATCH 1/2] tools/xenconsole: Use xc_domain_getinfo() correctly
Andrew Cooper writes ("[PATCH 1/2] tools/xenconsole: Use
xc_domain_getinfo() correctly"):> Coverity ID: 1055018
>
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
> CC: Ian Campbell <Ian.Campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
Also on the backports list.
Ian.