rte_virtio: use spdk/stdinc.h

Replace POSIX and standard C #includes with the central SPDK stdinc.h
and remove the rte_virtio exclusion from header checking in
scripts/check_format.sh

Change-Id: Ie53d11de7cd9a51c59957e3c500bd8b9b4c4bc5e
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/383003
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
Daniel Verkamp 2017-10-18 10:14:30 -07:00 committed by Jim Harris
parent 94678ad9ee
commit ba90c8876e
10 changed files with 15 additions and 40 deletions

View File

@ -31,11 +31,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <stdint.h>
#include <string.h>
#include <stdio.h>
#include <errno.h>
#include <unistd.h>
#include "spdk/stdinc.h"
#include <linux/virtio_scsi.h>

View File

@ -34,9 +34,7 @@
#ifndef _VIRTIO_DEV_H_
#define _VIRTIO_DEV_H_
#include <stdint.h>
#include <sys/uio.h>
#include <sys/queue.h>
#include "spdk/stdinc.h"
#include <linux/virtio_ring.h>
@ -45,6 +43,7 @@
#include "spdk_internal/log.h"
#include "spdk/likely.h"
#include "spdk/queue.h"
/*
* Per virtio_config.h in Linux.

View File

@ -30,7 +30,8 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <stdint.h>
#include "spdk/stdinc.h"
#include <linux/virtio_scsi.h>

View File

@ -34,7 +34,8 @@
#ifndef _VIRTIO_PCI_H_
#define _VIRTIO_PCI_H_
#include <stdint.h>
#include "spdk/stdinc.h"
#include <linux/virtio_config.h>
#include <linux/virtio_pci.h>

View File

@ -31,12 +31,8 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <stdint.h>
#include <sys/types.h>
#include <unistd.h>
#include <fcntl.h>
#include <sys/types.h>
#include <sys/socket.h>
#include "spdk/stdinc.h"
#include <sys/eventfd.h>
#include <linux/virtio_scsi.h>

View File

@ -34,9 +34,7 @@
#ifndef _VHOST_NET_USER_H
#define _VHOST_NET_USER_H
#include <stdint.h>
#include <linux/types.h>
#include <linux/ioctl.h>
#include "spdk/stdinc.h"
#include "spdk_internal/log.h"

View File

@ -31,14 +31,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <sys/socket.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <fcntl.h>
#include <sys/un.h>
#include <string.h>
#include <errno.h>
#include "spdk/stdinc.h"
#include "vhost.h"
#include "virtio_user_dev.h"

View File

@ -31,17 +31,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <stdint.h>
#include <stdio.h>
#include <fcntl.h>
#include <string.h>
#include <errno.h>
#include <sys/mman.h>
#include <unistd.h>
#include <sys/eventfd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include "spdk/stdinc.h"
#include "vhost.h"
#include "virtio_user_dev.h"

View File

@ -34,9 +34,10 @@
#ifndef _VIRTIO_USER_DEV_H
#define _VIRTIO_USER_DEV_H
#include "spdk/stdinc.h"
#include <linux/virtio_ring.h>
#include <limits.h>
#include "vhost.h"
#include "../virtio_dev.h"

View File

@ -64,7 +64,7 @@ fi
rm -f eofnl.log
echo -n "Checking for POSIX includes..."
git grep -I -i -f scripts/posix.txt -- './*' ':!include/spdk/stdinc.h' ':!lib/vhost/rte_vhost*/**' ':!lib/bdev/virtio/rte_virtio*/**' ':!scripts/posix.txt' > scripts/posix.log || true
git grep -I -i -f scripts/posix.txt -- './*' ':!include/spdk/stdinc.h' ':!lib/vhost/rte_vhost*/**' ':!scripts/posix.txt' > scripts/posix.log || true
if [ -s scripts/posix.log ]; then
echo "POSIX includes detected. Please include spdk/stdinc.h instead."
cat scripts/posix.log