[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2 2/3] monitor: Enable adding an inherited fd t
From: |
Kevin Wolf |
Subject: |
Re: [Qemu-devel] [PATCH v2 2/3] monitor: Enable adding an inherited fd to an fd set |
Date: |
Fri, 12 Oct 2012 10:30:02 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:13.0) Gecko/20120605 Thunderbird/13.0 |
Am 11.10.2012 17:04, schrieb Corey Bryant:
>
>
> On 10/11/2012 07:25 AM, Kevin Wolf wrote:
>> Am 10.10.2012 16:20, schrieb Corey Bryant:
>>> qmp_add_fd() gets an fd that was received over a socket with
>>> SCM_RIGHTS and adds it to an fd set. This patch adds support
>>> that will enable adding an fd that was inherited on the
>>> command line to an fd set.
>>>
>>> This patch also prevents removal of an fd from an fd set during
>>> initialization. This allows the fd to remain in the fd set after
>>> probing of the image file.
>>
>> "This patch also..." usually means that it should be split in two
>> patches. Though in this case I'd vote for immediately dropping the
>> second patch again: This makes the probing work with file descriptors
>> using a hack for a certain situation (namely qemu startup) and leaves
>> other cases (like hotplug) broken.
>
> I don't think hotplug is broken. In that case the fd will only be
> removed from the fd set if the following is true:
>
> (mon_fdset_fd->removed || (QLIST_EMPTY(&mon_fdset->dup_fds) &&
> mon_refcount == 0))
>
> We can ignore the removed part for now. What's important here is that
> if there are no dup_fd references and there is at least one monitor
> connected, an fd will *not* be removed.
Ah yes, that's the part I missed.
Then your approach of special-casing the command line is probably okay,
though I'd still want to change the probing mechanism to avoid the
reopen. Seems I need to find a better excuse to make someone do it. Meh. ;-)
Kevin
- [Qemu-devel] [PATCH v2 0/3] command line fd passing using fd sets, Corey Bryant, 2012/10/10
- [Qemu-devel] [PATCH v2 1/3] monitor: Allow add-fd to any specified fd set, Corey Bryant, 2012/10/10
- [Qemu-devel] [PATCH v2 3/3] qemu-config: Add new -add-fd command line option, Corey Bryant, 2012/10/10
- Re: [Qemu-devel] [libvirt] [PATCH v2 3/3] qemu-config: Add new -add-fd command line option, Eric Blake, 2012/10/11
- Re: [Qemu-devel] [libvirt] [PATCH v2 3/3] qemu-config: Add new -add-fd command line option, Eric Blake, 2012/10/11