[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Libguestfs] [PATCH v4 02/24] nbd: Consistent typedef usage in heade
From: |
Eric Blake |
Subject: |
Re: [Libguestfs] [PATCH v4 02/24] nbd: Consistent typedef usage in header |
Date: |
Thu, 8 Jun 2023 09:17:57 -0500 |
User-agent: |
NeoMutt/20230517 |
On Thu, Jun 08, 2023 at 08:56:31AM -0500, Eric Blake wrote:
> We had a mix of struct declarataions followed by typedefs, and direct
declarations
> struct definitions as part of a typedef. Pick a single style. Also
> float a couple of opaque typedefs earlier in the file, as a later
> patch wants to refer NBDExport* in NBDRequest. No semantic impact.
The curse of writing a commit message and then rebasing to a different
idea; in patch 22, I had originally intended to make NBDMetaContexts a
concrete type in nbd.h (which depends on NBDExport*, and would be
directly used in NBDRequest, which in turn is declared before the
pre-patch mention of NBDExport), but then changed my mind to instead
have NBDMetaContexts itself also be an opaque type with NBDRequest
only using NBDMetaContexts*. And I missed floating the typedef for
NBDClientConnection to the same point, because we somewhat separated
opaque types along the lines of which .c files provide various
functions and opaque types.
> @@ -26,24 +26,25 @@
> #include "qapi/error.h"
> #include "qemu/bswap.h"
>
> +typedef struct NBDExport NBDExport;
> +typedef struct NBDClient NBDClient;
> +
Preferences on how I should tweak that aspect of this patch? Options:
- Don't float NBDExport or NBDClient, and drop that part of the commit
message. However, the later patch that adds the typedef for
NBDMetaContexts still has to do it earlier than the definition of
NBDRequest, rather than alongside the other opaque types relevant to
server.c
- Also float NBDClientConnection up here, and reword the commit
message along the lines of: Also float forward declarations of
opaque types to the top of the file, rather than interspersed with
function declarations, which will help a future patch that wants to
expose yet another opaque type that will be referenced in
NBDRequest.
- something else?
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3266
Virtualization: qemu.org | libvirt.org
- [PATCH v4 00/24] qemu patches for 64-bit NBD extensions, Eric Blake, 2023/06/08
- [PATCH v4 02/24] nbd: Consistent typedef usage in header, Eric Blake, 2023/06/08
- Re: [Libguestfs] [PATCH v4 02/24] nbd: Consistent typedef usage in header,
Eric Blake <=
- [PATCH v4 03/24] nbd/server: Prepare for alternate-size headers, Eric Blake, 2023/06/08
- [PATCH v4 04/24] nbd/server: Refactor to pass full request around, Eric Blake, 2023/06/08
- [PATCH v4 05/24] nbd: s/handle/cookie/ to match NBD spec, Eric Blake, 2023/06/08
- [PATCH v4 08/24] nbd: Use enum for various negotiation modes, Eric Blake, 2023/06/08
- [PATCH v4 06/24] nbd/client: Simplify cookie vs. index computation, Eric Blake, 2023/06/08