* [Qemu-devel] [PATCH] qdev: don't add typename to fw_dev_path when get_fw_dev_path isn't implemented
@ 2013-05-28 10:25 Amos Kong
2013-05-28 10:30 ` Paolo Bonzini
0 siblings, 1 reply; 2+ messages in thread
From: Amos Kong @ 2013-05-28 10:25 UTC (permalink / raw)
To: qemu-devel; +Cc: pbonzini, aliguori, kevin, seabios
Currently we add typename to fw_dev_path if virtio-bus
doesn't have get_fw_dev_path implementation, the fw_dev_path
passed to seabios is not expected, the typename is redundant.
It causes that bootindex parameter of scsi device doesn't work.
This patch changes the qdev_get_fw_dev_path_helper() to add
nothing if device doesn't have get_fw_dev_path implementation.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Amos Kong <akong@redhat.com>
---
hw/core/qdev.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/core/qdev.c b/hw/core/qdev.c
index 6985ad8..150255d 100644
--- a/hw/core/qdev.c
+++ b/hw/core/qdev.c
@@ -515,7 +515,7 @@ static int qdev_get_fw_dev_path_helper(DeviceState *dev, char *p, int size)
l += snprintf(p + l, size - l, "%s", d);
g_free(d);
} else {
- l += snprintf(p + l, size - l, "%s", object_get_typename(OBJECT(dev)));
+ return l;
}
}
l += snprintf(p + l , size - l, "/");
--
1.8.1.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [Qemu-devel] [PATCH] qdev: don't add typename to fw_dev_path when get_fw_dev_path isn't implemented
2013-05-28 10:25 [Qemu-devel] [PATCH] qdev: don't add typename to fw_dev_path when get_fw_dev_path isn't implemented Amos Kong
@ 2013-05-28 10:30 ` Paolo Bonzini
0 siblings, 0 replies; 2+ messages in thread
From: Paolo Bonzini @ 2013-05-28 10:30 UTC (permalink / raw)
To: Amos Kong; +Cc: aliguori, kevin, seabios, qemu-devel
Il 28/05/2013 12:25, Amos Kong ha scritto:
> Currently we add typename to fw_dev_path if virtio-bus
> doesn't have get_fw_dev_path implementation, the fw_dev_path
> passed to seabios is not expected, the typename is redundant.
> It causes that bootindex parameter of scsi device doesn't work.
>
> This patch changes the qdev_get_fw_dev_path_helper() to add
> nothing if device doesn't have get_fw_dev_path implementation.
This is not enough, because it would change behavior for other buses
that do not have get_fw_dev_path. You also need to add a default
implementation of the callback.
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
You don't need my Signed-off-by. On the other hand, you should Cc
qemu-stable@nongnu.org.
Paolo
> Signed-off-by: Amos Kong <akong@redhat.com>
> ---
> hw/core/qdev.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/hw/core/qdev.c b/hw/core/qdev.c
> index 6985ad8..150255d 100644
> --- a/hw/core/qdev.c
> +++ b/hw/core/qdev.c
> @@ -515,7 +515,7 @@ static int qdev_get_fw_dev_path_helper(DeviceState *dev, char *p, int size)
> l += snprintf(p + l, size - l, "%s", d);
> g_free(d);
> } else {
> - l += snprintf(p + l, size - l, "%s", object_get_typename(OBJECT(dev)));
> + return l;
> }
> }
> l += snprintf(p + l , size - l, "/");
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-05-28 10:31 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-28 10:25 [Qemu-devel] [PATCH] qdev: don't add typename to fw_dev_path when get_fw_dev_path isn't implemented Amos Kong
2013-05-28 10:30 ` Paolo Bonzini
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).