summaryrefslogtreecommitdiff
path: root/hw/ide/internal.h
diff options
context:
space:
mode:
authorFloris Bos <bos@je-eigen-domein.nl>2012-03-12 21:05:09 +0100
committerKevin Wolf <kwolf@redhat.com>2012-04-05 14:54:39 +0200
commit27e0c9a1bbd166a67c16291016fba298a8e47140 (patch)
tree02a8183547b76d83f6ac422834d97814278bef5a /hw/ide/internal.h
parent2844bdd99a96dc32a6ebf464f49e65be31da1c14 (diff)
downloadqemu-27e0c9a1bbd166a67c16291016fba298a8e47140.tar.gz
ide: Add "model=s" qdev option
Allow the user to override the default disk model name "QEMU HARDDISK". 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> Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'hw/ide/internal.h')
-rw-r--r--hw/ide/internal.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/hw/ide/internal.h b/hw/ide/internal.h
index c808a0ddf8..b1319dca72 100644
--- a/hw/ide/internal.h
+++ b/hw/ide/internal.h
@@ -348,6 +348,7 @@ struct IDEState {
uint8_t identify_data[512];
int drive_serial;
char drive_serial_str[21];
+ char drive_model_str[41];
/* ide regs */
uint8_t feature;
uint8_t error;
@@ -468,6 +469,7 @@ struct IDEDevice {
BlockConf conf;
char *version;
char *serial;
+ char *model;
};
#define BM_STATUS_DMAING 0x01
@@ -534,7 +536,7 @@ void ide_data_writel(void *opaque, uint32_t addr, uint32_t val);
uint32_t ide_data_readl(void *opaque, uint32_t addr);
int ide_init_drive(IDEState *s, BlockDriverState *bs, IDEDriveKind kind,
- const char *version, const char *serial);
+ const char *version, const char *serial, const char *model);
void ide_init2(IDEBus *bus, qemu_irq irq);
void ide_init2_with_non_qdev_drives(IDEBus *bus, DriveInfo *hd0,
DriveInfo *hd1, qemu_irq irq);