qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>,
	qemu-devel@nongnu.org, qemu-block@nongnu.org
Cc: armbru@redhat.com, dgilbert@redhat.com, pbonzini@redhat.com,
	mreitz@redhat.com, kwolf@redhat.com, den@openvz.org,
	Nikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
Subject: Re: [Qemu-devel] [PATCH v2 3/6] qapi: add nbd-server-remove
Date: Wed, 17 Jan 2018 09:23:30 -0600	[thread overview]
Message-ID: <1e2fd96e-5d07-3c52-33df-cf31490eb6ca@redhat.com> (raw)
In-Reply-To: <79e5851b-f35e-23ea-4842-cc3b1d1e30ee@virtuozzo.com>

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

On 01/17/2018 07:36 AM, Vladimir Sementsov-Ogievskiy wrote:

>>>> looks interesting. what about the following naming?
>>>>
>>>> @mode: possible values:
>>>>                hide - just hide server from new clients, maintain
>>>> existing connections,
>>>>                            remove after all clients disconnected
>>>>                soft - like hide, but answer with ESHUTDOWN for all
>>>> further requests from
>>>>                            existing connections
>>>>                hard - hard disconnect all clients and remove server
>>>>                (default: soft)
>>> Or even a fourth mode that causes an immediate error return without
>>> state change if there are any connected clients, but otherwise removes
>>> the server.
>>>
>>>> new corresponding states of nbd export:
>>>> hidden, shutting_down
>>>>
>>>> and we allow transitions:
>>>>
>>>> normal_execution -> hidden
>>>> normal_execution -> shutting_down
>>>> normal_execution -> exit
>>>> hidden -> shutting_down
>>>> hidden -> exit
>>>> shutting_down -> exit
>>> Seems reasonable.  Are you planning on tackling a respin of this series
>>> incorporating that idea?
>>>
>>
>> yes, will do.
>>
>>
> 
> Discussed with Nikolay.
> For now we actually need only one mode: hard.
> In near future we _may be_ will need your proposed fourth mode (what
> about "safe" name for it ?)

'safe' sounds reasonable.

Of course, if we only have two modes at front ('safe' which returns an
error if a client is connected, and 'hard' which disconnects all clients
immediately; leaving 'hide' and 'soft' for the future), then we don't
have to worry about a state transition or any hidden exports.

A QAPI enum with only two values now is at least extensible in the
future if someone has a need for another mode, and introspectible to
learn which modes are currently supported.

> 
> I was going to implement all 4 modes, but now I doubt, isn't it too
> hastily, to introduce 3 new modes to the
> interface, which we (personally) do not need. May be it is better to
> start from one or two modes.

Starting with just two modes is fine as well.

> 
> Finally what do you think, Eric? Which modes do you need?

'hide' may be interesting for the purpose of connecting a single client,
then hiding the export so no other clients can connect, while waiting
for the first client to take its time.  But right now, I don't have
actual use cases in mind so much as making sure we aren't limiting
ourself from future expansion as needs are identified, so a conservative
choice of just 'safe' and 'hard' for now is reasonable.

> 
> ps: I've created hmp version for 2/6, it will be in v2.
>  also, I'm going to add query-nbd-server, which should list all exports

Sounds good.

> 
> also, about HMP: If I understand correctly, people use it because
> writing qmp command by hand is not very comfortable.
> I have a script (for managing libvirt guest, but it can be adopted for
> qemu or even used for qemu monitor), which allows
> me run qmp commands on vms as easy as:
> 
> |qmp VMNAME query-block-jobs or qmp VMNAME nbd-server-remove name exp1
> mode hard or even |
> 
> |qmp VMNAME blockdev-add id disk driver qcow2 cache {writeback true
> direct true} aio native discard unmap file {driver file filename
> /tmp/somedisk} |||

Yeah, there are various scripting solutions around QMP that can make it
easier; but HMP is often still an easy front-line interface for experiments.

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org


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

  reply	other threads:[~2018-01-17 15:23 UTC|newest]

Thread overview: 49+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-07 15:50 [Qemu-devel] [PATCH v2 0/6] nbd export qmp interface Vladimir Sementsov-Ogievskiy
2017-12-07 15:50 ` [Qemu-devel] [PATCH v2 1/6] nbd/server: add additional assert to nbd_export_put Vladimir Sementsov-Ogievskiy
2018-01-10 16:33   ` Eric Blake
2017-12-07 15:50 ` [Qemu-devel] [PATCH v2 2/6] qapi: add name parameter to nbd-server-add Vladimir Sementsov-Ogievskiy
2017-12-08 17:33   ` Dr. David Alan Gilbert
2017-12-09  9:28     ` Vladimir Sementsov-Ogievskiy
2018-01-09 19:06     ` Eric Blake
2018-01-10 16:01       ` Dr. David Alan Gilbert
2018-01-09 19:28     ` [Qemu-devel] [PATCH v2 2.5/6] hmp: Add name parameter to nbd_server_add Eric Blake
2018-01-11 17:59       ` Dr. David Alan Gilbert
2018-01-11 19:50         ` Eric Blake
2018-01-11 20:11           ` Dr. David Alan Gilbert
2018-01-09 19:05   ` [Qemu-devel] [PATCH v2 2/6] qapi: add name parameter to nbd-server-add Eric Blake
2017-12-07 15:50 ` [Qemu-devel] [PATCH v2 3/6] qapi: add nbd-server-remove Vladimir Sementsov-Ogievskiy
2018-01-09 19:52   ` Eric Blake
2018-01-12  9:47     ` Vladimir Sementsov-Ogievskiy
2018-01-15 15:09       ` Eric Blake
2018-01-15 17:47         ` Vladimir Sementsov-Ogievskiy
2018-01-17 13:36           ` Vladimir Sementsov-Ogievskiy
2018-01-17 15:23             ` Eric Blake [this message]
2018-01-17 15:51               ` Vladimir Sementsov-Ogievskiy
2018-01-17 16:03                 ` Eric Blake
2018-01-17 16:39                   ` Vladimir Sementsov-Ogievskiy
2018-01-26 15:05                     ` Dr. David Alan Gilbert
2018-02-06 15:29                       ` Vladimir Sementsov-Ogievskiy
2018-02-06 16:06                         ` Eric Blake
2018-02-06 17:54                           ` Vladimir Sementsov-Ogievskiy
2018-02-06 18:38                         ` Dr. David Alan Gilbert
2018-02-07  7:14                           ` Markus Armbruster
2017-12-07 15:51 ` [Qemu-devel] [PATCH v2 4/6] iotest 147: add cases to test new @name parameter of nbd-server-add Vladimir Sementsov-Ogievskiy
2018-01-09 20:21   ` Eric Blake
2017-12-07 15:51 ` [Qemu-devel] [PATCH v2 5/6] iotests: implement QemuIoInteractive class Vladimir Sementsov-Ogievskiy
2018-01-09 20:34   ` Eric Blake
2018-01-12 11:56     ` Vladimir Sementsov-Ogievskiy
2018-01-12 16:48       ` Eric Blake
2017-12-07 15:51 ` [Qemu-devel] [PATCH v2 6/6] iotest 201: new test for qmp nbd-server-remove Vladimir Sementsov-Ogievskiy
2018-01-09 20:49   ` Eric Blake
2018-01-12 11:43     ` Vladimir Sementsov-Ogievskiy
2018-01-12 16:54       ` Eric Blake
2018-01-15 14:40         ` Vladimir Sementsov-Ogievskiy
2018-01-15 15:05           ` Eric Blake
2018-01-15 18:28             ` Vladimir Sementsov-Ogievskiy
2017-12-21 11:52 ` [Qemu-devel] ping Re: [PATCH v2 0/6] nbd export qmp interface Vladimir Sementsov-Ogievskiy
2017-12-21 15:28 ` [Qemu-devel] " Markus Armbruster
2017-12-21 18:32   ` Eric Blake
2017-12-22  8:53     ` Vladimir Sementsov-Ogievskiy
2017-12-22 15:47       ` Eric Blake
  -- strict thread matches above, loose matches on Subject: below --
2018-01-18 18:11 Vladimir Sementsov-Ogievskiy
2018-01-18 18:11 ` [Qemu-devel] [PATCH v2 3/6] qapi: add nbd-server-remove Vladimir Sementsov-Ogievskiy
2018-01-18 22:13   ` Eric Blake

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=1e2fd96e-5d07-3c52-33df-cf31490eb6ca@redhat.com \
    --to=eblake@redhat.com \
    --cc=armbru@redhat.com \
    --cc=den@openvz.org \
    --cc=dgilbert@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=nshirokovskiy@virtuozzo.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=vsementsov@virtuozzo.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 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).