aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJohn Levon <john.levon@nutanix.com>2020-12-02 11:38:52 +0000
committerGitHub <noreply@github.com>2020-12-02 11:38:52 +0000
commit3e647c0d3b3506b8160b37748108ba3fbd7cb632 (patch)
tree939e1afeef3d5cb05942a8400a5eff716a7979a9 /lib
parentddf444e8da02e0c8796944e2484cd0ca91a0105d (diff)
downloadlibvfio-user-3e647c0d3b3506b8160b37748108ba3fbd7cb632.zip
libvfio-user-3e647c0d3b3506b8160b37748108ba3fbd7cb632.tar.gz
libvfio-user-3e647c0d3b3506b8160b37748108ba3fbd7cb632.tar.bz2
rename VFU_REG_FLAG_* (#145)
We renamed other code to be "REGION" instead of "REG" so it's less ambiguous. Do the same for VFU_REG_FLAG_*. Signed-off-by: John Levon <john.levon@nutanix.com> Reviewed-by: Swapnil Ingle <swapnil.ingle@nutanix.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/libvfio-user.c8
-rw-r--r--lib/pci.c2
-rw-r--r--lib/private.h4
-rw-r--r--lib/python_bindings.c4
4 files changed, 9 insertions, 9 deletions
diff --git a/lib/libvfio-user.c b/lib/libvfio-user.c
index 45e5472..25b8e12 100644
--- a/lib/libvfio-user.c
+++ b/lib/libvfio-user.c
@@ -1104,7 +1104,7 @@ prepare_ctx(vfu_ctx_t *vfu_ctx)
// Set a default config region if none provided.
/* TODO should it be enough to check that the size of region is 0? */
if (memcmp(cfg_reg, &zero_reg, sizeof(*cfg_reg)) == 0) {
- cfg_reg->flags = VFU_REG_FLAG_RW;
+ cfg_reg->flags = VFU_REGION_FLAG_RW;
cfg_reg->size = PCI_CFG_SPACE_SIZE;
}
@@ -1118,7 +1118,7 @@ prepare_ctx(vfu_ctx_t *vfu_ctx)
// Set type for region registers.
for (i = 0; i < PCI_BARS_NR; i++) {
- if (!(vfu_ctx->reg_info[i].flags & VFU_REG_FLAG_MEM)) {
+ if (!(vfu_ctx->reg_info[i].flags & VFU_REGION_FLAG_MEM)) {
vfu_ctx->pci_config_space->hdr.bars[i].io.region_type |= 0x1;
}
}
@@ -1481,7 +1481,7 @@ vfu_setup_region(vfu_ctx_t *vfu_ctx, int region_idx, size_t size,
case VFU_PCI_DEV_BAR0_REGION_IDX ... VFU_PCI_DEV_VGA_REGION_IDX:
// Validate the config region provided.
if (region_idx == VFU_PCI_DEV_CFG_REGION_IDX &&
- flags != VFU_REG_FLAG_RW) {
+ flags != VFU_REGION_FLAG_RW) {
return ERROR(EINVAL);
}
@@ -1583,7 +1583,7 @@ vfu_setup_device_migration(vfu_ctx_t *vfu_ctx, vfu_migration_t *migration)
return ERROR(-ret);
}
- migr_reg->flags = VFU_REG_FLAG_RW;
+ migr_reg->flags = VFU_REGION_FLAG_RW;
migr_reg->size = sizeof(struct vfio_device_migration_info) + migration->size;
vfu_ctx->migration = init_migration(migration, &ret);
diff --git a/lib/pci.c b/lib/pci.c
index b4cffb1..105e31a 100644
--- a/lib/pci.c
+++ b/lib/pci.c
@@ -68,7 +68,7 @@ vfu_pci_hdr_write_bar(vfu_ctx_t *vfu_ctx, uint16_t bar_index, const char *buf)
cfg_addr = ~(reg_info[bar_index].size) + 1;
}
- if ((reg_info[bar_index].flags & VFU_REG_FLAG_MEM)) {
+ if ((reg_info[bar_index].flags & VFU_REGION_FLAG_MEM)) {
mask = PCI_BASE_ADDRESS_MEM_MASK;
} else {
mask = PCI_BASE_ADDRESS_IO_MASK;
diff --git a/lib/private.h b/lib/private.h
index dfe8b85..0c4878c 100644
--- a/lib/private.h
+++ b/lib/private.h
@@ -75,7 +75,7 @@ struct vfu_sparse_mmap_areas {
typedef struct {
/*
- * Region flags, see VFU_REG_FLAG_XXX above.
+ * Region flags, see VFU_REGION_FLAG_READ and friends.
*/
uint32_t flags;
@@ -93,7 +93,7 @@ typedef struct {
/*
* Callback function that is called when the region is memory mapped.
- * Required if VFU_REG_FLAG_MEM is set, otherwise ignored.
+ * Required if VFU_REGION_FLAG_MEM is set, otherwise ignored.
*/
vfu_map_region_cb_t *map;
struct vfu_sparse_mmap_areas *mmap_areas; /* sparse mmap areas */
diff --git a/lib/python_bindings.c b/lib/python_bindings.c
index a1d6212..90304ee 100644
--- a/lib/python_bindings.c
+++ b/lib/python_bindings.c
@@ -195,9 +195,9 @@ libvfio_user_run(PyObject *self, PyObject *args, PyObject *kwargs)
if (_ri[i].perm != NULL) {
for (j = 0; j < strlen(_ri[i].perm); j++) {
if (_ri[i].perm[j] == 'r') {
- flags |= VFU_REG_FLAG_READ;
+ flags |= VFU_REGION_FLAG_READ;
} else if (_ri[i].perm[j] == 'w') {
- flags |= VFU_REG_FLAG_WRITE;
+ flags |= VFU_REGION_FLAG_WRITE;
} else {
/* FIXME shouldn't print to stderr */
fprintf(stderr, "bad permission '%c'\n", _ri[i].perm[j]);