Skip to content

Commit d990434

Browse files
olafheringJeff Garzik
authored and
Jeff Garzik
committed
ata_piix: reenable MS Virtual PC guests
An earlier commit cd00608 ("ata_piix: defer disks to the Hyper-V drivers by default") broke MS Virtual PC guests. Hyper-V guests and Virtual PC guests have nearly identical DMI info. As a result the driver does currently ignore the emulated hardware in Virtual PC guests and defers the handling to hv_blkvsc. Since Virtual PC does not offer paravirtualized drivers no disks will be found in the guest. One difference in the DMI info is the product version. This patch adds a match for MS Virtual PC 2007 and "unignores" the emulated hardware. This was reported for openSuSE 12.1 in bugzilla: https://bugzilla.novell.com/show_bug.cgi?id=737532 Here is a detailed list of DMI info from example guests: hwinfo --bios: virtual pc guest: System Info: #1 Manufacturer: "Microsoft Corporation" Product: "Virtual Machine" Version: "VS2005R2" Serial: "3178-9905-1533-4840-9282-0569-59" UUID: undefined, but settable Wake-up: 0x06 (Power Switch) Board Info: #2 Manufacturer: "Microsoft Corporation" Product: "Virtual Machine" Version: "5.0" Serial: "3178-9905-1533-4840-9282-0569-59" Chassis Info: #3 Manufacturer: "Microsoft Corporation" Version: "5.0" Serial: "3178-9905-1533-4840-9282-0569-59" Asset Tag: "7188-3705-6309-9738-9645-0364-00" Type: 0x03 (Desktop) Bootup State: 0x03 (Safe) Power Supply State: 0x03 (Safe) Thermal State: 0x01 (Other) Security Status: 0x01 (Other) win2k8 guest: System Info: #1 Manufacturer: "Microsoft Corporation" Product: "Virtual Machine" Version: "7.0" Serial: "9106-3420-9819-5495-1514-2075-48" UUID: undefined, but settable Wake-up: 0x06 (Power Switch) Board Info: #2 Manufacturer: "Microsoft Corporation" Product: "Virtual Machine" Version: "7.0" Serial: "9106-3420-9819-5495-1514-2075-48" Chassis Info: #3 Manufacturer: "Microsoft Corporation" Version: "7.0" Serial: "9106-3420-9819-5495-1514-2075-48" Asset Tag: "7076-9522-6699-1042-9501-1785-77" Type: 0x03 (Desktop) Bootup State: 0x03 (Safe) Power Supply State: 0x03 (Safe) Thermal State: 0x01 (Other) Security Status: 0x01 (Other) win2k12 guest: System Info: #1 Manufacturer: "Microsoft Corporation" Product: "Virtual Machine" Version: "7.0" Serial: "8179-1954-0187-0085-3868-2270-14" UUID: undefined, but settable Wake-up: 0x06 (Power Switch) Board Info: #2 Manufacturer: "Microsoft Corporation" Product: "Virtual Machine" Version: "7.0" Serial: "8179-1954-0187-0085-3868-2270-14" Chassis Info: #3 Manufacturer: "Microsoft Corporation" Version: "7.0" Serial: "8179-1954-0187-0085-3868-2270-14" Asset Tag: "8374-0485-4557-6331-0620-5845-25" Type: 0x03 (Desktop) Bootup State: 0x03 (Safe) Power Supply State: 0x03 (Safe) Thermal State: 0x01 (Other) Security Status: 0x01 (Other) Signed-off-by: Olaf Hering <[email protected]> Signed-off-by: Jeff Garzik <[email protected]>
1 parent 3100d49 commit d990434

File tree

1 file changed

+22
-3
lines changed

1 file changed

+22
-3
lines changed

drivers/ata/ata_piix.c

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1585,12 +1585,31 @@ static void piix_ignore_devices_quirk(struct ata_host *host)
15851585
},
15861586
{ } /* terminate list */
15871587
};
1588-
const struct dmi_system_id *dmi = dmi_first_match(ignore_hyperv);
1588+
static const struct dmi_system_id allow_virtual_pc[] = {
1589+
{
1590+
/* In MS Virtual PC guests the DMI ident is nearly
1591+
* identical to a Hyper-V guest. One difference is the
1592+
* product version which is used here to identify
1593+
* a Virtual PC guest. This entry allows ata_piix to
1594+
* drive the emulated hardware.
1595+
*/
1596+
.ident = "MS Virtual PC 2007",
1597+
.matches = {
1598+
DMI_MATCH(DMI_SYS_VENDOR,
1599+
"Microsoft Corporation"),
1600+
DMI_MATCH(DMI_PRODUCT_NAME, "Virtual Machine"),
1601+
DMI_MATCH(DMI_PRODUCT_VERSION, "VS2005R2"),
1602+
},
1603+
},
1604+
{ } /* terminate list */
1605+
};
1606+
const struct dmi_system_id *ignore = dmi_first_match(ignore_hyperv);
1607+
const struct dmi_system_id *allow = dmi_first_match(allow_virtual_pc);
15891608

1590-
if (dmi && prefer_ms_hyperv) {
1609+
if (ignore && !allow && prefer_ms_hyperv) {
15911610
host->flags |= ATA_HOST_IGNORE_ATA;
15921611
dev_info(host->dev, "%s detected, ATA device ignore set\n",
1593-
dmi->ident);
1612+
ignore->ident);
15941613
}
15951614
#endif
15961615
}

0 commit comments

Comments
 (0)