~ubuntu-branches/ubuntu/oneiric/libvirt/oneiric-updates

« back to all changes in this revision

Viewing changes to gnulib/lib/fd-hook.h

  • Committer: Package Import Robot
  • Author(s): Serge Hallyn
  • Date: 2011-05-11 12:29:51 UTC
  • mfrom: (1.2.10) (3.4.30 sid)
  • Revision ID: package-import@ubuntu.com-20110511122951-ku5fk1tv37o5aymm
Tags: 0.9.1-1ubuntu1
* Resynchronize and merge from Debian unstable (LP: #794378). Remaining
  changes:
  - debian/control:
    * set X-Python-Version to 2.7, as 2.6 is not in oneiric.
    * set ubuntu maintainer
    * Build-Depends:
      - remove [linux-any] from all dependencies
      - remove [!linux-any] deps
      - swap libxen to libxen3, qemu to qemu-kvm, and open-iscsi to
        open-iscsi-utils in Build-Depends
      - remove virtualbox-ose Build-Depends
      - add parted and libapparmor-dev Build-Depends
    * convert Vcs-Git to Xs-Debian-Vcs-Git
    * libvirt-bin Depends: move netcat-openbsd, bridge-utils, dnsmasq-base
      (>= 2.46-1), and iptables from Recommends to Depends
    * libvirt-bin Recommends: move qemu to Suggests
    * libvirt-bin Suggests: add apparmor
    * libvirt0 Recommands: move lvm2 to Suggests
  - keep debian/libvirt-bin.apport
  - keep debian/libvirt-bin.cron.daily
  - debian/libvirt-bin.dirs:
    * add apparmor, cron.daily, and apport dirs
  - debian/libvirt-bin.examples:
    * add debian/libvirt-suspendonreboot
  - debian/libvirt-bin.install:
    * add /etc/apparmor.d files
    * add apport hook
  - debian/libvirt-bin.manpages:
    * add debian/libvirt-migrate-qemu-disks.1
  - debian/libvirt-bin.postinst:
    * replace libvirt groupname with libvirtd
    * add each admin user to libvirtd group
    * call apparmor_parser on usr.sbin.libvirtd and
      usr.lib.libvirt.virt-aa-helper
    * call 'libvirt-migrate-qemu-disks -a' after
      libvirt-bin has started if migrating from
      older than 0.8.3-1ubuntu1
  - debian/libvirt-bin.postrm:
    * replace libvirt groupname with libvirtd
    * remove usr.sbin.libvirtd and
      usr.lib.libvirt.virt-aa-helper
  - keep added files under debian/:
    * libvirt-bin.upstart
    * libvirt-migrate-qemu-disks
    * libvirt-migrate-qemu-disks.1
    * libvirt-suspendonreboot
    * apparmor profiles
  - debian/README.Debian:
    * add 'Apparmor Profile' section
    * add 'Disk migration' section
  - debian/rules:
    * move include of debhelper.mk to top of file so DEB_HOST_ARCH_OS
      is defined.
    * don't build with vbox since virtualbox-ose is in universe
      - remove WITH_VBOX, add explicit --without-vbox
    * add --with-apparmor to DEB_CONFIGURE_EXTRA_FLAGS
    * set DEB_DH_INSTALLINIT_ARGS to '--upstart-only'
    * remove unneeded binary-install/libvirt-bin:: and clean::
      sections (they only deal with sysvinit stuff)
    * add build/libvirt-bin:: section to install
      - apparmor files
      - apport hooks
      - libvirt-migrate-qemu-disks
* debian/patches/series:
  - don't apply Disable-CHECKSUM-rule.patch: our iptables can do this
  - don't apply Debian-specific Debianize-libvirt-guests.patch (sysvinit only)
  - don't apply Disable qemu-disable-network.diff.patch
* debian/patches:
  - drop 9007-fix-daemon-conf-ftbfs.patch (looks like it may be fixed)
  - drop patches applied upstream:
    * 9022-drop-booton-when-kernel-specified.patch
    * 9023-fix-lxc-console-hangup.patch
    * 9024-fix-broken-commandtest.patch
    * 9025-Pass-virSecurityManagerPtr-to-virSecurityDAC-Set-Res.patch
    * 9026-security-avoid-memory-leak.patch
    * 9027-CVE-2011-1146.patch
  - keep patches:
    * 9000-delayed_iff_up_bridge.patch
    * 9001-dont_clobber_existing_bridges.patch
    * 9002-better_default_uri_virsh.patch
    * 9003-better-default-arch.patch
    * 9004-libvirtd-group-name.patch
    * 9005-increase-unix-socket-timeout.patch
    * 9006-default-config-test-case.patch
    * 9011-move-ebtables-script.patch (refreshed)
    * 9014-skip-nodeinfotest.patch (modified to make it apply)
    * 9020-lp545795.patch (modified to make it still apply)
    * 9021-fix-uint64_t.patch
    * 9022-allows-lxc-containers-with-lxcguest.patch (renamed, modified
      to make it still apply, and added DEP-3 tags).
  - new patches:
    * 9023-disable-test-poll.patch - don't run broken test-poll

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* -*- buffer-read-only: t -*- vi: set ro: */
 
2
/* DO NOT EDIT! GENERATED AUTOMATICALLY! */
 
3
/* Hook for making making file descriptor functions close(), ioctl() extensible.
 
4
   Copyright (C) 2009-2011 Free Software Foundation, Inc.
 
5
 
 
6
   This program is free software: you can redistribute it and/or modify it
 
7
   under the terms of the GNU Lesser General Public License as published
 
8
   by the Free Software Foundation; either version 2.1 of the License, or
 
9
   (at your option) any later version.
 
10
 
 
11
   This program is distributed in the hope that it will be useful,
 
12
   but WITHOUT ANY WARRANTY; without even the implied warranty of
 
13
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
14
   Lesser General Public License for more details.
 
15
 
 
16
   You should have received a copy of the GNU Lesser General Public License
 
17
   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
18
 
 
19
 
 
20
#ifndef FD_HOOK_H
 
21
#define FD_HOOK_H
 
22
 
 
23
#ifdef __cplusplus
 
24
extern "C" {
 
25
#endif
 
26
 
 
27
 
 
28
/* Currently, this entire code is only needed for the handling of sockets
 
29
   on native Windows platforms.  */
 
30
#if WINDOWS_SOCKETS
 
31
 
 
32
 
 
33
/* Type of function that closes FD.  */
 
34
typedef int (*gl_close_fn) (int fd);
 
35
 
 
36
/* Type of function that applies a control request to FD.  */
 
37
typedef int (*gl_ioctl_fn) (int fd, int request, void *arg);
 
38
 
 
39
/* An element of the list of file descriptor hooks.
 
40
   In CLOS (Common Lisp Object System) speak, it consists of an "around"
 
41
   method for the close() function and an "around" method for the ioctl()
 
42
   function.
 
43
   The fields of this structure are considered private.  */
 
44
struct fd_hook
 
45
{
 
46
  /* Doubly linked list.  */
 
47
  struct fd_hook *private_next;
 
48
  struct fd_hook *private_prev;
 
49
  /* Function that treats the types of FD that it knows about and calls
 
50
     execute_close_hooks (REMAINING_LIST, PRIMARY, FD) as a fallback.  */
 
51
  int (*private_close_fn) (const struct fd_hook *remaining_list,
 
52
                           gl_close_fn primary,
 
53
                           int fd);
 
54
  /* Function that treats the types of FD that it knows about and calls
 
55
     execute_ioctl_hooks (REMAINING_LIST, PRIMARY, FD, REQUEST, ARG) as a
 
56
     fallback.  */
 
57
  int (*private_ioctl_fn) (const struct fd_hook *remaining_list,
 
58
                           gl_ioctl_fn primary,
 
59
                           int fd, int request, void *arg);
 
60
};
 
61
 
 
62
/* This type of function closes FD, applying special knowledge for the FD
 
63
   types it knows about, and calls
 
64
   execute_close_hooks (REMAINING_LIST, PRIMARY, FD)
 
65
   for the other FD types.
 
66
   In CLOS speak, REMAINING_LIST is the remaining list of "around" methods,
 
67
   and PRIMARY is the "primary" method for close().  */
 
68
typedef int (*close_hook_fn) (const struct fd_hook *remaining_list,
 
69
                              gl_close_fn primary,
 
70
                              int fd);
 
71
 
 
72
/* Execute the close hooks in REMAINING_LIST, with PRIMARY as "primary" method.
 
73
   Return 0 or -1, like close() would do.  */
 
74
extern int execute_close_hooks (const struct fd_hook *remaining_list,
 
75
                                gl_close_fn primary,
 
76
                                int fd);
 
77
 
 
78
/* Execute all close hooks, with PRIMARY as "primary" method.
 
79
   Return 0 or -1, like close() would do.  */
 
80
extern int execute_all_close_hooks (gl_close_fn primary, int fd);
 
81
 
 
82
/* This type of function applies a control request to FD, applying special
 
83
   knowledge for the FD types it knows about, and calls
 
84
   execute_ioctl_hooks (REMAINING_LIST, PRIMARY, FD, REQUEST, ARG)
 
85
   for the other FD types.
 
86
   In CLOS speak, REMAINING_LIST is the remaining list of "around" methods,
 
87
   and PRIMARY is the "primary" method for ioctl().  */
 
88
typedef int (*ioctl_hook_fn) (const struct fd_hook *remaining_list,
 
89
                              gl_ioctl_fn primary,
 
90
                              int fd, int request, void *arg);
 
91
 
 
92
/* Execute the ioctl hooks in REMAINING_LIST, with PRIMARY as "primary" method.
 
93
   Return 0 or -1, like ioctl() would do.  */
 
94
extern int execute_ioctl_hooks (const struct fd_hook *remaining_list,
 
95
                                gl_ioctl_fn primary,
 
96
                                int fd, int request, void *arg);
 
97
 
 
98
/* Execute all ioctl hooks, with PRIMARY as "primary" method.
 
99
   Return 0 or -1, like ioctl() would do.  */
 
100
extern int execute_all_ioctl_hooks (gl_ioctl_fn primary,
 
101
                                    int fd, int request, void *arg);
 
102
 
 
103
/* Add a function pair to the list of file descriptor hooks.
 
104
   CLOSE_HOOK and IOCTL_HOOK may be NULL, indicating no change.
 
105
   The LINK variable points to a piece of memory which is guaranteed to be
 
106
   accessible until the corresponding call to unregister_fd_hook.  */
 
107
extern void register_fd_hook (close_hook_fn close_hook, ioctl_hook_fn ioctl_hook,
 
108
                              struct fd_hook *link);
 
109
 
 
110
/* Removes a hook from the list of file descriptor hooks.  */
 
111
extern void unregister_fd_hook (struct fd_hook *link);
 
112
 
 
113
 
 
114
#endif
 
115
 
 
116
 
 
117
#ifdef __cplusplus
 
118
}
 
119
#endif
 
120
 
 
121
#endif /* FD_HOOK_H */