Comments (5)
Currently we require the the user to specify a log function. Typically the user will implement a log function that writes to a file. This can be useful for redirecting log messages to a single place that contains messages for a particular VM from other processes. However, logging to a file can block because the file system might be busy. I propose to allow the current behavior (assuming that the user knows what they're doing), but discourage it by providing a default implementaton for the log function that is automatically used if the user doesn't provide one. This function should log using syslog(3) and the log message should be prefixed with some ID provided by the user (this can be the socket path or some new string the user provides when lm_ctx
is creared). We can also drop our custom LM_ERR/INF/DBG
defines and switch to the ones provided from syslog(3).
from libvfio-user.
I'm not really clear why writing to disk is a problem: we shouldn't be generating logs in the fast path anyway (except for when debug's enabled, in which case it doesn't matter). As you say syslog is a pain for separating things out.
Either way we can use syslog's defines though.
from libvfio-user.
You're right in that we generally shouldn't be generating logs, however, if we run into some problem where the guest constantly sends requests that fail, we'll be logging. If this happens then we'll end up logging to the disk, and this can block. I've learned this the hard way.
from libvfio-user.
We can't let an untrusted client create arbitrary amounts of logging anyway (we might want an explicit function for that, not sure). But I take your point.
How about we default to stdout/stderr - this can actually be the right choice in many circumstances. We'll provide a way to use syslog instead, or the user can specify their own logger too as you mention.
from libvfio-user.
Logging to stdout/stderr by default sounds the sensible thing to do.
from libvfio-user.
Related Issues (20)
- libvfio-user responds with duplicated FD in get_region_info when sparse maps is used HOT 2
- implement test to demonstrate performance benefit of shadow ioeventfd
- implement new capabilities
- mmap_len in dma_map_region may be incorrect
- nvmf_subsystem_add_listener return error when CONFIG_ARM64_64K_PAGES=y HOT 3
- QEMU crash when execute device_add and device_del alternately HOT 2
- test/unit-tests.c GCC13 compilation error, dangling-pointer HOT 5
- Add support for emulating CXL devices HOT 3
- CI workflow doesn't use flake8 version 5.0.4
- spec: not clear whether VFIO_USER_DMA_WRITE should track dirty pages
- nvmf_vfio_user_prop_req_rsp: failed to map Admin queue HOT 13
- Unclear qemu version recommendation HOT 1
- Avoid bit fields in protocol message definitions HOT 7
- arch linux CI workflow fails HOT 11
- clean up msg->out.iov in error cases
- consider generating graphs for migration transitions HOT 2
- initial migration state not specified HOT 2
- support for vIOMMU with mmap() HOT 7
- irqs_disable() possible out-of-boundary table access. HOT 2
- stale references to migration regions
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from libvfio-user.