Re: [PATCH v3 RESEND 09/12] qemu_migration: Check size prerequisites

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Feb 20, 2013 at 14:47:11 +0100, Jiri Denemark wrote:
...
> > +static int
> > +qemuMigrationPreCreateStorage(virQEMUDriverPtr driver,
> > +                              virDomainObjPtr vm,
> > +                              qemuMigrationCookiePtr mig)
> > +{
> > +    int ret = -1;
> > +    size_t i = 0;
> > +
> > +    if (!mig->nbd || !mig->nbd->ndisks) {
> > +        /* nothing to do here */
> > +        return 0;
> > +    }
> > +
> > +    for (i = 0; i < mig->nbd->ndisks; i++) {
> > +        virDomainDiskDefPtr disk;
> > +        int format;
> > +        size_t bytes;
> > +        int index;
> 
> This fails to compile:
> 
>     error: declaration of 'index' shadows a global declaration
> 
> > +
> > +        index = virDomainDiskIndexByName(vm->def, mig->nbd->disk[i].target, false);
> > +        if (index < 0) {
> > +            virReportError(VIR_ERR_INTERNAL_ERROR,
> > +                           _("No such disk '%s"),
> > +                           mig->nbd->disk[i].target);
> > +            goto cleanup;
> > +        }
> > +
> > +        disk = vm->def->disks[i];
> 
> As John already said, I think you want vm->def->disks[index] here.
> 
> > +        format = disk->format;
> > +        bytes = mig->nbd->disk[i].bytes;

Oh, and I forgot to mention that we should only try to pre-create disks
with type='file'.

Jirka

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]