From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36723) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wsueo-0000PF-PM for qemu-devel@nongnu.org; Fri, 06 Jun 2014 09:58:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wsuei-0005IZ-LP for qemu-devel@nongnu.org; Fri, 06 Jun 2014 09:58:10 -0400 Received: from lputeaux-656-01-25-125.w80-12.abo.wanadoo.fr ([80.12.84.125]:46332 helo=paradis.irqsave.net) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wsuei-0005IQ-Ai for qemu-devel@nongnu.org; Fri, 06 Jun 2014 09:58:04 -0400 Date: Fri, 6 Jun 2014 15:58:02 +0200 From: =?iso-8859-1?Q?Beno=EEt?= Canet Message-ID: <20140606135802.GA16494@irqsave.net> References: <1402060908-18450-1-git-send-email-kwolf@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <1402060908-18450-1-git-send-email-kwolf@redhat.com> Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH] blockdev: Move 'serial' option to drive_init() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf Cc: qemu-devel@nongnu.org, stefanha@redhat.com The Friday 06 Jun 2014 =E0 15:21:48 (+0200), Kevin Wolf wrote : > It is not available with blockdev-add. >=20 > Signed-off-by: Kevin Wolf > --- > blockdev.c | 20 ++++++++++---------- > 1 file changed, 10 insertions(+), 10 deletions(-) >=20 > diff --git a/blockdev.c b/blockdev.c > index 9b5261b..9556598 100644 > --- a/blockdev.c > +++ b/blockdev.c > @@ -329,7 +329,6 @@ static DriveInfo *blockdev_init(const char *file, Q= Dict *bs_opts, > Error **errp) > { > const char *buf; > - const char *serial; > int ro =3D 0; > int bdrv_flags =3D 0; > int on_read_error, on_write_error; > @@ -371,8 +370,6 @@ static DriveInfo *blockdev_init(const char *file, Q= Dict *bs_opts, > ro =3D qemu_opt_get_bool(opts, "read-only", 0); > copy_on_read =3D qemu_opt_get_bool(opts, "copy-on-read", false); > =20 > - serial =3D qemu_opt_get(opts, "serial"); > - > if ((buf =3D qemu_opt_get(opts, "discard")) !=3D NULL) { > if (bdrv_parse_discard_flags(buf, &bdrv_flags) !=3D 0) { > error_setg(errp, "invalid discard option"); > @@ -501,9 +498,6 @@ static DriveInfo *blockdev_init(const char *file, Q= Dict *bs_opts, > dinfo->bdrv->read_only =3D ro; > dinfo->bdrv->detect_zeroes =3D detect_zeroes; > dinfo->refcount =3D 1; > - if (serial !=3D NULL) { > - dinfo->serial =3D g_strdup(serial); > - } > QTAILQ_INSERT_TAIL(&drives, dinfo, next); > =20 > bdrv_set_on_error(dinfo->bdrv, on_read_error, on_write_error); > @@ -630,6 +624,10 @@ QemuOptsList qemu_legacy_drive_opts =3D { > .type =3D QEMU_OPT_STRING, > .help =3D "pci address (virtio only)", > },{ > + .name =3D "serial", > + .type =3D QEMU_OPT_STRING, > + .help =3D "disk serial number", > + },{ > .name =3D "file", > .type =3D QEMU_OPT_STRING, > .help =3D "file name", > @@ -672,6 +670,7 @@ DriveInfo *drive_init(QemuOpts *all_opts, BlockInte= rfaceType block_default_type) > const char *werror, *rerror; > bool read_only =3D false; > bool copy_on_read; > + const char *serial; > const char *filename; > Error *local_err =3D NULL; > =20 > @@ -875,6 +874,9 @@ DriveInfo *drive_init(QemuOpts *all_opts, BlockInte= rfaceType block_default_type) > goto fail; > } > =20 > + /* Serial number */ > + serial =3D qemu_opt_get(legacy_opts, "serial"); > + > /* no id supplied -> create one */ > if (qemu_opts_id(all_opts) =3D=3D NULL) { > char *new_id; > @@ -965,6 +967,8 @@ DriveInfo *drive_init(QemuOpts *all_opts, BlockInte= rfaceType block_default_type) > dinfo->unit =3D unit_id; > dinfo->devaddr =3D devaddr; > =20 > + dinfo->serial =3D g_strdup(serial); > + > switch(type) { > case IF_IDE: > case IF_SCSI: > @@ -2432,10 +2436,6 @@ QemuOptsList qemu_common_drive_opts =3D { > .type =3D QEMU_OPT_STRING, > .help =3D "disk format (raw, qcow2, ...)", > },{ > - .name =3D "serial", > - .type =3D QEMU_OPT_STRING, > - .help =3D "disk serial number", > - },{ > .name =3D "rerror", > .type =3D QEMU_OPT_STRING, > .help =3D "read error action", > --=20 > 1.8.3.1 >=20 >=20 Will the patch apply with "blockdev: Rename drive_init(), drive_uninit() = to drive_new(), drive_del()" from markus applied ?