qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Max Reitz <mreitz@redhat.com>
To: Alberto Garcia <berto@igalia.com>, Kevin Wolf <kwolf@redhat.com>
Cc: qemu-devel@nongnu.org, qemu-block@nongnu.org,
	Eric Blake <eblake@redhat.com>, Jeff Cody <jcody@redhat.com>
Subject: Re: [Qemu-devel] [PATCH v2 02/15] blockjob: Decouple the ID from the device name in the BlockJob struct
Date: Wed, 29 Jun 2016 19:20:55 +0200	[thread overview]
Message-ID: <3f06d73f-676f-f021-e532-7cdb6ccfc75a@redhat.com> (raw)
In-Reply-To: <w51h9ck2hth.fsf@maestria.local.igalia.com>

[-- Attachment #1: Type: text/plain, Size: 3337 bytes --]

On 23.06.2016 14:47, Alberto Garcia wrote:
> On Wed 22 Jun 2016 05:49:28 PM CEST, Kevin Wolf wrote:
>>> I thought adding a new 'ID' field was simpler. The device name is
>>> still a device name (where it makes sense). The default ID is
>>> guaranteed to be valid and guaranteed not to clash with user-defined
>>> IDs. The API is (in my opinion) more clear.
>>>
>>> The only problems that I can think of:
>>>
>>> - BlockJobInfo and the events expose the 'device' field which is
>>>   superfluous.
>>> - block-job-{pause,resume,...} can take an ID or a device name.
>>
>> Yes. There are two parts that I don't like about this.
>>
>> The first one is that we need additional code to keep track of the
>> device name and to look it up.
> 
> I think this part is negligible, but ok.
> 
>> The other, more important one is that it couples block jobs more
>> tightly with a BDS:
>>
>> * What do you with a background job that doesn't have a device name
>>   because it doesn't work on a BDS? Will 'device' become optional
>>   everywhere? But how is this less problematic for compatibility than
>>   returning non-device-name IDs? (To be clear, I don't think either is
>>   a real problem, but you can hardly dismiss one and accept the
>>   other.)
> 
>> * And what do you do once we allow more than one job per device? Then
>>   the device name isn't suitable for addressing the job any more. And
>>   letting the client use the device name after it started the first
>>   job, but not any more after it started the second one, feels wrong.
> 
> Fair enough. Unless Max, Eric or someone else has something else to add
> I'll give it a try and see how it looks.

Sorry for the late response, but then again I don't actually have an
opinion either way.

The thing I feel most strongly about is the issue of storing a general
ID in a field named "device". However, as Kevin hinted at this becoming
irrelevant with John's work on decoupling block jobs from the block layer.

(And it probably will, because we don't want to call e.g.
block-job-pause that way then anymore, so John's probably going to add
newly named commands anyway, even if they do the same as the old ones. I
don't know.)

But this also means that I don't understand the first point of the
second part of what you quoted from Kevin here. I think he's referring
to what qemu returns e.g. in query-block-jobs. But why should
query-block-jobs return non-*block*-jobs? I think it should always omit
all background jobs that are not related to the block layer. Or at least
that would make sense.

The second point of the second part doesn't really strike with me
either. If a client uses the device name to identify a block job, they
should be used to a version of qemu that isn't capable of having more
than one job per device anyway, so they shouldn't launch more than a
single job per device to begin with.


So I don't think any of the pros and cons is a very strong point. I
personally feel like having a single ID field is more natural and making
the device name its default value is very intuitive, but I take issue
with its naming ("device"). So I don't care either way.

(Maybe, aside from John's work, we could get the naming issue out of the
way by introducing something like QMP aliases...?)

Max


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 498 bytes --]

  reply	other threads:[~2016-06-29 17:21 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-22 12:24 [Qemu-devel] [PATCH v2 00/15] Add an 'id' field to block jobs Alberto Garcia
2016-06-22 12:24 ` [Qemu-devel] [PATCH v2 01/15] stream: Fix prototype of stream_start() Alberto Garcia
2016-06-22 12:45   ` Kevin Wolf
2016-06-22 12:24 ` [Qemu-devel] [PATCH v2 02/15] blockjob: Decouple the ID from the device name in the BlockJob struct Alberto Garcia
2016-06-22 12:42   ` Kevin Wolf
2016-06-22 14:42     ` Alberto Garcia
2016-06-22 15:49       ` Kevin Wolf
2016-06-23 12:47         ` Alberto Garcia
2016-06-29 17:20           ` Max Reitz [this message]
2016-06-30 13:03             ` Alberto Garcia
2016-07-01 18:48               ` John Snow
2016-06-22 12:25 ` [Qemu-devel] [PATCH v2 03/15] blockjob: Add block_job_get() Alberto Garcia
2016-06-22 12:45   ` Kevin Wolf
2016-06-22 12:25 ` [Qemu-devel] [PATCH v2 04/15] block: Simplify find_block_job() and make it accept a job ID Alberto Garcia
2016-06-22 12:50   ` Kevin Wolf
2016-06-22 12:25 ` [Qemu-devel] [PATCH v2 05/15] blockjob: Add 'job_id' parameter to block_job_create() Alberto Garcia
2016-06-22 13:10   ` Kevin Wolf
2016-06-22 12:25 ` [Qemu-devel] [PATCH v2 06/15] mirror: Add 'job-id' parameter to 'blockdev-mirror' and 'drive-mirror' Alberto Garcia
2016-06-22 12:25 ` [Qemu-devel] [PATCH v2 07/15] backup: Add 'job-id' parameter to 'blockdev-backup' and 'drive-backup' Alberto Garcia
2016-06-22 12:25 ` [Qemu-devel] [PATCH v2 08/15] stream: Add 'job-id' parameter to 'block-stream' Alberto Garcia
2016-06-22 12:25 ` [Qemu-devel] [PATCH v2 09/15] commit: Add 'job-id' parameter to 'block-commit' Alberto Garcia
2016-06-22 12:25 ` [Qemu-devel] [PATCH v2 10/15] blockjob: Add 'id' parameter to 'block-job-set-speed' Alberto Garcia
2016-06-22 12:25 ` [Qemu-devel] [PATCH v2 11/15] blockjob: Add 'id' parameter to 'block-job-cancel' Alberto Garcia
2016-06-22 12:25 ` [Qemu-devel] [PATCH v2 12/15] blockjob: Add 'id' parameter to 'block-job-pause' Alberto Garcia
2016-06-22 12:25 ` [Qemu-devel] [PATCH v2 13/15] blockjob: Add 'id' parameter to 'block-job-resume' Alberto Garcia
2016-06-22 12:25 ` [Qemu-devel] [PATCH v2 14/15] blockjob: Add 'id' parameter to 'block-job-complete' Alberto Garcia
2016-06-22 12:25 ` [Qemu-devel] [PATCH v2 15/15] blockjob: Add 'id' field to 'BlockJobInfo' and all BLOCK_JOB_* events Alberto Garcia

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3f06d73f-676f-f021-e532-7cdb6ccfc75a@redhat.com \
    --to=mreitz@redhat.com \
    --cc=berto@igalia.com \
    --cc=eblake@redhat.com \
    --cc=jcody@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).