qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 04/47] block: add block_job_query


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH 04/47] block: add block_job_query
Date: Mon, 30 Jul 2012 17:05:40 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:13.0) Gecko/20120615 Thunderbird/13.0.1

Il 30/07/2012 16:47, Kevin Wolf ha scritto:
>> > +BlockJobInfo *block_job_query(BlockJob *job)
>> > +{
>> > +    BlockJobInfo *info = g_new(BlockJobInfo, 1);
>> > +    info->type   = g_strdup(job->job_type->job_type);
>> > +    info->device = g_strdup(bdrv_get_device_name(job->bs));
>> > +    info->len    = job->len;
>> > +    info->offset = job->offset;
>> > +    info->speed  = job->speed;
>> > +    return info;
>> > +}
> Why did you convert the initialisation to separate statement? If you
> really want to do this, I think using g_new0 would be safer now, but I
> actually like compound literals better.

Later on I will have some more initialization beyond the list of fields,
so I preferred an explicit list.  I can change it back if you prefer.

Paolo



reply via email to

[Prev in Thread] Current Thread [Next in Thread]