libvirt/src/util/macvtap.h
Stefan Berger e52687e88f macvtap IFF_VNET_HDR configuration
This patch sets or unsets the IFF_VNET_HDR flag depending on what device
is used in the VM. The manipulation of the flag is done in the open
function and is only fatal if the IFF_VNET_HDR flag could not be cleared
although it has to be (or if an ioctl generally fails). In that case the
macvtap tap is closed again and the macvtap interface torn.

* src/qemu/qemu_conf.c src/qemu/qemu_conf.h: pass qemuCmdFlags to
  qemudPhysIfaceConnect()
* src/util/macvtap.c src/util/macvtap.h: add vnet_hdr boolean to
  openMacvtapTap(), and private function configMacvtapTap()
* src/qemu/qemu_driver.c: add extra qemuCmdFlags when calling
  qemudPhysIfaceConnect()
2010-02-19 11:38:57 +01:00

49 lines
1.4 KiB
C

/*
* Copyright (C) 2010 IBM Corporation
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Authors:
* Stefan Berger <stefanb@us.ibm.com>
*/
#ifndef __UTIL_MACVTAP_H__
#define __UTIL_MACVTAP_H__
#include <config.h>
#if defined(WITH_MACVTAP)
#include "internal.h"
int openMacvtapTap(virConnectPtr conn,
const char *ifname,
const unsigned char *macaddress,
const char *linkdev,
int mode,
char **res_ifname,
int vnet_hdr);
void delMacvtap(const char *ifname);
#endif /* WITH_MACVTAP */
#define MACVTAP_MODE_PRIVATE_STR "private"
#define MACVTAP_MODE_VEPA_STR "vepa"
#define MACVTAP_MODE_BRIDGE_STR "bridge"
#endif /* __UTIL_MACVTAP_H__ */