aboutsummaryrefslogtreecommitdiff
path: root/lib
AgeCommit message (Collapse)AuthorFilesLines
2019-11-08Integrate with Travis CIv0.1Felipe Franciosi1-0/+1
This adds a simple .travis.yml file for integration with Travis CI. It tries to build muser.git on a Ubuntu Bionic environment using the Linux kernel 5.2.21. Signed-off-by: Felipe Franciosi <felipe@nutanix.com>
2019-11-07enable -Wall, -Wextra, and -Werror and fix all warningsThanos Makatos9-47/+57
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2019-11-06muser, libmuser: Do not abuse muser_cmd.mmap.response to return errSwapnil Ingle1-12/+3
muser_cmd.mmap.response is unsigned and should not be used to return errors, instead use muser_cmd.err Also fixed the code path to use valid errno values. Signed-off-by: Swapnil Ingle <swapnil.ingle@nutanix.com>
2019-11-04muser.h: remove unused variable struct muser_cmd_rw.bufSwapnil Ingle1-14/+14
Signed-off-by: Swapnil Ingle <swapnil.ingle@nutanix.com>
2019-11-04Merge pull request #2 from franciozzy/cleanupFelipe Franciosi18-214/+355
Cleanup
2019-11-04Hide ERR/REQ IRQs from clientsFelipe Franciosi2-9/+4
Users of libmuser do not need to know about ERR/REQ IRQs. We can later plumb the correct support to fire REQ IRQs (for graceful removal of devices) via a dedicated method (if ever needed). Similarly we should offer a method to raise an ERR IRQ accordingly. Signed-off-by: Felipe Franciosi <felipe@nutanix.com>
2019-11-04Remove incorrect guards on dump_buffer()Felipe Franciosi1-2/+0
The dump_buffer() method has internal guards, causing the function to be optimised out (within a compilation unit) if DEBUG is not set. The guards around the function export are not needed. Signed-off-by: Felipe Franciosi <felipe@nutanix.com>
2019-11-04Standardise function signaturesFelipe Franciosi10-150/+173
This makes all function signatures consistent, using a line break after the return type. It also review the usage of const across the project and fixes some other minor alignment issues. Signed-off-by: Felipe Franciosi <felipe@nutanix.com>
2019-11-02libmuser: grammar fix for lm_irq_trigger() doc commentsStefan Hajnoczi1-2/+2
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2019-11-02libmuser: fix 'hanlded' typoStefan Hajnoczi1-1/+1
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2019-11-02Fix shell script shebangFelipe Franciosi1-1/+1
It wasn't on the right place... Signed-off-by: Felipe Franciosi <felipe@nutanix.com>
2019-11-02Fix various guard issuesFelipe Franciosi8-4/+27
Some guards were missing, others were misaligned. Signed-off-by: Felipe Franciosi <felipe@nutanix.com>
2019-11-02Add missing headersFelipe Franciosi3-0/+96
Several files were missing license headers. Signed-off-by: Felipe Franciosi <felipe@nutanix.com>
2019-11-02Fix various format issuesFelipe Franciosi10-52/+58
Remove various spurious whitespaces and empty lines. Some other alignment issues, too. Signed-off-by: Felipe Franciosi <felipe@nutanix.com>
2019-10-03libmuser: check pointers following coding styleFelipe Franciosi1-7/+7
Coding style says pointers should be explicitly checked.
2019-10-03Minor alignment fixesFelipe Franciosi1-5/+9
2019-10-03libmuser: add default noop_cb for config regionFelipe Franciosi1-1/+8
This got broken at some point and we missed it. If a device doesn't add capabilities then reading from the config region returns short and fails. Signed-off-by: Felipe Franciosi <felipe@nutanix.com>
2019-09-27merge FIXME commentsThanos Makatos1-2/+0
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2019-09-27update comment regading using local variableThanos Makatos1-1/+1
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2019-09-27use local variable for clarityThanos Makatos1-6/+6
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2019-09-27fix typosThanos Makatos2-3/+4
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2019-09-27clarify usage of lm_irq_triggerThanos Makatos1-2/+5
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2019-09-27don't omit number of bytes read from the standard PCI header when returning ↵Thanos Makatos1-17/+22
total number of bytes read Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2019-09-27don't fail reads for capabilities that do not existThanos Makatos1-1/+1
Previously we failed reads for capabilities that do not exist, that is any read in region 0x40 and 0x100. It is s perfectly legitimate to read that part of the PCI config space even if there's nothing there, we just return zeros. Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2019-09-27don't trigger INTx IRQ if it's disabledThanos Makatos1-0/+15
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2019-09-27print offset of bad access to capabilities using hexThanos Makatos1-1/+1
All other prints for offset use hex, so let's make it consistent. Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2019-09-27make debug logging more configurableThanos Makatos3-0/+20
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2019-09-27add more debug messages when handling interruptsThanos Makatos1-0/+21
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2019-09-27add MSI-X capability headerThanos Makatos1-0/+70
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2019-09-27add some function documentationThanos Makatos2-0/+14
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2019-09-27fix order of MSI capability id and nextThanos Makatos1-1/+1
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2019-09-27add FIXME commentThanos Makatos1-0/+4
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2019-09-20remove unnecessary initialization of global pointerThanos Makatos1-1/+1
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2019-09-20stylistic correctionsThanos Makatos1-5/+4
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2019-09-20remove unused includeThanos Makatos1-1/+0
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2019-09-20remove unnecessary space around double #Thanos Makatos1-1/+1
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2019-09-20fix coding style violation rergarding curly bracketThanos Makatos1-34/+17
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2019-09-20don't unnecessarily initialize global variables to 0Thanos Makatos1-2/+2
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2019-09-20fix header orderThanos Makatos1-1/+2
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2019-09-20add license headerThanos Makatos1-0/+29
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2019-09-20add license header to files related to Python bindingsThanos Makatos2-0/+61
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2019-09-20experimental support for Python bindings plus sampleThanos Makatos4-0/+265
This patch introduces experimental support for Python bindings, plus the GPIO sample in Python. There are many issues with extending Python (from module stuff to error handling), the most important one is the inability to modify the buf argument to the region access callbacks when a region is read from. For now I've resorted to returning the value since in libmuser we limit accesses to 8 bytes (maybe we should consider that for the C API as well?). Also, the fact that we don't pass the region being accessed as an argument to a region access callback results in clunky code (see the REGION_WRAP macro). Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2019-09-05Minor style fixesFelipe Franciosi3-23/+23
2019-09-05Clarifications around mucmd_mmapFelipe Franciosi1-44/+34
2019-09-05remove unnecessary loop for retrieving regionThanos Makatos4-27/+24
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2019-09-05destory context in lm_ctx_runThanos Makatos1-3/+7
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2019-09-05don't hardcode default PCI config space sizeThanos Makatos1-1/+1
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2019-09-05fix typoThanos Makatos1-1/+1
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2019-09-05don't hardcode region shiftThanos Makatos1-1/+3
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2019-09-05use default values for PCI config region if none specifiedThanos Makatos1-0/+12
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>