How to use API to get harddisk size for my guest OS

Discussions related to using the OSE version of VirtualBox.

How to use API to get harddisk size for my guest OS

Postby liupengjian » 14. Oct 2008, 06:08

Hi
Is there anyone knows how to use the API to get the hard disk size used by my guest OS?

e.g. My host is a window XP OS, I installed another WinXP in my VirtualBox and located 10GB for the gest, now I want to use Java webservice API to get the harddisk size which I allocated for the gests XP's disk size (ie. 10GB).

I read the API and find a method might be right for me, but there is little information in the documentation for me to know how can I call it.
In IMachine.java class the API has a method:
public IHardDisk getHardDisk(StorageBus bus, Integer channel, Integer device)
but I dont know how to pass in a StrogeBus object and where to get the Integer channel and the Integer device objects.

Very urgent, please help.
Thanks
liupengjian
 
Posts: 20
Joined: 29. Sep 2008, 03:54

Postby liupengjian » 14. Oct 2008, 10:47

Ok, I got it , we should use IVirtualBox's method getHardDisks(), rather than by using IMachine's function to get the getHardDisk().
liupengjian
 
Posts: 20
Joined: 29. Sep 2008, 03:54


Return to VirtualBox OSE

Who is online

Users browsing this forum: No registered users and 1 guest