[PATCH 14/20] vbox: Make IMediumAttachment work with vbox2.2 and 3.0

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The GetMedium will always return a IHardDisk object them.
In 2.2 and 3.0, it is what GetHardDisk exactly do. In 3.1 and later,
The IMedium is same as IHardDisk.
---
 src/vbox/vbox_tmpl.c          |    9 ++++-----
 src/vbox/vbox_uniformed_api.h |    2 +-
 2 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/src/vbox/vbox_tmpl.c b/src/vbox/vbox_tmpl.c
index 6bb12ef..5af6de1 100644
--- a/src/vbox/vbox_tmpl.c
+++ b/src/vbox/vbox_tmpl.c
@@ -4667,14 +4667,13 @@ _mediumCreateDiffStorage(IMedium *medium ATTRIBUTE_UNUSED,
 }
 
 static nsresult
-_mediumAttachmentGetMedium(IMediumAttachment *mediumAttachment ATTRIBUTE_UNUSED,
-                           IMedium **medium ATTRIBUTE_UNUSED)
+_mediumAttachmentGetMedium(IMediumAttachment *mediumAttachment,
+                           IHardDisk **hardDisk)
 {
 #if VBOX_API_VERSION < 3001000
-    vboxUnsupported();
-    return 0;
+    return mediumAttachment->vtbl->GetHardDisk(mediumAttachment, hardDisk);
 #else /* VBOX_API_VERSION >= 3001000 */
-    return mediumAttachment->vtbl->GetMedium(mediumAttachment, medium);
+    return mediumAttachment->vtbl->GetMedium(mediumAttachment, hardDisk);
 #endif /* VBOX_API_VERSION >= 3001000 */
 }
 
diff --git a/src/vbox/vbox_uniformed_api.h b/src/vbox/vbox_uniformed_api.h
index 781c312..bd59dc4 100644
--- a/src/vbox/vbox_uniformed_api.h
+++ b/src/vbox/vbox_uniformed_api.h
@@ -426,7 +426,7 @@ typedef struct {
 
 /* Functions for IMediumAttachment */
 typedef struct {
-    nsresult (*GetMedium)(IMediumAttachment *mediumAttachment, IMedium **medium);
+    nsresult (*GetMedium)(IMediumAttachment *mediumAttachment, IHardDisk **hardDisk);
     nsresult (*GetController)(IMediumAttachment *mediumAttachment, PRUnichar **controller);
     nsresult (*GetType)(IMediumAttachment *mediumAttachment, PRUint32 *type);
     nsresult (*GetPort)(IMediumAttachment *mediumAttachment, PRInt32 *port);
-- 
1.7.9.5

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]