qemu-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-commits] [qemu/qemu] 57407e: net: remove all cleanup methods from


From: GitHub
Subject: [Qemu-commits] [qemu/qemu] 57407e: net: remove all cleanup methods from NIC NetClient...
Date: Mon, 12 Jan 2015 04:30:08 -0800

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: 57407ea44cc0a3d630b9b89a2be011f1955ce5c1
      
https://github.com/qemu/qemu/commit/57407ea44cc0a3d630b9b89a2be011f1955ce5c1
  Author: Paolo Bonzini <address@hidden>
  Date:   2015-01-12 (Mon, 12 Jan 2015)

  Changed paths:
    M hw/net/allwinner_emac.c
    M hw/net/cadence_gem.c
    M hw/net/dp8393x.c
    M hw/net/e1000.c
    M hw/net/eepro100.c
    M hw/net/etraxfs_eth.c
    M hw/net/fsl_etsec/etsec.c
    M hw/net/lan9118.c
    M hw/net/lance.c
    M hw/net/mcf_fec.c
    M hw/net/milkymist-minimac2.c
    M hw/net/mipsnet.c
    M hw/net/ne2000-isa.c
    M hw/net/ne2000.c
    M hw/net/opencores_eth.c
    M hw/net/pcnet-pci.c
    M hw/net/pcnet.c
    M hw/net/pcnet.h
    M hw/net/rtl8139.c
    M hw/net/smc91c111.c
    M hw/net/spapr_llan.c
    M hw/net/stellaris_enet.c
    M hw/net/virtio-net.c
    M hw/net/vmxnet3.c
    M hw/net/xgmac.c
    M hw/net/xilinx_axienet.c
    M hw/net/xilinx_ethlite.c

  Log Message:
  -----------
  net: remove all cleanup methods from NIC NetClientInfos

All NICs have a cleanup function that, in most cases, zeroes the pointer
to the NICState.  In some cases, it frees data belonging to the NIC.

However, this function is never called except when exiting from QEMU.
It is not necessary to NULL pointers and free data here; the right place
to do that would be in the device's unrealize function, after calling
qemu_del_nic.  Zeroing the NIC multiple times is also wrong for multiqueue
devices.

This cleanup function gets in the way of making the NetClientStates for
the NIC hold an object_ref reference to the object, so get rid of it.

Signed-off-by: Paolo Bonzini <address@hidden>
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: b4f72e31b924bec2c18fe0b2a8c6462dbed9dcb2
      
https://github.com/qemu/qemu/commit/b4f72e31b924bec2c18fe0b2a8c6462dbed9dcb2
  Author: Chen Gang <address@hidden>
  Date:   2015-01-12 (Mon, 12 Jan 2015)

  Changed paths:
    M hw/net/xen_nic.c

  Log Message:
  -----------
  hw/net/xen_nic.c: Free 'netdev->txs' when map 'netdev->rxs' fails

When map 'netdev->rxs' fails, need free the original resource, or will
cause resource leak.

Signed-off-by: Chen Gang <address@hidden>
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: d46858377b822b820946c6b2e3a9153ee0aebd37
      
https://github.com/qemu/qemu/commit/d46858377b822b820946c6b2e3a9153ee0aebd37
  Author: Chen Gang <address@hidden>
  Date:   2015-01-12 (Mon, 12 Jan 2015)

  Changed paths:
    M hw/net/xen_nic.c

  Log Message:
  -----------
  hw/net/xen_nic.c: Need free 'netdev->nic' in net_free() instead of 
net_disconnect()

net_init() and net_free() are pairs, net_connect() and net_disconnect()
are pairs. net_init() creates 'netdev->nic', so also need free it in
net_free().

Signed-off-by: Chen Gang <address@hidden>
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: a39d97c7becca5fd679d70d17ae5b1d62b9b5da6
      
https://github.com/qemu/qemu/commit/a39d97c7becca5fd679d70d17ae5b1d62b9b5da6
  Author: Chen Gang <address@hidden>
  Date:   2015-01-12 (Mon, 12 Jan 2015)

  Changed paths:
    M hw/net/xen_nic.c

  Log Message:
  -----------
  hw/net/xen_nic.c: Set 'netdev->mac' to NULL after free it

Since net_init() checks whether 'netdev->mac' is NULL, before alloc it;
net_release() also need set 'netdev->mac' to NULL after free it.

Signed-off-by: Chen Gang <address@hidden>
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: 7d5ad15d17f26dd4f9ff5f3491828bc34e74f28c
      
https://github.com/qemu/qemu/commit/7d5ad15d17f26dd4f9ff5f3491828bc34e74f28c
  Author: Peter Maydell <address@hidden>
  Date:   2015-01-12 (Mon, 12 Jan 2015)

  Changed paths:
    M hw/net/allwinner_emac.c
    M hw/net/cadence_gem.c
    M hw/net/dp8393x.c
    M hw/net/e1000.c
    M hw/net/eepro100.c
    M hw/net/etraxfs_eth.c
    M hw/net/fsl_etsec/etsec.c
    M hw/net/lan9118.c
    M hw/net/lance.c
    M hw/net/mcf_fec.c
    M hw/net/milkymist-minimac2.c
    M hw/net/mipsnet.c
    M hw/net/ne2000-isa.c
    M hw/net/ne2000.c
    M hw/net/opencores_eth.c
    M hw/net/pcnet-pci.c
    M hw/net/pcnet.c
    M hw/net/pcnet.h
    M hw/net/rtl8139.c
    M hw/net/smc91c111.c
    M hw/net/spapr_llan.c
    M hw/net/stellaris_enet.c
    M hw/net/virtio-net.c
    M hw/net/vmxnet3.c
    M hw/net/xen_nic.c
    M hw/net/xgmac.c
    M hw/net/xilinx_axienet.c
    M hw/net/xilinx_ethlite.c

  Log Message:
  -----------
  Merge remote-tracking branch 'remotes/stefanha/tags/net-pull-request' into 
staging

# gpg: Signature made Mon 12 Jan 2015 10:27:41 GMT using RSA key ID 81AB73C8
# gpg: Good signature from "Stefan Hajnoczi <address@hidden>"
# gpg:                 aka "Stefan Hajnoczi <address@hidden>"

* remotes/stefanha/tags/net-pull-request:
  hw/net/xen_nic.c: Set 'netdev->mac' to NULL after free it
  hw/net/xen_nic.c: Need free 'netdev->nic' in net_free() instead of 
net_disconnect()
  hw/net/xen_nic.c: Free 'netdev->txs' when map 'netdev->rxs' fails
  net: remove all cleanup methods from NIC NetClientInfos

Signed-off-by: Peter Maydell <address@hidden>


Compare: https://github.com/qemu/qemu/compare/5435f1d77eb4...7d5ad15d17f2

reply via email to

[Prev in Thread] Current Thread [Next in Thread]