2aa167c virdbus: don't force users to pass int for bool values

Authored and Committed by ericb 9 years ago
    virdbus: don't force users to pass int for bool values
    
    Use of an 'int' to represent a 'bool' value is confusing.  Just
    because dbus made the mistake of cementing their 4-byte wire
    format of dbus_bool_t into their API doesn't mean we have to
    repeat the mistake.  With a little bit of finesse, we can
    guarantee that we provide a large-enough value to the DBus
    code, while still copying only the relevant one-byte bool
    to the client code, and isolate the rest of our code base from
    the DBus stupidity.
    
    * src/util/virdbus.c (GET_NEXT_VAL): Add parameter.
    (virDBusMessageIterDecode): Adjust all clients.
    * src/util/virpolkit.c (virPolkitCheckAuth): Use nicer type.
    * tests/virdbustest.c (testMessageSimple, testMessageStruct):
    Test new behavior.
    
    Signed-off-by: Eric Blake <eblake@redhat.com>
    
        
file modified
+14 -11
file modified
+3 -3
file modified
+2 -2