From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:45056) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S6hNn-0008MK-6f for qemu-devel@nongnu.org; Sun, 11 Mar 2012 07:56:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S6hNi-0004Ap-Vt for qemu-devel@nongnu.org; Sun, 11 Mar 2012 07:56:14 -0400 Received: from cantor2.suse.de ([195.135.220.15]:50455 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S6hNi-0004AZ-K5 for qemu-devel@nongnu.org; Sun, 11 Mar 2012 07:56:10 -0400 Message-ID: <4F5C92D7.9050401@suse.de> Date: Sun, 11 Mar 2012 12:56:07 +0100 From: =?ISO-8859-15?Q?Andreas_F=E4rber?= MIME-Version: 1.0 References: <1331409387-18234-1-git-send-email-bos@je-eigen-domein.nl> In-Reply-To: <1331409387-18234-1-git-send-email-bos@je-eigen-domein.nl> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH] ide: Adds "model=s" option, allowing the user to override the default disk model name "QEMU HARDDISK" List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Floris Bos Cc: kwolf@redhat.com, qemu-devel@nongnu.org, Floris Bos Am 10.03.2012 20:56, schrieb Floris Bos: > Some Linux distributions use the /dev/disk/by-id/scsi-SATA_name-of-disk= -model_serial addressing scheme > when refering to partitions in /etc/fstab and elsewhere. > This causes problems when starting a disk image taken from an existing = physical server under qemu, > because when running under qemu name-of-disk-model is always "QEMU HARD= DISK" > This patch introduces a model=3Ds option which in combination with the = existing serial=3Ds option can be used to > fake the disk the operating system was previously on, allowing the OS t= o boot properly. >=20 > Cc: kwolf@redhat.com > Signed-off-by: Floris Bos Patch looks good to me, except for some formal issues scripts/checkpatch.pl should warn about: > diff --git a/blockdev.c b/blockdev.c > index d78aa51..66fcc14 100644 > --- a/blockdev.c > +++ b/blockdev.c > @@ -534,6 +536,8 @@ DriveInfo *drive_init(QemuOpts *opts, int default_t= o_scsi) > dinfo->refcount =3D 1; > if (serial) > strncpy(dinfo->serial, serial, sizeof(dinfo->serial) - 1); > + if (model) > + strncpy(dinfo->model, model, sizeof(dinfo->model) - 1); Please use braces for new ifs. > QTAILQ_INSERT_TAIL(&drives, dinfo, next); > =20 > bdrv_set_on_error(dinfo->bdrv, on_read_error, on_write_error); > diff --git a/hw/ide/core.c b/hw/ide/core.c > index 4d568ac..2a38030 100644 > --- a/hw/ide/core.c > +++ b/hw/ide/core.c > @@ -1977,7 +1993,8 @@ void ide_init2_with_non_qdev_drives(IDEBus *bus, = DriveInfo *hd0, > if (dinfo) { > if (ide_init_drive(&bus->ifs[i], dinfo->bdrv, > dinfo->media_cd ? IDE_CD : IDE_HD, NULL= , > - *dinfo->serial ? dinfo->serial : NULL) = < 0) { > + *dinfo->serial ? dinfo->serial : NULL, > + *dinfo->model ? dinfo->model : NULL) < 0) { Indentation uses tabs here; please use spaces. > error_report("Can't set up IDE drive %s", dinfo->id); > exit(1); > } Andreas --=20 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=FCrnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imend=F6rffer; HRB 16746 AG N=FCrnbe= rg