[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v8 2/7] qapi: Introduce add-fd, remove-fd, query
From: |
Stefan Hajnoczi |
Subject: |
Re: [Qemu-devel] [PATCH v8 2/7] qapi: Introduce add-fd, remove-fd, query-fdsets |
Date: |
Fri, 10 Aug 2012 08:20:16 +0100 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
On Thu, Aug 09, 2012 at 10:10:44PM -0400, Corey Bryant wrote:
> +void qmp_remove_fd(int64_t fdset_id, bool has_fd, int64_t fd, Error **errp)
> +{
> + MonFdset *mon_fdset;
> + MonFdsetFd *mon_fdset_fd;
> + char fd_str[20];
> +
> + QLIST_FOREACH(mon_fdset, &mon_fdsets, next) {
> + if (mon_fdset->id != fdset_id) {
> + continue;
> + }
> + QLIST_FOREACH(mon_fdset_fd, &mon_fdset->fds, next) {
> + if (has_fd && mon_fdset_fd->fd != fd) {
> + continue;
> + }
> + mon_fdset_fd->removed = true;
> + if (has_fd) {
> + break;
> + }
> + }
> + monitor_fdset_cleanup(mon_fdset);
> + return;
> + }
> + snprintf(fd_str, sizeof(fd_str), "%" PRId64, fd);
> + error_set(errp, QERR_FD_NOT_FOUND, fd_str);
fd is optional and may be uninitialized. I think the human-readable
string should be:
if has_fd:
fd_str = '%s:%s' % (fdset_id, fd)
else:
fd_str = '%s' % fdset_id
Otherwise, looks good.
- Re: [Qemu-devel] [PATCH v8 7/7] block: Enable qemu_open/close to work with fd sets, (continued)
Re: [Qemu-devel] [PATCH v8 7/7] block: Enable qemu_open/close to work with fd sets, Kevin Wolf, 2012/08/10
[Qemu-devel] [PATCH v8 1/7] qemu-char: Add MSG_CMSG_CLOEXEC flag to recvmsg, Corey Bryant, 2012/08/09
[Qemu-devel] [PATCH v8 2/7] qapi: Introduce add-fd, remove-fd, query-fdsets, Corey Bryant, 2012/08/09
- Re: [Qemu-devel] [PATCH v8 2/7] qapi: Introduce add-fd, remove-fd, query-fdsets, Eric Blake, 2012/08/10
- Re: [Qemu-devel] [PATCH v8 2/7] qapi: Introduce add-fd, remove-fd, query-fdsets,
Stefan Hajnoczi <=
- Re: [Qemu-devel] [PATCH v8 2/7] qapi: Introduce add-fd, remove-fd, query-fdsets, Kevin Wolf, 2012/08/10
[Qemu-devel] [PATCH v8 6/7] block: Convert close calls to qemu_close, Corey Bryant, 2012/08/09
[Qemu-devel] [PATCH v8 4/7] block: Prevent detection of /dev/fdset/ as floppy, Corey Bryant, 2012/08/09
[Qemu-devel] [PATCH v8 5/7] block: Convert open calls to qemu_open, Corey Bryant, 2012/08/09
Re: [Qemu-devel] [PATCH v8 0/7] file descriptor passing using fd sets, Kevin Wolf, 2012/08/10