On Thu, Feb 19, 2015 at 04:35:45PM +0100, Michal Privoznik wrote:
On 17.02.2015 12:52, Mikhail Feoktistov wrote:
> 1. Delete all boot devices for VM instance
> 2. Find the first HDD from XML and set it as bootable
>
> Now we support only one boot device and it should be HDD
> ---
> src/parallels/parallels_sdk.c | 95 +++++++++++++++++++++++++++++++++++++++--
> 1 files changed, 91 insertions(+), 4 deletions(-)
>
> diff --git a/src/parallels/parallels_sdk.c b/src/parallels/parallels_sdk.c
> index 8660259..15822ab 100644
> --- a/src/parallels/parallels_sdk.c
> +++ b/src/parallels/parallels_sdk.c
> @@ -1987,6 +1987,69 @@ static int prlsdkClearDevices(PRL_HANDLE sdkdom)
> return ret;
> }
>
> +int
static int. This function is used only within the parallels_sdk.c file.
> +prlsdkRemoveBootDevices(PRL_HANDLE sdkdom)
> +{
> + PRL_RESULT pret;
> + PRL_UINT32 devCount;
> + PRL_HANDLE dev = PRL_INVALID_HANDLE;
> + PRL_DEVICE_TYPE devType;
> +
> + pret = PrlVmCfg_GetBootDevCount(sdkdom, &devCount);
> + prlsdkCheckRetGoto(pret, error);
> +
> + for (int i = 0; i < devCount; i++) {
We don't use c99 style of for loops. Moreover, i should be the same type
as devCount.
Actually, 'make syntax-check' enforces that i is only used for variables
of size_t or ssize_t.
Jan