[libvirt PATCH 31/31] tools: wireshark: fix compilation errors

Ján Tomko jtomko at redhat.com
Thu Jul 9 15:28:39 UTC 2020


On a Thursday in 2020, Pavel Hrdina wrote:
>With meson introduction which is using the same CFLAGS for the whole
>project some compilation errors were discovered.

What were the errors?

>
>Signed-off-by: Pavel Hrdina <phrdina at redhat.com>
>---
> tools/wireshark/src/packet-libvirt.c | 19 +++++++++++++------
> 1 file changed, 13 insertions(+), 6 deletions(-)
>
>diff --git a/tools/wireshark/src/packet-libvirt.c b/tools/wireshark/src/packet-libvirt.c
>index 20b7a3ec812..db8efe45a39 100644
>--- a/tools/wireshark/src/packet-libvirt.c
>+++ b/tools/wireshark/src/packet-libvirt.c
>@@ -77,15 +77,15 @@ static gint ett_libvirt_stream_hole = -1;
>
> XDR_PRIMITIVE_DISSECTOR(int,     gint32,  int)
> XDR_PRIMITIVE_DISSECTOR(u_int,   guint32, uint)
>-XDR_PRIMITIVE_DISSECTOR(short,   gint16,  int)
>+//XDR_PRIMITIVE_DISSECTOR(short,   gint16,  int)
> XDR_PRIMITIVE_DISSECTOR(u_short, guint16, uint)
> XDR_PRIMITIVE_DISSECTOR(char,    gchar,   int)
> XDR_PRIMITIVE_DISSECTOR(u_char,  guchar,  uint)
> XDR_PRIMITIVE_DISSECTOR(hyper,   gint64,  int64)
> XDR_PRIMITIVE_DISSECTOR(u_hyper, guint64, uint64)
>-XDR_PRIMITIVE_DISSECTOR(float,   gfloat,  float)
>+//XDR_PRIMITIVE_DISSECTOR(float,   gfloat,  float)
> XDR_PRIMITIVE_DISSECTOR(double,  gdouble, double)
>-XDR_PRIMITIVE_DISSECTOR(bool,    bool_t,  boolean)
>+//XDR_PRIMITIVE_DISSECTOR(bool,    bool_t,  boolean)
>

If we don't need these, we can just delete them instead of commenting
them out.

> typedef gboolean (*vir_xdr_dissector_t)(tvbuff_t *tvb, proto_tree *tree, XDR *xdrs, int hf);
>

The rest of the changes look reasonable.

Jano

>@@ -345,7 +345,9 @@ dissect_libvirt_num_of_fds(tvbuff_t *tvb, proto_tree *tree)
> }
>
> static void
>-dissect_libvirt_fds(tvbuff_t *tvb, gint start, gint32 nfds)
>+dissect_libvirt_fds(tvbuff_t *tvb G_GNUC_UNUSED,
>+                    gint start G_GNUC_UNUSED,
>+                    gint32 nfds G_GNUC_UNUSED)
> {
>     /* TODO: NOP for now */
> }
>@@ -420,8 +422,13 @@ dissect_libvirt_payload(tvbuff_t *tvb, proto_tree *tree,
>         return; /* No payload */
>
>     if (status == VIR_NET_OK) {
>-        vir_xdr_dissector_t xd = find_payload_dissector(proc, type, get_program_data(prog, VIR_PROGRAM_DISSECTORS),
>-                                                        *(gsize *)get_program_data(prog, VIR_PROGRAM_DISSECTORS_LEN));
>+        const vir_dissector_index_t *pds = get_program_data(prog, VIR_PROGRAM_DISSECTORS);
>+        const gsize *len = get_program_data(prog, VIR_PROGRAM_DISSECTORS_LEN);
>+
>+        if (!len)
>+            goto unknown;
>+
>+        vir_xdr_dissector_t xd = find_payload_dissector(proc, type, pds, *len);
>         if (xd == NULL)
>             goto unknown;
>         dissect_libvirt_payload_xdr_data(tvb, tree, payload_length, status, xd);
>-- 
>2.26.2
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20200709/8c31e68c/attachment-0001.sig>


More information about the libvir-list mailing list