[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen stable-4.2] tools/xenconsole: Use xc_domain_getinfo() correctly



commit e30bd829a533241d639719f38712e433117adaa7
Author:     Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
AuthorDate: Mon Nov 25 11:06:38 2013 +0000
Commit:     Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
CommitDate: Thu Jan 9 12:35:31 2014 +0000

    tools/xenconsole: Use xc_domain_getinfo() correctly
    
    Coverity ID: 1055018
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
    CC: Ian Campbell <Ian.Campbell@xxxxxxxxxx>
    Acked-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
    (cherry picked from commit aa344500a3bfceb3ef01931609ac1cfaf6dcf52d)
    (cherry picked from commit 74cd17f84649012bec7ce484bf7b9c3f3a9e79ae)
---
 tools/console/client/main.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

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;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.