libxl/xl: rename id to unique-id in vdispl xen store

In the display protocol connector's id is named as unique-id. This patch renames
it in the libxl/xl code and uses XENDISPL_FIELD... definitions from the protocol
header.

Signed-off-by: Oleksandr Grytsov <oleksandr_grytsov@epam.com>
Acked-by: Wei Liu <wei.liu2@citrix.com>
This commit is contained in:
Oleksandr Grytsov authored and Wei Liu committed 2018-07-10 08:46:10 +01:00
1 parent 68f59d897d
commit d00370447c
5 files changed
+22 -20

No files matched your search

+1 -1
View File
@@ -1288,7 +1288,7 @@ Specifies virtual connectors for the device in following format
=item C<id>
String connector ID. Space, comma symbols are not allowed.
String connector unique id. Space, comma symbols are not allowed.
=item C<W>
+2 -2
View File
@@ -809,7 +809,7 @@ libxl_device_channel = Struct("device_channel", [
])
libxl_connector_param = Struct("connector_param", [
("id", string),
("unique_id", string),
("width", uint32),
("height", uint32)
])
@@ -935,7 +935,7 @@ libxl_physinfo = Struct("physinfo", [
], dir=DIR_OUT)
libxl_connectorinfo = Struct("connectorinfo", [
("id", string),
("unique_id", string),
("width", uint32),
("height", uint32),
("req_evtch", integer),
+17 -15
View File
@@ -14,6 +14,8 @@
#include "libxl_internal.h"
#include <xen/io/displif.h>
static int libxl__device_vdispl_setdefault(libxl__gc *gc, uint32_t domid,
libxl_device_vdispl *vdispl,
bool hotplug)
@@ -66,15 +68,15 @@ static int libxl__set_xenstore_vdispl(libxl__gc *gc, uint32_t domid,
{
int i;
flexarray_append_pair(ro_front, "be-alloc",
flexarray_append_pair(ro_front, XENDISPL_FIELD_BE_ALLOC,
GCSPRINTF("%d", vdispl->be_alloc));
for (i = 0; i < vdispl->num_connectors; i++) {
flexarray_append_pair(ro_front, GCSPRINTF("%d/resolution", i),
GCSPRINTF("%dx%d", vdispl->connectors[i].width,
flexarray_append_pair(ro_front, GCSPRINTF("%d/"XENDISPL_FIELD_RESOLUTION, i),
GCSPRINTF("%d"XENDISPL_RESOLUTION_SEPARATOR"%d", vdispl->connectors[i].width,
vdispl->connectors[i].height));
flexarray_append_pair(ro_front, GCSPRINTF("%d/id", i),
vdispl->connectors[i].id);
flexarray_append_pair(ro_front, GCSPRINTF("%d/"XENDISPL_FIELD_UNIQUE_ID, i),
vdispl->connectors[i].unique_id);
}
return 0;
@@ -106,15 +108,15 @@ static int libxl__device_vdispl_getconnectors(libxl_ctx *ctx,
char *value;
char *value_path;
value_path = GCSPRINTF("%s/%d/id", path, i);
info->connectors[i].id = xs_read(ctx->xsh, XBT_NULL, value_path, NULL);
if (info->connectors[i].id == NULL) { rc = ERROR_FAIL; goto out; }
value_path = GCSPRINTF("%s/%d/"XENDISPL_FIELD_UNIQUE_ID, path, i);
info->connectors[i].unique_id = xs_read(ctx->xsh, XBT_NULL, value_path, NULL);
if (info->connectors[i].unique_id == NULL) { rc = ERROR_FAIL; goto out; }
value_path = GCSPRINTF("%s/%d/resolution", path, i);
value_path = GCSPRINTF("%s/%d/"XENDISPL_FIELD_RESOLUTION, path, i);
value = xs_read(ctx->xsh, XBT_NULL, value_path, NULL);
if (value == NULL) { rc = ERROR_FAIL; goto out; }
rc = sscanf(value, "%ux%u", &info->connectors[i].width,
rc = sscanf(value, "%u"XENDISPL_RESOLUTION_SEPARATOR"%u", &info->connectors[i].width,
&info->connectors[i].height);
free(value);
@@ -122,22 +124,22 @@ static int libxl__device_vdispl_getconnectors(libxl_ctx *ctx,
rc = ERROR_FAIL; goto out;
}
value_path = GCSPRINTF("%s/%d/req-ring-ref", path, i);
value_path = GCSPRINTF("%s/%d/"XENDISPL_FIELD_REQ_RING_REF, path, i);
value = xs_read(ctx->xsh, XBT_NULL, value_path, NULL);
info->connectors[i].req_rref = value ? strtoul(value, NULL, 10) : -1;
free(value);
value_path = GCSPRINTF("%s/%d/req-event-channel", path, i);
value_path = GCSPRINTF("%s/%d/"XENDISPL_FIELD_REQ_CHANNEL, path, i);
value = xs_read(ctx->xsh, XBT_NULL, value_path, NULL);
info->connectors[i].req_evtch = value ? strtoul(value, NULL, 10) : -1;
free(value);
value_path = GCSPRINTF("%s/%d/evt-ring-ref", path, i);
value_path = GCSPRINTF("%s/%d/"XENDISPL_FIELD_EVT_RING_REF, path, i);
value = xs_read(ctx->xsh, XBT_NULL, value_path, NULL);
info->connectors[i].evt_rref = value ? strtoul(value, NULL, 10) : -1;
free(value);
value_path = GCSPRINTF("%s/%d/evt-event-channel", path, i);
value_path = GCSPRINTF("%s/%d/"XENDISPL_FIELD_EVT_CHANNEL, path, i);
value = xs_read(ctx->xsh, XBT_NULL, value_path, NULL);
info->connectors[i].evt_evtch = value ? strtoul(value, NULL, 10) : -1;
free(value);
@@ -182,7 +184,7 @@ int libxl_device_vdispl_getinfo(libxl_ctx *ctx, uint32_t domid,
NULL);
info->frontend_id = domid;
val = libxl__xs_read(gc, XBT_NULL, GCSPRINTF("%s/be-alloc", devpath));
val = libxl__xs_read(gc, XBT_NULL, GCSPRINTF("%s/"XENDISPL_FIELD_BE_ALLOC, devpath));
info->be_alloc = val ? strtoul(val, NULL, 10) : 0;
rc = libxl__device_vdispl_getconnectors(ctx, devpath, info);
+1 -1
View File
@@ -827,7 +827,7 @@ int parse_vdispl_config(libxl_device_vdispl *vdispl, char *token)
char *resolution;
rc = split_string_into_pair(connectors[i], ":",
&vdispl->connectors[i].id,
&vdispl->connectors[i].unique_id,
&resolution);
rc= sscanf(resolution, "%ux%u", &vdispl->connectors[i].width,
+1 -1
View File
@@ -104,7 +104,7 @@ int main_vdispllist(int argc, char **argv)
printf("\tConnector: %d, id: %s, width: %d, height: %d, "
"req-rref: %d, req-evtch: %d, "
"evt-rref: %d, evt-evtch: %d\n",
j, vdisplinfo.connectors[j].id,
j, vdisplinfo.connectors[j].unique_id,
vdisplinfo.connectors[j].width,
vdisplinfo.connectors[j].height,
vdisplinfo.connectors[j].req_rref,
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.