[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] Re: [PATCHv3 RFC] qemu-kvm: stop devices on vmstop
From: |
Juan Quintela |
Subject: |
[Qemu-devel] Re: [PATCHv3 RFC] qemu-kvm: stop devices on vmstop |
Date: |
Mon, 22 Nov 2010 14:56:08 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) |
"Michael S. Tsirkin" <address@hidden> wrote:
> Stop running devices on vmstop, so that VM does not interact with
> outside world at that time.
>
> Whitelist system handlers which run even when VM is stopped.
> These are specific handlers like monitor, gdbstub, migration.
> I'm not really sure about ui: spice and vnc: do they need to run?
>
> -int qemu_aio_set_fd_handler(int fd,
> +static int qemu_aio_assign_fd_handler(int fd,
> IOHandler *io_read,
> IOHandler *io_write,
> AioFlushHandler *io_flush,
> AioProcessQueue *io_process_queue,
> - void *opaque)
> + void *opaque, bool system)
> {
New names much better O:-)
> - qemu_set_fd_handler2(vs->csock, NULL, vnc_client_read, NULL, vs);
> + qemu_set_systemk_fd_handler(vs->csock, NULL, vnc_client_read, NULL,
> vs);
typo? it would not compile (extra k on syntemk)
> +static inline void call_ioh_fds(IOHandlerRecordList *list,
> + fd_set *rfds, fd_set *wfds)
> +{
> + IOHandlerRecord *ioh, *pioh;
> +
> + QLIST_FOREACH_SAFE(ioh, list, next, pioh) {
> + if (ioh->deleted) {
> + QLIST_REMOVE(ioh, next);
> + qemu_free(ioh);
> + continue;
> + }
> + if (ioh->fd_read && FD_ISSET(ioh->fd, rfds)) {
> + ioh->fd_read(ioh->opaque);
> + if (!(ioh->fd_read_poll && ioh->fd_read_poll(ioh->opaque)))
> + FD_CLR(ioh->fd, rfds);
> + }
> + if (ioh->fd_write && FD_ISSET(ioh->fd, wfds)) {
> + ioh->fd_write(ioh->opaque);
> + }
Notice this loop has been changed to be able that the fd_read to delete
the handle.
> - }
>
> - slirp_select_poll(&rfds, &wfds, &xfds, (ret < 0));
> + slirp_select_poll(&rfds, &wfds, &xfds, (ret < 0));
white space damage?
I haven't tested it either, to know if changing things to the bottom
handler would improve things.
Later, Juan.