[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] Re: [PATCH 4/4] Add virtio disk identification support
From: |
Rusty Russell |
Subject: |
[Qemu-devel] Re: [PATCH 4/4] Add virtio disk identification support |
Date: |
Tue, 30 Mar 2010 15:53:29 +1030 |
User-agent: |
KMail/1.12.2 (Linux/2.6.31-19-generic; KDE/4.3.2; i686; ; ) |
On Thu, 25 Mar 2010 04:04:02 pm john cooper wrote:
> Return serial string to the guest application via
> ioctl driver call.
This is quite nice. Minor nits:
> + if (cmd == 'VBID') {
> + void *usr_data = (void __user *)data;
void __user *usr_data;
> + char *id_str;
> + int err;
> +
> + if (!(id_str = kmalloc(VIRTIO_BLK_ID_BYTES, GFP_KERNEL)))
> + err = -ENOMEM;
> + else if ((err = virtblk_get_id(disk, id_str)))
> + ;
> + else if (copy_to_user(usr_data, id_str, VIRTIO_BLK_ID_BYTES))
> + err = -EFAULT;
> + if (id_str)
> + kfree(id_str);
> + return err;
> + }
We can't put the id_str on the stack? Makes it even simpler :)
Cheers,
Rusty.