1. 25 9月, 2018 1 次提交
    • T
      net: Deprecate the "name" parameter of -net · 101625a4
      Thomas Huth 提交于
      In early times, network backends were specified by a "vlan" and "name"
      tuple. With the introduction of netdevs, the "name" was replaced by an
      "id" (which is supposed to be unique), but the "name" parameter stayed
      as an alias which could be used instead of "id". Unfortunately, we miss
      the duplication check for "name":
      
       $ qemu-system-x86_64 -net user,name=n1 -net user,name=n1
      
      ... starts without an error, while "id" correctly complains:
      
       $ qemu-system-x86_64 -net user,id=n1 -net user,id=n1
       qemu-system-x86_64: -net user,id=n1: Duplicate ID 'n1' for net
      
      Instead of trying to fix the code for the legacy "name" parameter, let's
      rather get rid of this old interface and deprecate the "name" parameter
      now - this will also be less confusing for the users in the long run.
      Reviewed-by: NPhilippe Mathieu-Daudé <f4bug@amsat.org>
      Reviewed-by: NMarkus Armbruster <armbru@redhat.com>
      Signed-off-by: NThomas Huth <thuth@redhat.com>
      101625a4
  2. 31 8月, 2018 1 次提交
  3. 20 7月, 2018 1 次提交
  4. 15 6月, 2018 3 次提交
  5. 12 6月, 2018 1 次提交
    • M
      object: fix OBJ_PROP_LINK_UNREF_ON_RELEASE ambivalence · 265b578c
      Marc-André Lureau 提交于
      A link property can be set during creation, with
      object_property_add_link() and later with object_property_set_link().
      
      add_link() doesn't add a reference to the target object, while
      set_link() does.
      
      Furthemore, OBJ_PROP_LINK_UNREF_ON_RELEASE flags, set during add_link,
      says whether a reference must be released when the property is destroyed.
      This can lead to leaks if the property was later set_link(), as the
      added reference is never released.
      
      Instead, rename OBJ_PROP_LINK_UNREF_ON_RELEASE to OBJ_PROP_LINK_STRONG
      and use that has an indication on how the link handle reference
      management in set_link().
      Signed-off-by: NMarc-André Lureau <marcandre.lureau@redhat.com>
      Message-id: 20180531195119.22021-3-marcandre.lureau@redhat.com
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      265b578c
  6. 02 6月, 2018 1 次提交
  7. 01 6月, 2018 2 次提交
  8. 25 5月, 2018 1 次提交
  9. 23 5月, 2018 1 次提交
  10. 14 5月, 2018 3 次提交
  11. 26 3月, 2018 2 次提交
  12. 05 3月, 2018 7 次提交
  13. 03 3月, 2018 2 次提交
  14. 01 3月, 2018 1 次提交
  15. 13 2月, 2018 2 次提交
  16. 09 2月, 2018 5 次提交
  17. 29 1月, 2018 4 次提交
    • T
      net: Allow netdevs to be used with 'hostfwd_add' and 'hostfwd_remove' · 93653066
      Thomas Huth 提交于
      It does not make much sense to limit these commands to the legacy 'vlan'
      concept only, they should work with the modern netdevs, too. So now
      it is possible to use this command with one, two or three parameters.
      
      With one parameter, the command installs a hostfwd rule on the default
      "user" network:
          hostfwd_add tcp:...
      
      With two parameters, the command installs a hostfwd rule on a netdev
      (that's the new way of using this command):
          hostfwd_add netdev_id tcp:...
      
      With three parameters, the command installs a rule on a 'vlan' (aka hub):
          hostfwd_add hub_id name tcp:...
      
      Same applies to the hostfwd_remove command now.
      Signed-off-by: NThomas Huth <thuth@redhat.com>
      Signed-off-by: NJason Wang <jasowang@redhat.com>
      93653066
    • T
      net: Allow hubports to connect to other netdevs · 18d65d22
      Thomas Huth 提交于
      QEMU can emulate hubs to connect NICs and netdevs. This is currently
      primarily used for the mis-named 'vlan' feature of the networking
      subsystem. Now the 'vlan' feature has been marked as deprecated, since
      its name is rather confusing and the users often rather mis-configure
      their network when trying to use it. But while the 'vlan' parameter
      should be removed at one point in time, the basic idea of emulating
      a hub in QEMU is still good: It's useful for bundling up the output of
      multiple NICs into one single l2tp netdev for example.
      
      Now to be able to use the hubport feature without 'vlan's, there is one
      missing piece: The possibility to connect a hubport to a netdev, too.
      This patch adds this possibility by introducing a new "netdev=..."
      parameter to the hubports.
      
      To bundle up the output of multiple NICs into one socket netdev, you can
      now run QEMU with these parameters for example:
      
      qemu-system-ppc64 ... -netdev socket,id=s1,connect=:11122 \
          -netdev hubport,hubid=1,id=h1,netdev=s1 \
          -netdev hubport,hubid=1,id=h2 -device e1000,netdev=h2 \
          -netdev hubport,hubid=1,id=h3 -device virtio-net-pci,netdev=h3
      
      For using the socket netdev, you have got to start another QEMU as the
      receiving side first, for example with network dumping enabled:
      
      qemu-system-x86_64 -M isapc -netdev socket,id=s0,listen=:11122 \
          -device ne2k_isa,netdev=s0 \
          -object filter-dump,id=f1,netdev=s0,file=/tmp/dump.dat
      
      After the ppc64 guest tried to boot from both NICs, you can see in the
      dump file (using Wireshark, for example), that the output of both NICs
      (the e1000 and the virtio-net-pci) has been successfully transfered
      via the socket netdev in this case.
      Suggested-by: NPaolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: NThomas Huth <thuth@redhat.com>
      Signed-off-by: NJason Wang <jasowang@redhat.com>
      18d65d22
    • M
      colo: compare the packet based on the tcp sequence number · f449c9e5
      Mao Zhongyi 提交于
      Packet size some time different or when network is busy.
      Based on same payload size, but TCP protocol can not
      guarantee send the same one packet in the same way,
      
      like that:
      We send this payload:
      ------------------------------
      | header |1|2|3|4|5|6|7|8|9|0|
      ------------------------------
      
      primary:
      ppkt1:
      ----------------
      | header |1|2|3|
      ----------------
      ppkt2:
      ------------------------
      | header |4|5|6|7|8|9|0|
      ------------------------
      
      secondary:
      spkt1:
      ------------------------------
      | header |1|2|3|4|5|6|7|8|9|0|
      ------------------------------
      
      In the original method, ppkt1 and ppkt2 are different in size and
      spkt1, so they can't compare and trigger the checkpoint.
      
      I have tested FTP get 200M and 1G file many times, I found that
      the performance was less than 1% of the native.
      
      Now I reconstructed the comparison of TCP packets based on the
      TCP sequence number. first of all, ppkt1 and spkt1 have the same
      starting sequence number, so they can compare, even though their
      length is different. And then ppkt1 with a smaller payload length
      is used as the comparison length, if the payload is same, send
      out the ppkt1 and record the offset(the length of ppkt1 payload)
      in spkt1. The next comparison, ppkt2 and spkt1 can be compared
      from the recorded position of spkt1.
      
      like that:
      ----------------
      | header |1|2|3| ppkt1
      ---------|-----|
               |     |
      ---------v-----v--------------
      | header |1|2|3|4|5|6|7|8|9|0| spkt1
      ---------------|\------------|
                     | \offset     |
            ---------v-------------v
            | header |4|5|6|7|8|9|0| ppkt2
            ------------------------
      
      In this way, the performance can reach native 20% in my multiple
      tests.
      
      Cc: Zhang Chen <zhangckid@gmail.com>
      Cc: Li Zhijian <lizhijian@cn.fujitsu.com>
      Cc: Jason Wang <jasowang@redhat.com>
      Signed-off-by: NMao Zhongyi <maozy.fnst@cn.fujitsu.com>
      Signed-off-by: NLi Zhijian <lizhijian@cn.fujitsu.com>
      Signed-off-by: NZhang Chen <zhangckid@gmail.com>
      Reviewed-by: NZhang Chen <zhangckid@gmail.com>
      Tested-by: NZhang Chen <zhangckid@gmail.com>
      Signed-off-by: NJason Wang <jasowang@redhat.com>
      f449c9e5
    • M
      colo: modified the payload compare function · 9394133f
      Mao Zhongyi 提交于
      Modified the function colo_packet_compare_common to prepare for the
      tcp packet comparison in the next patch.
      
      Cc: Zhang Chen <zhangckid@gmail.com>
      Cc: Li Zhijian <lizhijian@cn.fujitsu.com>
      Cc: Jason Wang <jasowang@redhat.com>
      Signed-off-by: NMao Zhongyi <maozy.fnst@cn.fujitsu.com>
      Signed-off-by: NLi Zhijian <lizhijian@cn.fujitsu.com>
      Signed-off-by: NZhang Chen <zhangckid@gmail.com>
      Reviewed-by: NZhang Chen <zhangckid@gmail.com>
      Signed-off-by: NJason Wang <jasowang@redhat.com>
      9394133f
  18. 22 12月, 2017 2 次提交