qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: Dave Young <dyoung@redhat.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH v2] virtio-blk: add default serial id
Date: Fri, 21 Sep 2012 08:15:38 -0600	[thread overview]
Message-ID: <505C768A.5070801@redhat.com> (raw)
In-Reply-To: <20120921133031.GA1682@darkstar.nay.redhat.com>

[-- Attachment #1: Type: text/plain, Size: 1764 bytes --]

On 09/21/2012 07:30 AM, Dave Young wrote:
> 
> For virtio block device, if user does not specify the serial attribute,
> There will be no serial availabe, this is not convenient for identifying
> the disk.
> 
> Doing something similar to ide disks, add a "VD0000?" default serial
> number if user does not specify it.
> 
> [v1->v2 address comments from Eric Blake]:
> fix spell errors in patch description
> decrease drive_serial in virtio_blk_exit as well

Typically, patch changelogs belong...

> 
> Signed-off-by: Dave Young <dyoung@redhat.com>
> ---

...after the --- line, so that 'git am' doesn't make them part of git
history.  Also, I'm not sure that decreasing the serial number is
correct - you've now made it much easier to get duplicate serial numbers
compared to my original complaint of 100000 hotplug cycles.  Now all I
have to do is:

create a guest with two disks
hot unplug disk one
hot plug a new disk

and voila, both disks will now have serial number 2.

> @@ -632,6 +638,7 @@ VirtIODevice *virtio_blk_init(DeviceStat
>                                            sizeof(struct virtio_blk_config),
>                                            sizeof(VirtIOBlock));
>  
> +    s->drive_serial = drive_serial++;
>      s->vdev.get_config = virtio_blk_update_config;
>      s->vdev.set_config = virtio_blk_set_config;
>      s->vdev.get_features = virtio_blk_get_features;
> @@ -664,4 +671,5 @@ void virtio_blk_exit(VirtIODevice *vdev)
>      unregister_savevm(s->qdev, "virtio-blk", s);
>      blockdev_mark_auto_del(s->bs);
>      virtio_cleanup(vdev);
> +    drive_serial--;
>  }
> 
> 

-- 
Eric Blake   eblake@redhat.com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 617 bytes --]

  reply	other threads:[~2012-09-21 14:15 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-21 13:30 [Qemu-devel] [PATCH v2] virtio-blk: add default serial id Dave Young
2012-09-21 14:15 ` Eric Blake [this message]
2012-09-23  2:37   ` Dave Young
2012-10-05  8:14     ` Stefan Hajnoczi
2012-10-09  2:27       ` Dave Young
2012-10-09  8:31         ` Stefan Hajnoczi
2012-10-10  2:07           ` Dave Young
2012-10-11  8:24             ` Stefan Hajnoczi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=505C768A.5070801@redhat.com \
    --to=eblake@redhat.com \
    --cc=dyoung@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).