Skip to content

Commit

Permalink
tools: Use new xc function for some xc_domain_getinfo() calls
Browse files Browse the repository at this point in the history
Move calls that require a information about a single precisely identified
domain to the new xc_domain_getinfo_single().

Signed-off-by: Alejandro Vallejo <alejandro.vallejo@cloud.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Anthony PERARD <anthony.perard@citrix.com>
(cherry picked from commit 3b5201e8cf87dbea558331edcf6f3236ede56980 in xen.git)
  • Loading branch information
Alejandro Vallejo authored and marmarek committed Aug 19, 2024
1 parent 02498f1 commit 8b663d8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions helpers/vchan-socket-proxy.c
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ static struct libxenvchan *connect_vchan(int domid, const char *path) {
struct libxenvchan *ctrl = NULL;
struct xs_handle *xs = NULL;
xc_interface *xc = NULL;
xc_dominfo_t dominfo;
xc_domaininfo_t dominfo;
char **watch_ret;
unsigned int watch_num;
int ret;
Expand Down Expand Up @@ -259,12 +259,12 @@ static struct libxenvchan *connect_vchan(int domid, const char *path) {
if (ctrl)
break;

ret = xc_domain_getinfo(xc, domid, 1, &dominfo);
ret = xc_domain_getinfo_single(xc, domid, &dominfo);
/* break the loop if domain is definitely not there anymore, but
* continue if it is or the call failed (like EPERM) */
if (ret == -1 && errno == ESRCH)
break;
if (ret == 1 && (dominfo.domid != (uint32_t)domid || dominfo.dying))
if (ret == 0 && (dominfo.flags & XEN_DOMINF_dying))
break;
}

Expand Down

0 comments on commit 8b663d8

Please sign in to comment.