- 04 2月, 2016 4 次提交
-
-
由 zhanghailiang 提交于
The properties of netfilter object could be changed by 'qom-set' command, but the output of 'info network' command is not updated, because it got the old information through nf->info_str, it will not be updated while we change the value of netfilter's property. Here we split a helper function that could collect the output information for filter, and also remove the useless member 'info_str' from struct NetFilterState. Signed-off-by: Nzhanghailiang <zhang.zhanghailiang@huawei.com> Cc: Jason Wang <jasowang@redhat.com> Cc: Eric Blake <eblake@redhat.com> Cc: Markus Armbruster <armbru@redhat.com> Cc: Yang Hongyang <hongyang.yang@easystack.cn> Reviewed-by: NEric Blake <eblake@redhat.com> Signed-off-by: NJason Wang <jasowang@redhat.com>
-
由 Li Zhijian 提交于
Previously, if we attach more than one filters for a single netdev, both ingress and egress traffic will go through net filters in same order like: ingress: netdev ->filter1 ->filter2 ->...filter[n] ->emulated device egress: emulated device ->filter1 ->filter2 ->...filter[n] ->netdev. This is against the natural feeling and will complicate filters configuration since in some scenes, we hope filters handle the egress traffic in a reverse order. For example, in colo-proxy (will be implemented later), we have a redirector filter and a colo-rewriter filter, we need the filter behave like: ingress(->)/egress(<-): chardev<->redirector<->colo-rewriter<->emulated device Since both buffer filter and dump do not require strict order of filters, this patch switches to always let egress traffic walk through net filters in reverse to simplify the possible filters configuration in the future. Signed-off-by: NWen Congyang <wency@cn.fujitsu.com> Signed-off-by: NLi Zhijian <lizhijian@cn.fujitsu.com> Reviewed-by: NYang Hongyang <hongyang.yang@easystack.cn> Signed-off-by: NJason Wang <jasowang@redhat.com>
-
由 Vincenzo Maffione 提交于
This patch simplifies the netmap backend code by means of the nm_open() helper function provided by netmap_user.h, which hides the details of open(), iotcl() and mmap() carried out on the netmap device. Moreover, the semantic of nm_open() makes it possible to open special netmap ports (e.g. pipes, monitors) and use special modes (e.g. host rings only, single queue mode, exclusive access). Signed-off-by: NVincenzo Maffione <v.maffione@gmail.com> Signed-off-by: NJason Wang <jasowang@redhat.com>
-
由 Thomas Huth 提交于
We don't want to support the legacy -tftp, -bootp, -smb and -net channel options forever. So let's start telling the users that they are deprecated and what option should be used instead. Signed-off-by: NThomas Huth <thuth@redhat.com> Signed-off-by: NJason Wang <jasowang@redhat.com>
-
- 19 1月, 2016 1 次提交
-
-
由 Daniel P. Berrange 提交于
Currently the ObjectProperty iterator API works as follows: ObjectPropertyIterator *iter; iter = object_property_iter_init(obj); while ((prop = object_property_iter_next(iter))) { ... } object_property_iter_free(iter); This has the benefit that the ObjectPropertyIterator struct can be opaque, but has the downside that callers need to explicitly call a free function. It is also not in keeping with iterator style used elsewhere in QEMU/GLib2. This patch changes the API to use stack allocation instead: ObjectPropertyIterator iter; object_property_iter_init(&iter, obj); while ((prop = object_property_iter_next(&iter))) { ... } Reviewed-by: NEric Blake <eblake@redhat.com> Signed-off-by: NDaniel P. Berrange <berrange@redhat.com> Reviewed-by: NMarkus Armbruster <armbru@redhat.com> [AF: Fused ObjectPropertyIterator struct with typedef] Signed-off-by: NAndreas Färber <afaerber@suse.de>
-
- 13 1月, 2016 1 次提交
-
-
由 Markus Armbruster 提交于
Commit 6daf194d, be62a2eb and 312fd5f2 got rid of a bunch, but they keep coming back. Tracked down with the Coccinelle semantic patch from commit 312fd5f2. Cc: Fam Zheng <famz@redhat.com> Cc: Peter Crosthwaite <crosthwaitepeter@gmail.com> Cc: Bharata B Rao <bharata@linux.vnet.ibm.com> Cc: Dominik Dingel <dingel@linux.vnet.ibm.com> Cc: David Hildenbrand <dahi@linux.vnet.ibm.com> Cc: Jason J. Herne <jjherne@linux.vnet.ibm.com> Cc: Stefan Berger <stefanb@linux.vnet.ibm.com> Cc: Dr. David Alan Gilbert <dgilbert@redhat.com> Cc: Changchun Ouyang <changchun.ouyang@intel.com> Cc: zhanghailiang <zhang.zhanghailiang@huawei.com> Cc: Pavel Fedin <p.fedin@samsung.com> Signed-off-by: NMarkus Armbruster <armbru@pond.sub.org> Reviewed-by: NDr. David Alan Gilbert <dgilbert@redhat.com> Acked-by: NCornelia Huck <cornelia.huck@de.ibm.com> Acked-by: NBharata B Rao <bharata@linux.vnet.ibm.com> Acked-by: NFam Zheng <famz@redhat.com> Signed-off-by: NMarkus Armbruster <armbru@redhat.com> Reviewed-by: NEric Blake <eblake@redhat.com> Message-Id: <1450452927-8346-17-git-send-email-armbru@redhat.com>
-
- 11 1月, 2016 4 次提交
-
-
由 Paolo Bonzini 提交于
Ensure that the error is printed with the proper timestamp. Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com> Signed-off-by: NMichael Tokarev <mjt@tls.msk.ru>
-
由 Alexis Dambricourt 提交于
If a 32 bits l2tpv3 frame cookie MSB if set to 1, the cast to uint64_t cookie will spread 1 to the four most significant bytes. Then the condition (cookie != s->rx_cookie) becomes false. Signed-off-by: NAlexis Dambricourt <alexis.dambricourt@gmail.com> Signed-off-by: NJason Wang <jasowang@redhat.com>
-
由 Li Zhijian 提交于
Cc: Jason Wang <jasowang@redhat.com> Cc: qemu-stable@nongnu.org Signed-off-by: NLi Zhijian <lizhijian@cn.fujitsu.com> Signed-off-by: NJason Wang <jasowang@redhat.com>
-
由 Li Zhijian 提交于
Cc: Jason Wang <jasowang@redhat.com> Signed-off-by: NLi Zhijian <lizhijian@cn.fujitsu.com> Cc: qemu-stable@nongnu.org Signed-off-by: NJason Wang <jasowang@redhat.com>
-
- 17 12月, 2015 1 次提交
-
-
由 Eric Blake 提交于
Now that we guarantee the user doesn't have any enum values beginning with a single underscore, we can use that for our own purposes. Renaming ENUM_MAX to ENUM__MAX makes it obvious that the sentinel is generated. This patch was mostly generated by applying a temporary patch: |diff --git a/scripts/qapi.py b/scripts/qapi.py |index e6d014b..b862ec9 100644 |--- a/scripts/qapi.py |+++ b/scripts/qapi.py |@@ -1570,6 +1570,7 @@ const char *const %(c_name)s_lookup[] = { | max_index = c_enum_const(name, 'MAX', prefix) | ret += mcgen(''' | [%(max_index)s] = NULL, |+// %(max_index)s | }; | ''', | max_index=max_index) then running: $ cat qapi-{types,event}.c tests/test-qapi-types.c | sed -n 's,^// \(.*\)MAX,s|\1MAX|\1_MAX|g,p' > list $ git grep -l _MAX | xargs sed -i -f list The only things not generated are the changes in scripts/qapi.py. Rejecting enum members named 'MAX' is now useless, and will be dropped in the next patch. Signed-off-by: NEric Blake <eblake@redhat.com> Message-Id: <1447836791-369-23-git-send-email-eblake@redhat.com> Reviewed-by: NJuan Quintela <quintela@redhat.com> [Rebased to current master, commit message tweaked] Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
-
- 02 12月, 2015 1 次提交
-
-
由 Victor Kaplansky 提交于
Fix QEMU crash when -netdev type=vhost-user,queues=n is passed with zero number of queues. Signed-off-by: NVictor Kaplansky <victork@redhat.com> Reviewed-by: NMichael S. Tsirkin <mst@redhat.com> Signed-off-by: NMichael S. Tsirkin <mst@redhat.com> Acked-by: NJason Wang <jasowang@redhat.com>
-
- 27 11月, 2015 2 次提交
-
-
由 Andrew Baumann 提交于
The code under the TUN_ASYNCHRONOUS_WRITES path makes two incorrect assumptions about the behaviour of the WriteFile API for overlapped file handles. First, WriteFile does not update the lpNumberOfBytesWritten parameter when the write completes asynchronously (the number of bytes written is known only when the operation completes). Second, the buffer shouldn't be touched (or freed) until the operation completes. This led to at least one bug where tap_win32_write returned zero bytes written, which in turn caused further writes ("receives") to be disabled for that device. This change disables the asynchronous write path, while keeping most of the code around in case someone sees value in resurrecting it. It also adds some conditional debug output, similar to the read path. Signed-off-by: NAndrew Baumann <Andrew.Baumann@microsoft.com> Acked-by: NStefan Weil <sw@weilnetz.de> Signed-off-by: NJason Wang <jasowang@redhat.com>
-
由 Andrew Baumann 提交于
In order to find a named tap device, get_device_guid() enumerates children of HKLM\SYSTEM\CCS\Control\Network\{4D36E972-E325-11CE-BFC1-08002BE10318} (aka NETWORK_CONNECTIONS_KEY). For each child, it then looks for a "Connection" subkey, but if this key doesn't exist, it aborts the entire search. This was observed to fail on at least one Windows 10 machine, where there is an additional child of NETWORK_CONNECTIONS_KEY (named "Descriptions"). Since registry enumeration doesn't guarantee any particular sort order, we should continue to search for matching children rather than aborting the search. Signed-off-by: NAndrew Baumann <Andrew.Baumann@microsoft.com> Reviewed-by: NStefan Weil <sw@weilnetz.de> Signed-off-by: NJason Wang <jasowang@redhat.com>
-
- 25 11月, 2015 1 次提交
-
-
由 Wen Congyang 提交于
Signed-off-by: NWen Congyang <wency@cn.fujitsu.com> Reviewed-by: NMichael S. Tsirkin <mst@redhat.com> Signed-off-by: NMichael S. Tsirkin <mst@redhat.com> Reviewed-by: NYuanhan Liu <yuanhan.liu@linux.intel.com>
-
- 19 11月, 2015 1 次提交
-
-
由 Daniel P. Berrange 提交于
Stop directly accessing the Object::properties field data structure and instead use the formal object property iterator APIs. This insulates the code from future data structure changes in the Object struct. Signed-off-by: NDaniel P. Berrange <berrange@redhat.com> Tested-by: NPavel Fedin <p.fedin@samsung.com> Signed-off-by: NAndreas Färber <afaerber@suse.de>
-
- 12 11月, 2015 2 次提交
-
-
由 Vincenzo Maffione 提交于
This update was required to align error reporting of netmap backend initialization to the modifications introduced by commit a30ecde6. Reviewed-by: NEric Blake <eblake@redhat.com> Reviewed-by: NMarkus Armbruster <armbru@redhat.com> Signed-off-by: NVincenzo Maffione <v.maffione@gmail.com> Signed-off-by: NJason Wang <jasowang@redhat.com>
-
由 Vincenzo Maffione 提交于
Reorganization of struct NetClientOptions (commit e4ba22b3) caused a compilation failure of the netmap backend. This patch fixes the issue by properly accessing the union field. Reviewed-by: NEric Blake <eblake@redhat.com> Reviewed-by: NMarkus Armbruster <armbru@redhat.com> Signed-off-by: NVincenzo Maffione <v.maffione@gmail.com> Signed-off-by: NJason Wang <jasowang@redhat.com>
-
- 06 11月, 2015 1 次提交
-
-
由 Ed Maste 提交于
Acked-by: NRoger Pau Monné <roger.pau@citrix.com> Signed-off-by: NEd Maste <emaste@freebsd.org> Signed-off-by: NMichael Tokarev <mjt@tls.msk.ru>
-
- 02 11月, 2015 1 次提交
-
-
由 Eric Blake 提交于
We have two issues with our qapi union layout: 1) Even though the QMP wire format spells the tag 'type', the C code spells it 'kind', requiring some hacks in the generator. 2) The C struct uses an anonymous union, which places all tag values in the same namespace as all non-variant members. This leads to spurious collisions if a tag value matches a non-variant member's name. Make the conversion to the new layout for net-related code. Signed-off-by: NEric Blake <eblake@redhat.com> Message-Id: <1445898903-12082-18-git-send-email-eblake@redhat.com> [Commit message tweaked slightly] Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
-
- 27 10月, 2015 7 次提交
-
-
由 Yang Hongyang 提交于
The value returned from object_get_canonical_path_component must be freed. Signed-off-by: NYang Hongyang <yanghy@cn.fujitsu.com> Cc: Jason Wang <jasowang@redhat.com> Cc: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: NJason Wang <jasowang@redhat.com>
-
由 Yang Hongyang 提交于
We want "buf, sizeof(buf)" here. sizeof(buffer) is the size of a pointer, which is wrong. Thanks to Paolo for pointing it out. Signed-off-by: NYang Hongyang <yanghy@cn.fujitsu.com> Cc: Jason Wang <jasowang@redhat.com> Cc: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: NJason Wang <jasowang@redhat.com>
-
由 Vladislav Yasevich 提交于
When responding to a query-rx-filter command on a multiqueue netdev, qemu reports the data for each queue. The data, however, is not per-queue, but per device and the same data is reported multiple times. This causes confusion and may also cause extra unnecessary processing when looking at the data. Commit 638fb141 (net: Make qmp_query_rx_filter() with name argument more obvious) partially addresses this issue, by limiting the output when the name is specified. However, when the name is not specified, the issue still persists. Signed-off-by: NVladislav Yasevich <vyasevic@redhat.com> Signed-off-by: NJason Wang <jasowang@redhat.com>
-
由 Thomas Huth 提交于
Use the net-filter infrastructure to provide the dumping functions for netdev devices, too. Reviewed-by: NYang Hongyang <yanghy@cn.fujitsu.com> Signed-off-by: NThomas Huth <thuth@redhat.com> Signed-off-by: NJason Wang <jasowang@redhat.com>
-
由 Thomas Huth 提交于
With the upcoming dumping-via-netfilter patch, the DumpState should not be related to NetClientState anymore, so move the related information to a new struct called DumpNetClient. Reviewed-by: NYang Hongyang <yanghy@cn.fujitsu.com> Signed-off-by: NThomas Huth <thuth@redhat.com> Signed-off-by: NJason Wang <jasowang@redhat.com>
-
由 Thomas Huth 提交于
Move the creation of the dump client from net_dump_init() into net_init_dump(), so we can later use the former function for dump via netfilter, too. Also rename net_dump_init() to net_dump_state_init() to make it easier distinguishable from net_init_dump(). Reviewed-by: NYang Hongyang <yanghy@cn.fujitsu.com> Signed-off-by: NThomas Huth <thuth@redhat.com> Signed-off-by: NJason Wang <jasowang@redhat.com>
-
由 Thomas Huth 提交于
Adding a proper receive_iov function to the net dump module. This will make it easier to support the dump filter feature for the -netdev option in later patches. Reviewed-by: NYang Hongyang <yanghy@cn.fujitsu.com> Signed-off-by: NThomas Huth <thuth@redhat.com> Signed-off-by: NJason Wang <jasowang@redhat.com>
-
- 22 10月, 2015 3 次提交
-
-
由 Thibaut Collet 提交于
A new vhost user message is added to allow QEMU to ask to vhost user backend to broadcast a fake RARP after live migration for guest without GUEST_ANNOUNCE capability. This new message is sent only if the backend supports the new VHOST_USER_PROTOCOL_F_RARP protocol feature. The payload of this new message is the MAC address of the guest (not known by the backend). The MAC address is copied in the first 6 bytes of a u64 to avoid to create a new payload message type. This new message has no equivalent ioctl so a new callback is added in the userOps structure to send the request. Upon reception of this new message the vhost user backend must generate and broadcast a fake RARP request to notify the migration is terminated. Signed-off-by: NThibaut Collet <thibaut.collet@6wind.com> [Rebased and fixed checkpatch errors - Marc-André] Signed-off-by: NMarc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: NMichael S. Tsirkin <mst@redhat.com> Signed-off-by: NMichael S. Tsirkin <mst@redhat.com> Tested-by: NThibaut Collet <thibaut.collet@6wind.com>
-
由 Thibaut Collet 提交于
Some vhost user backends are able to support live migration. To provide this service the following features must be added: 1. Add the VIRTIO_NET_F_GUEST_ANNOUNCE capability to vhost-net when netdev backend is vhost-user. 2. Provide a nop receive callback to vhost-user. This callback is called by: * qemu_announce_self after a migration to send fake RARP to avoid network outage for peers talking to the migrated guest. - For guest with GUEST_ANNOUNCE capabilities, guest already sends GARP when the bit VIRTIO_NET_S_ANNOUNCE is set. => These packets must be discarded. - For guest without GUEST_ANNOUNCE capabilities, migration termination is notified when the guest sends packets. => These packets can be discarded. * virtio_net_tx_bh with a dummy boot to send fake bootp/dhcp request. BIOS guest manages virtio driver to send 4 bootp/dhcp request in case of dummy boot. => These packets must be discarded. Signed-off-by: NThibaut Collet <thibaut.collet@6wind.com> Reviewed-by: NMichael S. Tsirkin <mst@redhat.com> Signed-off-by: NMichael S. Tsirkin <mst@redhat.com> Tested-by: NThibaut Collet <thibaut.collet@6wind.com>
-
由 Marc-André Lureau 提交于
Replace error_report() and use tracing instead. It's not an error to get a connection or a disconnection, so silence this and trace it instead. Signed-off-by: NMarc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: NMichael S. Tsirkin <mst@redhat.com> Signed-off-by: NMichael S. Tsirkin <mst@redhat.com> Tested-by: NThibaut Collet <thibaut.collet@6wind.com>
-
- 21 10月, 2015 1 次提交
-
-
由 Michael S. Tsirkin 提交于
commit 5be7d9f1 vhost-net: tell tap backend about the vnet endianness makes vhost net always try to set LE - even if that matches the native endian-ness. This makes it fail on older kernels on x86 without TUNSETVNETLE support. To fix, make qemu_set_vnet_le/qemu_set_vnet_be skip the ioctl if it matches the host endian-ness. Reported-by: NMarcel Apfelbaum <marcel@redhat.com> Cc: Greg Kurz <gkurz@linux.vnet.ibm.com> Cc: qemu-stable@nongnu.org Signed-off-by: NMichael S. Tsirkin <mst@redhat.com> Reviewed-by: NMarcel Apfelbaum <marcel@redhat.com>
-
- 12 10月, 2015 8 次提交
-
-
由 Yang Hongyang 提交于
This filter is to buffer/release packets. Can be used when using MicroCheckpointing or other Remus like VM FT solutions. You can also use it to crudely simulate network delay. Doesn't actually delay individual packets, but batches them together, which is a delay of sorts. Usage: -netdev tap,id=bn0 -object filter-buffer,id=f0,netdev=bn0,queue=rx,interval=1000 NOTE: Interval is in microseconds, it can't be omitted currently, and can't be 0. Signed-off-by: NYang Hongyang <yanghy@cn.fujitsu.com> Reviewed-by: NMarkus Armbruster <armbru@redhat.com> Signed-off-by: NJason Wang <jasowang@redhat.com>
-
由 Yang Hongyang 提交于
This will be used by buffer filter implementation later to queue packets. Signed-off-by: NYang Hongyang <yanghy@cn.fujitsu.com> Reviewed-by: NThomas Huth <thuth@redhat.com> Signed-off-by: NJason Wang <jasowang@redhat.com>
-
由 Yang Hongyang 提交于
When execute "info network", print filter info also. add a info_str member to NetFilterState, store specific filters info. Signed-off-by: NYang Hongyang <yanghy@cn.fujitsu.com> Signed-off-by: NJason Wang <jasowang@redhat.com>
-
由 Yang Hongyang 提交于
add an API qemu_netfilter_pass_to_next() to pass the packet to next filter. Signed-off-by: NYang Hongyang <yanghy@cn.fujitsu.com> Reviewed-by: NThomas Huth <thuth@redhat.com> Signed-off-by: NJason Wang <jasowang@redhat.com>
-
由 Yang Hongyang 提交于
net/queue.c has logic to send/queue/flush packets but a qemu_deliver_packet_iov() call is hardcoded. Abstract this func so that we can use our own deliver function in netfilter. Signed-off-by: NYang Hongyang <yanghy@cn.fujitsu.com> Cc: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: NJason Wang <jasowang@redhat.com>
-
由 Yang Hongyang 提交于
qemu_deliver_packet_iov already have the compat delivery, we can drop qemu_deliver_packet. Signed-off-by: NYang Hongyang <yanghy@cn.fujitsu.com> Signed-off-by: NJason Wang <jasowang@redhat.com>
-
由 Yang Hongyang 提交于
Capture packets that will be sent. Signed-off-by: NYang Hongyang <yanghy@cn.fujitsu.com> Reviewed-by: NThomas Huth <thuth@redhat.com> Signed-off-by: NJason Wang <jasowang@redhat.com>
-
由 Yang Hongyang 提交于
Add a netfilter object based on QOM. A netfilter is attached to a netdev, captures all network packets that pass through the netdev. When we delete the netdev, we also delete the netfilter object attached to it, because if the netdev is removed, the filter which attached to it is useless. Signed-off-by: NYang Hongyang <yanghy@cn.fujitsu.com> Reviewed-by: NMarkus Armbruster <armbru@redhat.com> Signed-off-by: NJason Wang <jasowang@redhat.com>
-
- 25 9月, 2015 1 次提交
-
-
由 Laurent Vivier 提交于
muldiv64() is used to convert nanoseconds to microseconds. x = muldiv64(qemu_clock_get_ns(..), 1000000, get_ticks_per_sec()); As get_ticks_per_sec() is 10^9, it can be replaced by: x = qemu_clock_get_us(..); Signed-off-by: NLaurent Vivier <lvivier@redhat.com> Reviewed-by: NStefan Hajnoczi <stefanha@redhat.com>
-