1. 04 2月, 2016 4 次提交
  2. 19 1月, 2016 1 次提交
    • D
      qom: Change object property iterator API contract · 7746abd8
      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>
      7746abd8
  3. 13 1月, 2016 1 次提交
  4. 11 1月, 2016 4 次提交
  5. 17 12月, 2015 1 次提交
    • E
      qapi: Don't let implicit enum MAX member collide · 7fb1cf16
      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>
      7fb1cf16
  6. 02 12月, 2015 1 次提交
  7. 27 11月, 2015 2 次提交
    • A
      tap-win32: disable broken async write path · b73c1849
      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>
      b73c1849
    • A
      tap-win32: skip unexpected nodes during registry enumeration · ee0428e3
      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>
      ee0428e3
  8. 25 11月, 2015 1 次提交
  9. 19 11月, 2015 1 次提交
  10. 12 11月, 2015 2 次提交
  11. 06 11月, 2015 1 次提交
  12. 02 11月, 2015 1 次提交
    • E
      net: Convert to new qapi union layout · 8d0bcba8
      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>
      8d0bcba8
  13. 27 10月, 2015 7 次提交
  14. 22 10月, 2015 3 次提交
  15. 21 10月, 2015 1 次提交
  16. 12 10月, 2015 8 次提交
  17. 25 9月, 2015 1 次提交