* Device assignment hotplug broken
@ 2009-06-25 17:24 Avi Kivity
2009-06-30 5:38 ` Sheng Yang
2009-07-01 16:22 ` [PATCH] Fix up device assignment hotplug and re-enable it Markus Armbruster
0 siblings, 2 replies; 7+ messages in thread
From: Avi Kivity @ 2009-06-25 17:24 UTC (permalink / raw)
To: armbru; +Cc: kvm-devel
The impact of the hotplug changes on device assignment were too
difficult for me to fix up during the merge, so I disabled it
temporarily. Please take a look at qemu-kvm.git commit a3b371477e3.
--
I have a truly marvellous patch that fixes the bug which this
signature is too narrow to contain.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Device assignment hotplug broken
2009-06-25 17:24 Device assignment hotplug broken Avi Kivity
@ 2009-06-30 5:38 ` Sheng Yang
2009-06-30 12:28 ` Markus Armbruster
2009-07-01 16:22 ` [PATCH] Fix up device assignment hotplug and re-enable it Markus Armbruster
1 sibling, 1 reply; 7+ messages in thread
From: Sheng Yang @ 2009-06-30 5:38 UTC (permalink / raw)
To: kvm; +Cc: Avi Kivity, armbru, Anthony Liguori
On Friday 26 June 2009 01:24:03 Avi Kivity wrote:
> The impact of the hotplug changes on device assignment were too
> difficult for me to fix up during the merge, so I disabled it
> temporarily. Please take a look at qemu-kvm.git commit a3b371477e3.
When the device assignment can come back? 4 day passed and no message from
Markus Armbruster till now.
--
regards
Yang, Sheng
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Device assignment hotplug broken
2009-06-30 5:38 ` Sheng Yang
@ 2009-06-30 12:28 ` Markus Armbruster
2009-07-01 1:54 ` Sheng Yang
0 siblings, 1 reply; 7+ messages in thread
From: Markus Armbruster @ 2009-06-30 12:28 UTC (permalink / raw)
To: Sheng Yang; +Cc: kvm, Avi Kivity, Anthony Liguori
Sheng Yang <sheng@linux.intel.com> writes:
> On Friday 26 June 2009 01:24:03 Avi Kivity wrote:
>> The impact of the hotplug changes on device assignment were too
>> difficult for me to fix up during the merge, so I disabled it
>> temporarily. Please take a look at qemu-kvm.git commit a3b371477e3.
>
> When the device assignment can come back? 4 day passed and no message from
> Markus Armbruster till now.
I'm having difficulties testing my patch. If it works for you, please
let me know. Once I'm satisfied it works, I'll post it properly.
diff --git a/hw/device-assignment.c b/hw/device-assignment.c
index e282498..88c3baf 100644
--- a/hw/device-assignment.c
+++ b/hw/device-assignment.c
@@ -1126,9 +1126,8 @@ static int assigned_dev_register_msix_mmio(AssignedDevice *dev)
struct PCIDevice *init_assigned_device(AssignedDevInfo *adev,
const char *devaddr)
{
- printf("init_assigned_device: fix me please\n");
- return NULL;
-#if 0
+ PCIBus *bus;
+ int devfn;
int r;
AssignedDevice *dev;
PCIDevice *pci_dev;
@@ -1138,8 +1137,9 @@ struct PCIDevice *init_assigned_device(AssignedDevInfo *adev,
DEBUG("Registering real physical device %s (bus=%x dev=%x func=%x)\n",
adev->name, adev->bus, adev->dev, adev->func);
+ bus = pci_get_bus_devfn(&devfn, devaddr);
pci_dev = pci_register_device(bus, adev->name,
- sizeof(AssignedDevice), -1, assigned_dev_pci_read_config,
+ sizeof(AssignedDevice), devfn, assigned_dev_pci_read_config,
assigned_dev_pci_write_config);
dev = container_of(pci_dev, AssignedDevice, dev);
@@ -1203,7 +1203,6 @@ assigned_out:
out:
free_assigned_device(adev);
return NULL;
-#endif
}
/*
@@ -1268,7 +1267,7 @@ void add_assigned_devices(PCIBus *bus, const char **devices, int n_devices)
exit(1);
}
- if (!init_assigned_device(adev, bus)) {
+ if (!init_assigned_device(adev, NULL)) {
fprintf(stderr, "Failed to initialize assigned device %s\n",
devices[i]);
exit(1);
diff --git a/hw/pci.c b/hw/pci.c
index 618582a..0107096 100644
--- a/hw/pci.c
+++ b/hw/pci.c
@@ -290,7 +290,7 @@ int pci_read_devaddr(const char *addr, int *domp, int *busp, unsigned *slotp)
return pci_parse_devaddr(devaddr, domp, busp, slotp);
}
-static PCIBus *pci_get_bus_devfn(int *devfnp, const char *devaddr)
+PCIBus *pci_get_bus_devfn(int *devfnp, const char *devaddr)
{
int dom, bus;
unsigned slot;
diff --git a/hw/pci.h b/hw/pci.h
index 7d8df83..a2c3a23 100644
--- a/hw/pci.h
+++ b/hw/pci.h
@@ -239,6 +239,7 @@ int pci_read_devaddr(const char *addr, int *domp, int *busp, unsigned *slotp);
int pci_parse_host_devaddr(const char *addr, int *busp,
int *slotp, int *funcp);
+PCIBus *pci_get_bus_devfn(int *devfnp, const char *devaddr);
void pci_info(Monitor *mon);
PCIBus *pci_bridge_init(PCIBus *bus, int devfn, uint16_t vid, uint16_t did,
--
1.6.2.5
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: Device assignment hotplug broken
2009-06-30 12:28 ` Markus Armbruster
@ 2009-07-01 1:54 ` Sheng Yang
2009-07-01 15:45 ` Markus Armbruster
0 siblings, 1 reply; 7+ messages in thread
From: Sheng Yang @ 2009-07-01 1:54 UTC (permalink / raw)
To: Markus Armbruster; +Cc: kvm, Avi Kivity, Anthony Liguori
On Tuesday 30 June 2009 20:28:08 Markus Armbruster wrote:
> Sheng Yang <sheng@linux.intel.com> writes:
> > On Friday 26 June 2009 01:24:03 Avi Kivity wrote:
> >> The impact of the hotplug changes on device assignment were too
> >> difficult for me to fix up during the merge, so I disabled it
> >> temporarily. Please take a look at qemu-kvm.git commit a3b371477e3.
> >
> > When the device assignment can come back? 4 day passed and no message
> > from Markus Armbruster till now.
>
> I'm having difficulties testing my patch. If it works for you, please
> let me know. Once I'm satisfied it works, I'll post it properly.
Hi Markus
In my (limited) test, the patch works well.
Thanks!
--
regards
Yang, Sheng
> diff --git a/hw/device-assignment.c b/hw/device-assignment.c
> index e282498..88c3baf 100644
> --- a/hw/device-assignment.c
> +++ b/hw/device-assignment.c
> @@ -1126,9 +1126,8 @@ static int
> assigned_dev_register_msix_mmio(AssignedDevice *dev) struct PCIDevice
> *init_assigned_device(AssignedDevInfo *adev,
> const char *devaddr)
> {
> - printf("init_assigned_device: fix me please\n");
> - return NULL;
> -#if 0
> + PCIBus *bus;
> + int devfn;
> int r;
> AssignedDevice *dev;
> PCIDevice *pci_dev;
> @@ -1138,8 +1137,9 @@ struct PCIDevice
> *init_assigned_device(AssignedDevInfo *adev, DEBUG("Registering real
> physical device %s (bus=%x dev=%x func=%x)\n", adev->name, adev->bus,
> adev->dev, adev->func);
>
> + bus = pci_get_bus_devfn(&devfn, devaddr);
> pci_dev = pci_register_device(bus, adev->name,
> - sizeof(AssignedDevice), -1, assigned_dev_pci_read_config,
> + sizeof(AssignedDevice), devfn, assigned_dev_pci_read_config,
> assigned_dev_pci_write_config);
> dev = container_of(pci_dev, AssignedDevice, dev);
>
> @@ -1203,7 +1203,6 @@ assigned_out:
> out:
> free_assigned_device(adev);
> return NULL;
> -#endif
> }
>
> /*
> @@ -1268,7 +1267,7 @@ void add_assigned_devices(PCIBus *bus, const char
> **devices, int n_devices) exit(1);
> }
>
> - if (!init_assigned_device(adev, bus)) {
> + if (!init_assigned_device(adev, NULL)) {
> fprintf(stderr, "Failed to initialize assigned device %s\n",
> devices[i]);
> exit(1);
> diff --git a/hw/pci.c b/hw/pci.c
> index 618582a..0107096 100644
> --- a/hw/pci.c
> +++ b/hw/pci.c
> @@ -290,7 +290,7 @@ int pci_read_devaddr(const char *addr, int *domp, int
> *busp, unsigned *slotp) return pci_parse_devaddr(devaddr, domp, busp,
> slotp);
> }
>
> -static PCIBus *pci_get_bus_devfn(int *devfnp, const char *devaddr)
> +PCIBus *pci_get_bus_devfn(int *devfnp, const char *devaddr)
> {
> int dom, bus;
> unsigned slot;
> diff --git a/hw/pci.h b/hw/pci.h
> index 7d8df83..a2c3a23 100644
> --- a/hw/pci.h
> +++ b/hw/pci.h
> @@ -239,6 +239,7 @@ int pci_read_devaddr(const char *addr, int *domp, int
> *busp, unsigned *slotp);
>
> int pci_parse_host_devaddr(const char *addr, int *busp,
> int *slotp, int *funcp);
> +PCIBus *pci_get_bus_devfn(int *devfnp, const char *devaddr);
>
> void pci_info(Monitor *mon);
> PCIBus *pci_bridge_init(PCIBus *bus, int devfn, uint16_t vid, uint16_t
> did,
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Device assignment hotplug broken
2009-07-01 1:54 ` Sheng Yang
@ 2009-07-01 15:45 ` Markus Armbruster
0 siblings, 0 replies; 7+ messages in thread
From: Markus Armbruster @ 2009-07-01 15:45 UTC (permalink / raw)
To: Sheng Yang; +Cc: kvm, Avi Kivity, Anthony Liguori
Sheng Yang <sheng@linux.intel.com> writes:
> On Tuesday 30 June 2009 20:28:08 Markus Armbruster wrote:
>> Sheng Yang <sheng@linux.intel.com> writes:
>> > On Friday 26 June 2009 01:24:03 Avi Kivity wrote:
>> >> The impact of the hotplug changes on device assignment were too
>> >> difficult for me to fix up during the merge, so I disabled it
>> >> temporarily. Please take a look at qemu-kvm.git commit a3b371477e3.
>> >
>> > When the device assignment can come back? 4 day passed and no message
>> > from Markus Armbruster till now.
>>
>> I'm having difficulties testing my patch. If it works for you, please
>> let me know. Once I'm satisfied it works, I'll post it properly.
>
> Hi Markus
>
> In my (limited) test, the patch works well.
>
> Thanks!
Many thanks for testing this.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH] Fix up device assignment hotplug and re-enable it
2009-06-25 17:24 Device assignment hotplug broken Avi Kivity
2009-06-30 5:38 ` Sheng Yang
@ 2009-07-01 16:22 ` Markus Armbruster
2009-07-02 12:03 ` Avi Kivity
1 sibling, 1 reply; 7+ messages in thread
From: Markus Armbruster @ 2009-07-01 16:22 UTC (permalink / raw)
To: kvm-devel
Disabled in merge commit a3b371477e3.
Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
hw/device-assignment.c | 11 +++++------
hw/pci.c | 2 +-
hw/pci.h | 1 +
3 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/hw/device-assignment.c b/hw/device-assignment.c
index e282498..88c3baf 100644
--- a/hw/device-assignment.c
+++ b/hw/device-assignment.c
@@ -1126,9 +1126,8 @@ static int assigned_dev_register_msix_mmio(AssignedDevice *dev)
struct PCIDevice *init_assigned_device(AssignedDevInfo *adev,
const char *devaddr)
{
- printf("init_assigned_device: fix me please\n");
- return NULL;
-#if 0
+ PCIBus *bus;
+ int devfn;
int r;
AssignedDevice *dev;
PCIDevice *pci_dev;
@@ -1138,8 +1137,9 @@ struct PCIDevice *init_assigned_device(AssignedDevInfo *adev,
DEBUG("Registering real physical device %s (bus=%x dev=%x func=%x)\n",
adev->name, adev->bus, adev->dev, adev->func);
+ bus = pci_get_bus_devfn(&devfn, devaddr);
pci_dev = pci_register_device(bus, adev->name,
- sizeof(AssignedDevice), -1, assigned_dev_pci_read_config,
+ sizeof(AssignedDevice), devfn, assigned_dev_pci_read_config,
assigned_dev_pci_write_config);
dev = container_of(pci_dev, AssignedDevice, dev);
@@ -1203,7 +1203,6 @@ assigned_out:
out:
free_assigned_device(adev);
return NULL;
-#endif
}
/*
@@ -1268,7 +1267,7 @@ void add_assigned_devices(PCIBus *bus, const char **devices, int n_devices)
exit(1);
}
- if (!init_assigned_device(adev, bus)) {
+ if (!init_assigned_device(adev, NULL)) {
fprintf(stderr, "Failed to initialize assigned device %s\n",
devices[i]);
exit(1);
diff --git a/hw/pci.c b/hw/pci.c
index 618582a..0107096 100644
--- a/hw/pci.c
+++ b/hw/pci.c
@@ -290,7 +290,7 @@ int pci_read_devaddr(const char *addr, int *domp, int *busp, unsigned *slotp)
return pci_parse_devaddr(devaddr, domp, busp, slotp);
}
-static PCIBus *pci_get_bus_devfn(int *devfnp, const char *devaddr)
+PCIBus *pci_get_bus_devfn(int *devfnp, const char *devaddr)
{
int dom, bus;
unsigned slot;
diff --git a/hw/pci.h b/hw/pci.h
index 7d8df83..a2c3a23 100644
--- a/hw/pci.h
+++ b/hw/pci.h
@@ -239,6 +239,7 @@ int pci_read_devaddr(const char *addr, int *domp, int *busp, unsigned *slotp);
int pci_parse_host_devaddr(const char *addr, int *busp,
int *slotp, int *funcp);
+PCIBus *pci_get_bus_devfn(int *devfnp, const char *devaddr);
void pci_info(Monitor *mon);
PCIBus *pci_bridge_init(PCIBus *bus, int devfn, uint16_t vid, uint16_t did,
--
1.6.2.5
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH] Fix up device assignment hotplug and re-enable it
2009-07-01 16:22 ` [PATCH] Fix up device assignment hotplug and re-enable it Markus Armbruster
@ 2009-07-02 12:03 ` Avi Kivity
0 siblings, 0 replies; 7+ messages in thread
From: Avi Kivity @ 2009-07-02 12:03 UTC (permalink / raw)
To: Markus Armbruster; +Cc: kvm-devel
On 07/01/2009 07:22 PM, Markus Armbruster wrote:
> Disabled in merge commit a3b371477e3.
>
>
Applied, thanks.
--
error compiling committee.c: too many arguments to function
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2009-07-02 12:01 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-06-25 17:24 Device assignment hotplug broken Avi Kivity
2009-06-30 5:38 ` Sheng Yang
2009-06-30 12:28 ` Markus Armbruster
2009-07-01 1:54 ` Sheng Yang
2009-07-01 15:45 ` Markus Armbruster
2009-07-01 16:22 ` [PATCH] Fix up device assignment hotplug and re-enable it Markus Armbruster
2009-07-02 12:03 ` Avi Kivity
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox