On 02/08/2012 06:49 AM, Guannan Ren wrote:
> Isn't the real bug that we are calling MergeDeviceWeights on
vm->def
> instead of on persistentDef? Does this simpler patch do the trick? (I
> should probably split it into two pathes - the first hunk is cosmetic,
> the second fixes the bug).
>
> diff --git i/src/qemu/qemu_driver.c w/src/qemu/qemu_driver.c
> index 3f940e8..06b30be 100644
> --- i/src/qemu/qemu_driver.c
> +++ w/src/qemu/qemu_driver.c
> @@ -5975,35 +5975,40 @@ cleanup:
> return -1;
> }
>
> -/* Modify def to reflect all device weight changes described in tmp. */
> +/* Modify dest_array to reflect all device weight changes described in
> + * src_array. */
> static int
> -qemuDomainMergeDeviceWeights(virBlkioDeviceWeightPtr *def, size_t
> *def_size,
> - virBlkioDeviceWeightPtr tmp, size_t
> tmp_size)
> +qemuDomainMergeDeviceWeights(virBlkioDeviceWeightPtr *dest_array,
> + size_t *dest_size,
> + virBlkioDeviceWeightPtr src_array,
> + size_t src_size)
> {
> @@ -6142,8 +6147,8 @@ qemuDomainSetBlkioParameters(virDomainPtr
dom,
> ret = -1;
> continue;
> }
> - if
> (qemuDomainMergeDeviceWeights(&vm->def->blkio.devices,
> -&vm->def->blkio.ndevices,
> + if
> (qemuDomainMergeDeviceWeights(&persistentDef->blkio.devices,
> +
> &persistentDef->blkio.ndevices,
> devices,
> ndevices)< 0)
> ret = -1;
> virBlkioDeviceWeightArrayClear(devices, ndevices);
>
>
Thanks, it is using duplicated function to do the job.
Your patch is perfect except the possible not correct indentation
in last couple of lines.
Thanks; I've now pushed this as two patches. The bad indentation on the
last hunk was an artifact of me pasting the patch into thunderbird, and
not an actual flaw with what I pushed.
--
Eric Blake eblake(a)redhat.com +1-919-301-3266
Libvirt virtualization library
http://libvirt.org