[vbox-dev] Question to IHardDiskAttachment

Nikolay Igotti Nikolay.Igotti at Sun.COM
Mon Aug 10 04:12:51 PDT 2009


  Hi Thomas,

Yes, you hit known limitation of Java bridge in 3.0 (fixed in 3.1). 
Structs in .xidl (and IHardDiskAttachment is one of them) is treated 
differently.
Thus your code shall be (for 3.0):
for (String mor : vBox.getHardDiskAttachments())
{
IHardDiskAttachment hda = new IHardDiskAttachment(mor, 
vBox.getRemoteWSPort());
// use hda as usual
}

With 3.1 bindings this issue will be solved, and you can use structs in 
"natural" way.

Thanks,
Nikolay


Thomas Trepper пишет:
> Hi all,
>
> I am trying to show the harddrive-capacity (used/free), but I canot 
> get the harddrive.
>
> I have: (vBox is an IMachine)
>
> for (Iterator<IHardDiskAttachment> j = 
> vBox.getHardDiskAttachments().iterator(); j.hasNext();) {
> IHardDiskAttachment hda = (IHardDiskAttachment)j.next();
> .....?
>
> The manual shows getHardDrive(), but this method returns a String like 
> this: 1fbfdca3ed2e8271-0000000000000087
> Does anybody know, how to get the IHardDrive and the the free and 
> used-size?
>
> Thank you very much in advance
>
> Thomas
>
>
>
>
>
>
>
>
> _______________________________________________
> vbox-dev mailing list
> vbox-dev at virtualbox.org
> http://vbox.innotek.de/mailman/listinfo/vbox-dev





More information about the vbox-dev mailing list