mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-07-30 21:47:18 +00:00
build: silence recent syntax check violations
An upstream gnulib bug[1] meant that some of our syntax checks weren't being run. Fix up our offenders before we upgrade to a newer gnulib. [1] https://lists.gnu.org/archive/html/bug-gnulib/2012-03/msg00194.html * src/util/virnetdevtap.c (virNetDevTapCreate): Use flags. * tests/lxcxml2xmltest.c (mymain): Strip useless ().
This commit is contained in:
parent
63e086310f
commit
e8aa5a16c9
@ -129,12 +129,14 @@ virNetDevProbeVnetHdr(int tapfd)
|
|||||||
*/
|
*/
|
||||||
int virNetDevTapCreate(char **ifname,
|
int virNetDevTapCreate(char **ifname,
|
||||||
int *tapfd,
|
int *tapfd,
|
||||||
unsigned int flags ATTRIBUTE_UNUSED)
|
unsigned int flags)
|
||||||
{
|
{
|
||||||
int fd;
|
int fd;
|
||||||
struct ifreq ifr;
|
struct ifreq ifr;
|
||||||
int ret = -1;
|
int ret = -1;
|
||||||
|
|
||||||
|
virCheckFlags(VIR_NETDEV_TAP_CREATE_VNET_HDR, -1);
|
||||||
|
|
||||||
if ((fd = open("/dev/net/tun", O_RDWR)) < 0) {
|
if ((fd = open("/dev/net/tun", O_RDWR)) < 0) {
|
||||||
virReportSystemError(errno, "%s",
|
virReportSystemError(errno, "%s",
|
||||||
_("Unable to open /dev/net/tun, is tun module loaded?"));
|
_("Unable to open /dev/net/tun, is tun module loaded?"));
|
||||||
@ -237,8 +239,9 @@ cleanup:
|
|||||||
#else /* ! TUNSETIFF */
|
#else /* ! TUNSETIFF */
|
||||||
int virNetDevTapCreate(char **ifname ATTRIBUTE_UNUSED,
|
int virNetDevTapCreate(char **ifname ATTRIBUTE_UNUSED,
|
||||||
int *tapfd ATTRIBUTE_UNUSED,
|
int *tapfd ATTRIBUTE_UNUSED,
|
||||||
unsigned int flags ATTRIBUTE_UNUSED)
|
unsigned int flags)
|
||||||
{
|
{
|
||||||
|
virCheckFlags(0, -1);
|
||||||
virReportSystemError(ENOSYS, "%s",
|
virReportSystemError(ENOSYS, "%s",
|
||||||
_("Unable to create TAP devices on this platform"));
|
_("Unable to create TAP devices on this platform"));
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -99,7 +99,7 @@ mymain(void)
|
|||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
||||||
if ((caps = testLXCCapsInit()) == NULL)
|
if ((caps = testLXCCapsInit()) == NULL)
|
||||||
return (EXIT_FAILURE);
|
return EXIT_FAILURE;
|
||||||
|
|
||||||
# define DO_TEST_FULL(name, is_different, inactive) \
|
# define DO_TEST_FULL(name, is_different, inactive) \
|
||||||
do { \
|
do { \
|
||||||
@ -124,7 +124,7 @@ mymain(void)
|
|||||||
|
|
||||||
virCapabilitiesFree(caps);
|
virCapabilitiesFree(caps);
|
||||||
|
|
||||||
return (ret==0 ? EXIT_SUCCESS : EXIT_FAILURE);
|
return ret==0 ? EXIT_SUCCESS : EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
VIRT_TEST_MAIN(mymain)
|
VIRT_TEST_MAIN(mymain)
|
||||||
|
Loading…
Reference in New Issue
Block a user