[PATCH 05/10] qemuMigrationCookieNBD: Extract embedded struct

Peter Krempa pkrempa at redhat.com
Thu Jan 30 19:36:05 UTC 2020


On Thu, Jan 30, 2020 at 16:51:22 +0100, Michal Privoznik wrote:
> On 1/30/20 3:53 PM, Peter Krempa wrote:
> > Extract the struct so that it's type has a name.
> > 
> > Signed-off-by: Peter Krempa <pkrempa at redhat.com>
> > ---
> >   src/qemu/qemu_migration_cookie.h | 10 ++++++----
> >   1 file changed, 6 insertions(+), 4 deletions(-)
> > 
> > diff --git a/src/qemu/qemu_migration_cookie.h b/src/qemu/qemu_migration_cookie.h
> > index 20e1ed60ca..1e88684589 100644
> > --- a/src/qemu/qemu_migration_cookie.h
> > +++ b/src/qemu/qemu_migration_cookie.h
> > @@ -84,16 +84,18 @@ struct _qemuMigrationCookieNetwork {
> >       qemuMigrationCookieNetDataPtr net;
> >   };
> > 
> > +struct qemuMigrationCookieNBDDisk {
> > +    char *target;                   /* Disk target */
> > +    unsigned long long capacity;    /* And its capacity */
> > +};
> > +
> 
> Might as well typedef this struct, so that in the next patch you can drop
> the 'struct '.

To be honest, I'm not a fan of typedefing random internal structs and
typedefing the pointer type is almost dangerous.




More information about the libvir-list mailing list