boot: fix fw_dev_path pattern for q35-pcihost
PATCH 1/1 boot: fix fw_dev_path pattern for q35-pcihost
Bootindex string passed from qemu:
/q35-pcihost@i0cf8/ethernet@2/ethernet-phy@0
We match pci domain by "/pci@i0cf8" in SeaBIOS, but fw_dev_path prefix of q35 is "/q35-pcihost@i0cf8". So bootindex in qemu commandline doesn't work if it uses q35 machine type.
This patch fixes the pattern to match both original pc-i440fx & q35
--- src/boot.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
src/boot.c +1 -1
@@ -97,7 +97,7 @@ find_prio(const char *glob)return -1 ; } -#define FW_PCI_DOMAIN "/pci@i0cf8" +#define FW_PCI_DOMAIN "/*pci*@i0cf8"static char *build_pci_path (char *buf,int max,const char *devname,struct pci_device *pci)
Signature · 1 line
1.8.1.4
Il 28/05/2013 14:28, Amos Kong ha scritto:
Quoted 10 lines
Bootindex string passed from qemu:
/q35-pcihost@i0cf8/ethernet@2/ethernet-phy@0We match pci domain by "/pci@i0cf8" in SeaBIOS, but
fw_dev_pathprefix of q35 is "/q35-pcihost@i0cf8". So bootindex in qemu commandline doesn't work if it uses q35 machine type.This patch fixes the pattern to match both original pc-i440fx & q35
Signed-off-by Amos Kong <[email protected]>
Quoted 18 lines
--- src/boot.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)src/boot.c +1
-1@@ -97,7 +97,7 @@ find_prio(const char *glob)return -1 ; } -#define FW_PCI_DOMAIN "/pci@i0cf8" +#define FW_PCI_DOMAIN "/*pci*@i0cf8"static char *build_pci_path (char *buf,int max,const char *devname,struct pci_device *pci)
Quoted 19 lines · Amos Kong
Bootindex string passed from qemu:
/q35-pcihost@i0cf8/ethernet@2/ethernet-phy@0We match pci domain by "/pci@i0cf8" in SeaBIOS, but
fw_dev_pathprefix of q35 is "/q35-pcihost@i0cf8". So bootindex in qemu commandline doesn't work if it uses q35 machine type.This patch fixes the pattern to match both original pc-i440fx & q35
Signed-off-by Amos Kong <[email protected]>--- src/boot.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)src/boot.c +0
-0
src/boot.c find_prio(const char *glob) · line 100
Quoted 5 lines
src/boot.c +1
-1@@ -97,7 +97,7 @@ find_prio(const char *glob)return -1 ; } -#define FW_PCI_DOMAIN "/pci@i0cf8" +#define FW_PCI_DOMAIN "/*pci*@i0cf8"
The seabios pattern matching code isn't that sophisticated - I think this could end up doing something unexpected. Why does it need to change?
-Kevin
Quoted 23 lines · Kevin O'Connor
Quoted 22 lines · Amos Kong
Bootindex string passed from qemu:
/q35-pcihost@i0cf8/ethernet@2/ethernet-phy@0We match pci domain by "/pci@i0cf8" in SeaBIOS, but
fw_dev_pathprefix of q35 is "/q35-pcihost@i0cf8". So bootindex in qemu commandline doesn't work if it uses q35 machine type.This patch fixes the pattern to match both original pc-i440fx & q35
Signed-off-by Amos Kong <[email protected]>--- src/boot.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)src/boot.c +0
-0@@ -97,7 +97,7 @@ find_prio(const char *glob)return -1 ; }
Quoted 6 lines
src/boot.c find_prio(const char *glob) · line 100
Quoted 2 lines
src/boot.c +1
-1-#define FW_PCI_DOMAIN "/pci@i0cf8" +#define FW_PCI_DOMAIN "/*pci*@i0cf8"The seabios pattern matching code isn't that sophisticated - I think this could end up doing something unexpected. Why does it need to change?
If we start a guest with default machine type (pc-i440fx), the prefix of bootindex string is "/pci@i0cf8", if we start guest with -M q35, the prefix will become "/q35-pcihost@i0cf8".
We only match "/pci@i0cf8" in seabios, it causes boot priority of q35 devices could not be changed.
We could not change TYPE_Q35_HOST_DEVICE to 'pci' in qemu to adapt seabios, so fix the pattern.
| qemu/include/hw/pci-host/q35.h:#define TYPE_Q35_HOST_DEVICE "q35-pcihost"
I see glob_prefix() is not powerful, "/*pci*@i0cf8" & "/*@i0cf8" all work.
Or change TYPE_Q35_HOST_DEVICE to "pci-q35" in qemu, and use "/pci*@i0cf8" in seabios ?
Quoted 1 line
-Kevin
Signature · 1 line
Amos.
Quoted 13 lines · Amos Kong
Quoted 7 lines · Kevin O'Connor
src/boot.c find_prio(const char *glob) · line 100
Quoted 2 lines · Amos Kong
src/boot.c +1
-1-#define FW_PCI_DOMAIN "/pci@i0cf8" +#define FW_PCI_DOMAIN "/*pci*@i0cf8"The seabios pattern matching code isn't that sophisticated - I think this could end up doing something unexpected. Why does it need to change?
If we start a guest with default machine type (pc-i440fx), the prefix of bootindex string is "/pci@i0cf8", if we start guest with -M q35, the prefix will become "/q35-pcihost@i0cf8".
Quoted 5 lines
We only match "/pci@i0cf8" in seabios, it causes boot priority of q35 devices could not be changed.
We could not change
TYPE_Q35_HOST_DEVICEto 'pci' in qemu to adapt seabios, so fix the pattern.
It really can't be changed?
Quoted 5 lines
I see
glob_prefix()is not powerful, "/*pci*@i0cf8" & "/*@i0cf8" all work.Or change
TYPE_Q35_HOST_DEVICEto "pci-q35" in qemu, and use "/pci*@i0cf8" in seabios ?
That would be preferable.
-Kevin
Quoted 35 lines · Amos Kong
Quoted 23 lines · Kevin O'Connor
Quoted 22 lines · Amos Kong
Bootindex string passed from qemu:
/q35-pcihost@i0cf8/ethernet@2/ethernet-phy@0We match pci domain by "/pci@i0cf8" in SeaBIOS, but
fw_dev_pathprefix of q35 is "/q35-pcihost@i0cf8". So bootindex in qemu commandline doesn't work if it uses q35 machine type.This patch fixes the pattern to match both original pc-i440fx & q35
Signed-off-by Amos Kong <[email protected]>--- src/boot.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)src/boot.c +0
-0@@ -97,7 +97,7 @@ find_prio(const char *glob)return -1 ; }Quoted 6 lines
src/boot.c find_prio(const char *glob) · line 100
Quoted 2 lines
src/boot.c +1
-1-#define FW_PCI_DOMAIN "/pci@i0cf8" +#define FW_PCI_DOMAIN "/*pci*@i0cf8"The seabios pattern matching code isn't that sophisticated - I think this could end up doing something unexpected. Why does it need to change?
If we start a guest with default machine type (pc-i440fx), the prefix of bootindex string is "/pci@i0cf8", if we start guest with -M q35, the prefix will become "/q35-pcihost@i0cf8".
Quoted 6 lines
We only match "/pci@i0cf8" in seabios, it causes boot priority of q35 devices could not be changed.
We could not change
TYPE_Q35_HOST_DEVICEto 'pci' in qemu to adapt seabios, so fix the pattern.
Why couldn't we? QEMU not been able to generate proper device string is QEMU bug.
--
Gleb.
Quoted 39 lines · Gleb Natapov
Quoted 38 lines · Amos Kong
Quoted 23 lines · Kevin O'Connor
Quoted 22 lines · Amos Kong
Bootindex string passed from qemu:
/q35-pcihost@i0cf8/ethernet@2/ethernet-phy@0We match pci domain by "/pci@i0cf8" in SeaBIOS, but
fw_dev_pathprefix of q35 is "/q35-pcihost@i0cf8". So bootindex in qemu commandline doesn't work if it uses q35 machine type.This patch fixes the pattern to match both original pc-i440fx & q35
Signed-off-by Amos Kong <[email protected]>--- src/boot.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)src/boot.c +0
-0@@ -97,7 +97,7 @@ find_prio(const char *glob)return -1 ; }Quoted 6 lines
src/boot.c find_prio(const char *glob) · line 100
Quoted 2 lines
src/boot.c +1
-1-#define FW_PCI_DOMAIN "/pci@i0cf8" +#define FW_PCI_DOMAIN "/*pci*@i0cf8"The seabios pattern matching code isn't that sophisticated - I think this could end up doing something unexpected. Why does it need to change?
If we start a guest with default machine type (pc-i440fx), the prefix of bootindex string is "/pci@i0cf8", if we start guest with -M q35, the prefix will become "/q35-pcihost@i0cf8".
We only match "/pci@i0cf8" in seabios, it causes boot priority of q35 devices could not be changed.
Quoted 8 lines
Quoted 3 lines
We could not change
TYPE_Q35_HOST_DEVICEto 'pci' in qemu to adapt seabios, so fix the pattern.Why couldn't we? QEMU not been able to generate proper device string is QEMU bug.
--
Gleb.
I applied a patch that does just that.
Quoted 43 lines · Michael S. Tsirkin
Quoted 42 lines · Gleb Natapov
Quoted 41 lines · Amos Kong
Quoted 23 lines · Kevin O'Connor
Quoted 22 lines · Amos Kong
Bootindex string passed from qemu:
/q35-pcihost@i0cf8/ethernet@2/ethernet-phy@0We match pci domain by "/pci@i0cf8" in SeaBIOS, but
fw_dev_pathprefix of q35 is "/q35-pcihost@i0cf8". So bootindex in qemu commandline doesn't work if it uses q35 machine type.This patch fixes the pattern to match both original pc-i440fx & q35
Signed-off-by Amos Kong <[email protected]>--- src/boot.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)src/boot.c +0
-0@@ -97,7 +97,7 @@ find_prio(const char *glob)return -1 ; }Quoted 6 lines
src/boot.c find_prio(const char *glob) · line 100
Quoted 2 lines
src/boot.c +1
-1-#define FW_PCI_DOMAIN "/pci@i0cf8" +#define FW_PCI_DOMAIN "/*pci*@i0cf8"The seabios pattern matching code isn't that sophisticated - I think this could end up doing something unexpected. Why does it need to change?
If we start a guest with default machine type (pc-i440fx), the prefix of bootindex string is "/pci@i0cf8", if we start guest with -M q35, the prefix will become "/q35-pcihost@i0cf8".
We only match "/pci@i0cf8" in seabios, it causes boot priority of q35 devices could not be changed.
We could not change
TYPE_Q35_HOST_DEVICEto 'pci' in qemu to adapt seabios, so fix the pattern.
Quoted 8 lines
Quoted 5 lines
Why couldn't we? QEMU not been able to generate proper device string is QEMU bug.
--
Gleb.I applied a patch that does just that.
I noticed :) I have many emails to read :(
--
Gleb.