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>
This commit is contained in:
Andrew Cooper authored and Ian Jackson committed 2013-11-25 12:18:05 +00:00
1 parent f55f10a27c
commit aa344500a3
1 file changed
+5 -1
+5 -1
View File
@@ -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;
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.