On Wed, Feb 25, 2015 at 04:51:32PM +0000, Dr. David Alan Gilbert (git) wrote:
> From: "Dr. David Alan Gilbert" <dgilb...@redhat.com>
> 
> Create QEMU_VM_COMMAND section type for sending commands from
> source to destination.  These commands are not intended to convey
> guest state but to control the migration process.
> 
> For use in postcopy.
> 
> Signed-off-by: Dr. David Alan Gilbert <dgilb...@redhat.com>

[snip]
> +/* Send a 'QEMU_VM_COMMAND' type element with the command
> + * and associated data.
> + */
> +void qemu_savevm_command_send(QEMUFile *f,
> +                              enum qemu_vm_cmd command,
> +                              uint16_t len,
> +                              uint8_t *data)
> +{
> +    uint32_t tmp = (uint16_t)command;

Erm.. cast to u16, assign to u32, then send as u16?  What's up with
that?

> +    qemu_put_byte(f, QEMU_VM_COMMAND);
> +    qemu_put_be16(f, tmp);
> +    qemu_put_be16(f, len);
> +    if (len) {
> +        qemu_put_buffer(f, data, len);
> +    }
> +    qemu_fflush(f);
> +}
> +

-- 
David Gibson                    | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au  | minimalist, thank you.  NOT _the_ _other_
                                | _way_ _around_!
http://www.ozlabs.org/~dgibson

Attachment: pgpOuOZAvx5I7.pgp
Description: PGP signature

Reply via email to