All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: Alberto Garcia <berto@igalia.com>, Kevin Wolf <kwolf@redhat.com>
Cc: Jeff Cody <jcody@redhat.com>,
	qemu-devel@nongnu.org, Stefan Hajnoczi <stefanha@redhat.com>
Subject: Re: [Qemu-devel] [PATCH 2/3] block: Add QMP support for streaming to an intermediate layer
Date: Tue, 17 Mar 2015 09:22:55 -0600	[thread overview]
Message-ID: <550846CF.10706@redhat.com> (raw)
In-Reply-To: <20150317150028.GA21771@igalia.com>

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

On 03/17/2015 09:00 AM, Alberto Garcia wrote:

> The BlockJobInfo object returned by query-block-jobs identifies the
> owner of the job using the 'device' field. If jobs can be in any
> intermediate node then we cannot simply rely on the device name. We
> also cannot simply replace it with a node name because 1) it might not
> exist and 2) existing libvirt versions expect a device name.
> 
> So I see several alternatives:
> 
>    a) Add a new 'node-name' field to BlockJobInfo. It's simple,
>       'device' keeps the current semantics so we don't break
>       compatibility.
> 
>    b) Make 'device' return the device name as it currently does, or
>       the node name if it's not present. The main problem is that
>       libvirt cannot easily know what to expect. On the other hand
>       since both device and node-name share the same namespace the
>       returned value is not ambiguous.

If libvirt is new enough to create the block job via node name instead
of device name, then it is also new enough to expect a node name instead
of device name in the returned job information.  That is, I'm okay with
either:

old libvirt: creates job using 'device' as a device name, status about
the job is reported with 'device' as the device name

new libvirt: creates job using 'device' as a node name, status about the
job is reported with 'device' as the node name

(no new parameter, 'device' is used on both creation and query as a
[poorly-named] device-or-node, back-compat is obvious)


or with:

old libvirt: creates job using 'device' as a device name, status about
the job is reported with 'device' as the device name

new libvirt: creates job using 'node' as a node name, status about the
job is reported with 'node' as the node name

(new parameter; old usage remains the same, and new usage has proper
naming, but now we have to track which name is in use)


> 
>    c) Make 'device' return the same name that was used when the job
>       was created. It's maybe simpler for libvirt than option b),
>       but it would require us to remember how the job was created,
>       possibly in the BlockJob structure. This is personally my least
>       favorite option.

If you're going to reuse 'device' on the creation, then reuse it on the
reporting.

> 
>    d) Create a new query command that returns a different data
>       structure.
> 
> I would opt for a) or b), but I'd like to hear if you have a different
> opinion.

I'm kind of leaning towards b).

> 
> Regarding the 'block-stream' command, I think the current option to
> reuse the 'device' parameter to refer to either a device or a node
> name is ok, so I'll go forward with that one.

Particularly if we don't have two parameters for starting the job, then
we don't need two parameters for reporting it.

> 
>> On the other hand, having an owner BDS for a block job is considered
>> a mistake meanwhile because there is no clear rule which BDS to pick
>> when the job involves more than one.
> 
> Does it really matter as long as all the operations blockers are
> correctly set?
> 
>> In fact, without tying a job to a BDS, it could be just a background
>> job instead of specifically a block job.
> 
> I don't understand what you mean by this.
> 
> Berto
> 
> 

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org


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

  reply	other threads:[~2015-03-17 15:23 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-20 13:53 [Qemu-devel] [PATCH 0/3] Support streaming to an intermediate layer Alberto Garcia
2015-02-20 13:53 ` [Qemu-devel] [PATCH 1/3] block: " Alberto Garcia
2015-03-05 14:04   ` Kevin Wolf
2015-03-05 14:58     ` Alberto Garcia
2015-03-05 15:15       ` Kevin Wolf
2015-03-05 15:47         ` Alberto Garcia
2015-03-12 13:18     ` Alberto Garcia
2015-02-20 13:53 ` [Qemu-devel] [PATCH 2/3] block: Add QMP support for " Alberto Garcia
2015-02-20 22:38   ` Eric Blake
2015-02-23 12:23     ` Alberto Garcia
2015-02-23 13:04       ` Kevin Wolf
2015-02-24 14:08         ` Markus Armbruster
2015-03-05 14:09   ` Kevin Wolf
2015-03-05 15:12     ` Alberto Garcia
2015-03-11 16:38     ` Alberto Garcia
2015-03-12 15:45       ` Kevin Wolf
2015-03-17 15:00         ` Alberto Garcia
2015-03-17 15:22           ` Eric Blake [this message]
2015-03-17 15:40             ` Alberto Garcia
2015-03-17 15:28           ` Kevin Wolf
2015-03-18 12:29         ` Alberto Garcia
2015-02-20 13:53 ` [Qemu-devel] [PATCH 3/3] docs: Document how to stream " Alberto Garcia
2015-02-20 17:34 ` [Qemu-devel] [PATCH 0/3] Support streaming " Eric Blake
2015-02-20 19:05   ` Alberto Garcia
2015-02-20 22:49     ` Eric Blake
2015-02-22 15:08       ` 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=550846CF.10706@redhat.com \
    --to=eblake@redhat.com \
    --cc=berto@igalia.com \
    --cc=jcody@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.