On 22.01.2015 20:47, [email protected] wrote:
> From: Tony Krowiak <[email protected]>
>
> This patch enables synchronization of the host macvtap
> device options with the guest device's in response to the
> NIC_RX_FILTER_CHANGED event.
>
> The following device options will be synchronized:
> * PROMISC
> * MULTICAST
> * ALLMULTI
>
> Signed-off-by: Tony Krowiak <[email protected]>
> ---
> No changes for v3
> src/qemu/qemu_driver.c | 92
> ++++++++++++++++++++++++++++++++++++++++++++++++
> 1 files changed, 92 insertions(+), 0 deletions(-)
>
> diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
> index bc6aae4..47c1b5e 100644
> --- a/src/qemu/qemu_driver.c
> +++ b/src/qemu/qemu_driver.c
> @@ -4168,6 +4168,93 @@ syncNicRxFilterHostMulticast(char *ifname,
> virNetDevRxFilterPtr guestFilter,
>
>
> static void
> +syncNicRxFilterPromiscMode(char *ifname, virNetDevRxFilterPtr guestFilter,
> + virNetDevRxFilterPtr hostFilter)
Indentation's off.
> +{
> + bool promisc;
> + bool setpromisc = false;
> +
> + /* Set macvtap promisc mode to true if the guest has vlans defined */
> + /* or synchronize the macvtap promisc mode if different from guest */
> + if (guestFilter->vlan.nTable > 0) {
> + if (!hostFilter->promiscuous) {
> + setpromisc = true;
> + promisc = true;
> + }
> + } else if (hostFilter->promiscuous != guestFilter->promiscuous) {
> + setpromisc = true;
> + promisc = guestFilter->promiscuous;
> + }
> +
> + if (setpromisc) {
> + if (virNetDevSetPromiscuous(ifname, promisc) < 0) {
> + VIR_WARN("Couldn't set PROMISC flag to %s for device %s "
> + "while responding to NIC_RX_FILTER_CHANGED",
> + promisc ? "true" : "false", ifname);
> + }
> + }
> +}
> +
ACK with that fixed.
Michal
--
libvir-list mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/libvir-list