Skip to contentSkip to conversation

qdev: don't add typename to fw_dev_path when get_fw_dev_path isn't implemented

PATCH Superseded Amos Kong 2 participants 2 messages May 28, 2013

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Amos Kong

author
#0 lore raw

PATCH 1/1 qdev: don't add typename to fw_dev_path when get_fw_dev_path isn't implemented

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.

---
 hw/core/qdev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/core/qdev.c +1 -1
index 6985ad8..150255d 100644
@@ -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, "/");
Signature · 1 line
1.8.1.4
#1 lore raw

Il 28/05/2013 12:25, Amos Kong ha scritto:

Quoted 7 lines

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.

Quoted 1 line

You don't need my Signed-off-by. On the other hand, you should Cc [email protected].

Paolo

Quoted 19 lines
---
 hw/core/qdev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/core/qdev.c +1 -1
index 6985ad8..150255d 100644
@@ -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, "/");