[libvirt] [PATCH] Remove unused nwfilter field from struct remote_error

Daniel P. Berrange berrange at redhat.com
Thu May 6 10:44:37 UTC 2010


On Thu, May 06, 2010 at 12:30:27PM +0200, Daniel Veillard wrote:
> On Thu, May 06, 2010 at 11:14:47AM +0100, Matthew Booth wrote:
> > Change 965466c1 added a new field to struct remote_error, which broke the RPC
> > protocol. Fortunately the new field is unused, so this change simply removes it
> > again.
> > 
> > * src/remote/remote_protocol.(c|h|x): Remove remote_nwfilter from struct
> >                                       remote_error
> > ---
> >  src/remote/remote_protocol.c |    2 --
> >  src/remote/remote_protocol.h |    1 -
> >  src/remote/remote_protocol.x |    1 -
> >  3 files changed, 0 insertions(+), 4 deletions(-)
> > 
> > diff --git a/src/remote/remote_protocol.c b/src/remote/remote_protocol.c
> > index 187281d..972bf52 100644
> > --- a/src/remote/remote_protocol.c
> > +++ b/src/remote/remote_protocol.c
> > @@ -227,8 +227,6 @@ xdr_remote_error (XDR *xdrs, remote_error *objp)
> >                   return FALSE;
> >           if (!xdr_remote_network (xdrs, &objp->net))
> >                   return FALSE;
> > -         if (!xdr_remote_nwfilter (xdrs, &objp->nwfilter))
> > -                 return FALSE;
> >          return TRUE;
> >  }
> >  
> > diff --git a/src/remote/remote_protocol.h b/src/remote/remote_protocol.h
> > index 6f01da7..a600af6 100644
> > --- a/src/remote/remote_protocol.h
> > +++ b/src/remote/remote_protocol.h
> > @@ -143,7 +143,6 @@ struct remote_error {
> >          int int1;
> >          int int2;
> >          remote_network net;
> > -        remote_nwfilter nwfilter;
> >  };
> >  typedef struct remote_error remote_error;
> >  
> > diff --git a/src/remote/remote_protocol.x b/src/remote/remote_protocol.x
> > index 8000ee0..1ce488c 100644
> > --- a/src/remote/remote_protocol.x
> > +++ b/src/remote/remote_protocol.x
> > @@ -266,7 +266,6 @@ struct remote_error {
> >      int int1;
> >      int int2;
> >      remote_network net;
> > -    remote_nwfilter nwfilter;
> >  };
> >  
> >  /* Authentication types available thus far.... */
> 
>   ACK,
> 
> I suggest people packaging libvirt-0.8.0 or 0.8.1 in dustributions to
> apply this patch to avoid the protocol break with other versions !

FYI impact is that in the one failure scenario here, yo will be unable
to decode virError objects off the wire, instead of the real error you
wil get an RPC error:

 1. 0.7.x client -> 0.7.x server : OK
 2. 0.7.x client -> 0.8.x server : OK (ignores the extra trailing bytes)

 3. 0.8.x client -> 0.7.x server : FAIL
 4. 0.8.x client -> 0.8.x server : OK

With matt's patch applied, removing the bogus field, new clients will
work with old servers again.

 1. 0.7.x client -> 0.7.x server : OK
 2. 0.7.x client -> 0.8.x server : OK (ignores the extra trailing bytes)
 3. 0.7.x client -> 0.8.2 server : OK

 4. 0.8.x client -> 0.7.x server : FAIL (not enough bytes)
 5. 0.8.x client -> 0.8.x server : OK
 6. 0.8.x client -> 0.8.2 server : FAIL (not enough bytes)

 7. 0.8.2 client -> 0.7.x server : OK
 8. 0.8.2 client -> 0.8.x server : OK (ignores the extra trailing bytes)
 9. 0.8.2 client -> 0.8.2 server : OK

Anyone with a 0.8.x build should apply this patch too

Daniel
-- 
|: Red Hat, Engineering, London    -o-   http://people.redhat.com/berrange/ :|
|: http://libvirt.org -o- http://virt-manager.org -o- http://deltacloud.org :|
|: http://autobuild.org        -o-         http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505  -o-   F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|




More information about the libvir-list mailing list