qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Andreas Färber" <afaerber@suse.de>
To: Floris Bos <bos@je-eigen-domein.nl>
Cc: kwolf@redhat.com, qemu-devel@nongnu.org, Floris Bos <dev@noc-ps.com>
Subject: Re: [Qemu-devel] [PATCH] ide: Adds "model=s" option, allowing the user to override the default disk model name "QEMU HARDDISK"
Date: Sun, 11 Mar 2012 12:56:07 +0100	[thread overview]
Message-ID: <4F5C92D7.9050401@suse.de> (raw)
In-Reply-To: <1331409387-18234-1-git-send-email-bos@je-eigen-domein.nl>

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 HARDDISK"
> This patch introduces a model=s option which in combination with the existing serial=s option can be used to
> fake the disk the operating system was previously on, allowing the OS to boot properly.
> 
> Cc: kwolf@redhat.com
> Signed-off-by: Floris Bos <dev@noc-ps.com>

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_to_scsi)
>      dinfo->refcount = 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);
>  
>      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

-- 
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg

  reply	other threads:[~2012-03-11 11:56 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-10 19:56 [Qemu-devel] [PATCH] ide: Adds "model=s" option, allowing the user to override the default disk model name "QEMU HARDDISK" Floris Bos
2012-03-11 11:56 ` Andreas Färber [this message]
2012-03-12 10:26 ` Stefan Hajnoczi
2012-03-12 11:30   ` Floris Bos / Maxnet
2012-03-12 11:38     ` Kevin Wolf
2012-03-12 11:57 ` Kevin Wolf
2012-03-12 12:09   ` Floris Bos / Maxnet
2012-03-12 12:45     ` Kevin Wolf

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=4F5C92D7.9050401@suse.de \
    --to=afaerber@suse.de \
    --cc=bos@je-eigen-domein.nl \
    --cc=dev@noc-ps.com \
    --cc=kwolf@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).