[libvirt] [PATCH] qemu: Do not ignore mandatory features in migration cookie

Jiri Denemark jdenemar at redhat.com
Wed Feb 20 14:30:44 UTC 2013


On Wed, Feb 20, 2013 at 11:42:01 +0100, Michal Privoznik wrote:
> On 20.02.2013 10:37, Jiri Denemark wrote:
> > Due to "feature"/"features" nasty typo, any features marked as mandatory
> > by one side of a migration are silently considered optional by the other
> > side. The following is the code that formats mandatory features in
> > migration cookie:
> > 
> >     for (i = 0 ; i < QEMU_MIGRATION_COOKIE_FLAG_LAST ; i++) {
> >         if (mig->flagsMandatory & (1 << i))
> >             virBufferAsprintf(buf, "  <feature name='%s'/>\n",
> >                               qemuMigrationCookieFlagTypeToString(i));
> >     }
> > ---
> >  src/qemu/qemu_migration.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
> > index 82c3f97..17c1714 100644
> > --- a/src/qemu/qemu_migration.c
> > +++ b/src/qemu/qemu_migration.c
> > @@ -863,7 +863,7 @@ qemuMigrationCookieXMLParse(qemuMigrationCookiePtr mig,
> >  
> >      /* Check to ensure all mandatory features from XML are also
> >       * present in 'flags' */
> > -    if ((n = virXPathNodeSet("./features", ctxt, &nodes)) < 0)
> > +    if ((n = virXPathNodeSet("./feature", ctxt, &nodes)) < 0)
> >          goto error;
> >  
> >      for (i = 0 ; i < n ; i++) {
> > 
> 
> ACK. Nice catch.

Pushed, thanks.

Jirka




More information about the libvir-list mailing list