[libvirt] [PATCH 3/3] parallels: Set the first HDD from XML as bootable

Ján Tomko jtomko at redhat.com
Thu Feb 19 15:40:53 UTC 2015


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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20150219/5637a83e/attachment-0001.sig>


More information about the libvir-list mailing list