diff options
author | Mohsin Kazmi <sykazmi@cisco.com> | 2019-01-21 15:19:39 +0000 |
---|---|---|
committer | Damjan Marion <dmarion@me.com> | 2019-01-23 11:04:20 +0000 |
commit | 33cc5cfd04093d2da781cd3591d0da905873f865 (patch) | |
tree | 904bc4b0624cb394151cb1f41dfc3779f6a6e81e /src/vnet/devices/virtio/pci.h | |
parent | 71ad6a9bf02d00e51b0959c33edc1b10dc857353 (diff) |
virtio: Add support for logging
Change-Id: Ieadf0a97379ed8b17241e454895c4e5e195dc52f
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
Diffstat (limited to 'src/vnet/devices/virtio/pci.h')
-rw-r--r-- | src/vnet/devices/virtio/pci.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/vnet/devices/virtio/pci.h b/src/vnet/devices/virtio/pci.h index 7552dd89ac2..b08e40e7e61 100644 --- a/src/vnet/devices/virtio/pci.h +++ b/src/vnet/devices/virtio/pci.h @@ -120,6 +120,27 @@ typedef enum #define VIRTIO_PCI_VRING_ALIGN 4096 +#define virtio_log_debug(vim, vif, f, ...) \ +{ \ + vlib_log(VLIB_LOG_LEVEL_DEBUG, vim->log_default, "%U: " f, \ + format_vlib_pci_addr, &vif->pci_addr, \ + ##__VA_ARGS__); \ +}; + +#define virtio_log_warning(vim, vif, f, ...) \ +{ \ + vlib_log(VLIB_LOG_LEVEL_WARNING, vim->log_default, "%U: " f, \ + format_vlib_pci_addr, &vif->pci_addr, \ + ##__VA_ARGS__); \ +}; + +#define virtio_log_error(vim, vif, f, ...) \ +{ \ + vlib_log(VLIB_LOG_LEVEL_ERR, vim->log_default, "%U: " f, \ + format_vlib_pci_addr, &vif->pci_addr, \ + ##__VA_ARGS__); \ +}; + typedef enum { VIRTIO_MSIX_NONE = 0, |