mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-11 07:17:44 +00:00
vbox: Make IMediumAttachment work with vbox2.2 and 3.0
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.
This commit is contained in:
parent
0cd409cdb3
commit
3d33e38877
@ -4680,14 +4680,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 */
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user