lib: Drop internal virXXXPtr typedefs

Historically, we declared pointer type to our types:

  typedef struct _virXXX virXXX;
  typedef virXXX *virXXXPtr;

But usefulness of such declaration is questionable, at best.
Unfortunately, we can't drop every such declaration - we have to
carry some over, because they are part of public API (e.g.
virDomainPtr). But for internal types - we can do drop them and
use what every other C project uses 'virXXX *'.

This change was generated by a very ugly shell script that
generated sed script which was then called over each file in the
repository. For the shell script refer to the cover letter:

https://listman.redhat.com/archives/libvir-list/2021-March/msg00537.html

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
This commit is contained in:
Michal Privoznik 2021-03-11 08:16:13 +01:00
parent c21f066d61
commit c8238579fb
734 changed files with 29338 additions and 30231 deletions

View File

@ -105,7 +105,7 @@ of leak:
==5414== by 0x34D9021734: (below main) (in /usr/lib64/libc-2.15.so)
In this example, the ``virDomainDefParseXML()`` had an error
path where the ``virDomainVideoDefPtr video`` pointer was not
path where the ``virDomainVideoDef *video`` pointer was not
properly disposed. By simply adding a
``virDomainVideoDefFree(video);`` in the error path, the issue
was resolved.

View File

@ -263,7 +263,7 @@ Implement common handling
If the new API is applicable to more than one driver, it may make sense
to provide some utility routines, or to factor some of the work into the
dispatcher, to avoid reimplementing the same code in every driver. In
the example code, this involved adding a member to the virDomainDefPtr
the example code, this involved adding a member to the virDomainDef
struct for mapping between the XML API addition and the in-memory
representation of a domain, along with updating all clients to use the
new member. Up to this point, there have been no changes to existing

View File

@ -836,7 +836,7 @@ vircommand.h:
::
void virCommandAddEnvFormat(virCommandPtr cmd, const char *format, ...)
void virCommandAddEnvFormat(virCommand *cmd, const char *format, ...)
G_GNUC_PRINTF(2, 3);
This makes it so gcc's -Wformat and -Wformat-security options can

View File

@ -83,7 +83,7 @@
</p>
<pre>
virCommandPtr cmd = virCommandNew("/usr/bin/dnsmasq");
virCommand *cmd = virCommandNew("/usr/bin/dnsmasq");
</pre>
<p>
@ -136,7 +136,7 @@ virCommandAddArgList(cmd, "--domain", "localdomain", NULL);
<p>
This can also be done at the time of initial construction of
the <code>virCommandPtr</code> object:
the <code>virCommand *</code> object:
</p>
<pre>
@ -145,8 +145,8 @@ const char *const args[] = {
"--strict-order", "--except-interface",
"lo", "--domain", "localdomain", NULL
};
virCommandPtr cmd1 = virCommandNewArgs(cmd, args);
virCommandPtr cmd2 = virCommandNewArgList("/usr/bin/dnsmasq",
virCommand *cmd1 = virCommandNewArgs(cmd, args);
virCommand *cmd2 = virCommandNewArgList("/usr/bin/dnsmasq",
"--domain", "localdomain", NULL);
</pre>
@ -537,7 +537,7 @@ if (WEXITSTATUS(status)...) {
<p>
Once the command has been executed, or if execution
has been abandoned, it is necessary to release
resources associated with the <code>virCommandPtr</code>
resources associated with the <code>virCommand *</code>
object. This is done with:
</p>
@ -566,7 +566,7 @@ int runhook(const char *drvstr, const char *id,
{
int ret;
char *path;
virCommandPtr cmd;
virCommand *cmd;
virBuildPath(&amp;path, LIBVIRT_HOOK_DIR, drvstr);

View File

@ -444,21 +444,21 @@ C &lt;-- |32| 8 | 1 | 3 | 1 | 1 | 0 | .o.oOo | &lt;-- S (reply)
</p>
<dl>
<dt><code>virNetSASLContextPtr</code> (virnetsaslcontext.h)</dt>
<dt><code>virNetSASLContext *</code> (virnetsaslcontext.h)</dt>
<dd>The virNetSASLContext APIs maintain SASL state for a network
service (server or client). This is primarily used on the server
to provide an access control list of SASL usernames permitted as
clients.
</dd>
<dt><code>virNetSASLSessionPtr</code> (virnetsaslcontext.h)</dt>
<dt><code>virNetSASLSession *</code> (virnetsaslcontext.h)</dt>
<dd>The virNetSASLSession APIs maintain SASL state for a single
network connection (socket). This is used to perform the multi-step
SASL handshake and perform encryption/decryption of data once
authenticated, via integration with virNetSocket.
</dd>
<dt><code>virNetTLSContextPtr</code> (virnettlscontext.h)</dt>
<dt><code>virNetTLSContext *</code> (virnettlscontext.h)</dt>
<dd>The virNetTLSContext APIs maintain TLS state for a network
service (server or client). This is primarily used on the server
to provide an access control list of x509 distinguished names, as
@ -467,29 +467,29 @@ C &lt;-- |32| 8 | 1 | 3 | 1 | 1 | 0 | .o.oOo | &lt;-- S (reply)
to improve detection of configuration errors.
</dd>
<dt><code>virNetTLSSessionPtr</code> (virnettlscontext.h)</dt>
<dt><code>virNetTLSSession *</code> (virnettlscontext.h)</dt>
<dd>The virNetTLSSession APIs maintain TLS state for a single
network connection (socket). This is used to perform the multi-step
TLS handshake and perform encryption/decryption of data once
authenticated, via integration with virNetSocket.
</dd>
<dt><code>virNetSocketPtr</code> (virnetsocket.h)</dt>
<dt><code>virNetSocket *</code> (virnetsocket.h)</dt>
<dd>The virNetSocket APIs provide a higher level wrapper around
the raw BSD sockets and getaddrinfo APIs. They allow for creation
of both server and client sockets. Data transports supported are
TCP, UNIX, SSH tunnel or external command tunnel. Internally the
TCP socket impl uses the getaddrinfo info APIs to ensure correct
protocol-independent behaviour, thus supporting both IPv4 and IPv6.
The socket APIs can be associated with a virNetSASLSessionPtr or
virNetTLSSessionPtr object to allow seamless encryption/decryption
The socket APIs can be associated with a virNetSASLSession *or
virNetTLSSession *object to allow seamless encryption/decryption
of all writes and reads. For UNIX sockets it is possible to obtain
the remote client user ID and process ID. Integration with the
libvirt event loop also allows use of callbacks for notification
of various I/O conditions
</dd>
<dt><code>virNetMessagePtr</code> (virnetmessage.h)</dt>
<dt><code>virNetMessage *</code> (virnetmessage.h)</dt>
<dd>The virNetMessage APIs provide a wrapper around the libxdr
API calls, to facilitate processing and creation of RPC
packets. There are convenience APIs for encoding/encoding the
@ -498,7 +498,7 @@ C &lt;-- |32| 8 | 1 | 3 | 1 | 1 | 0 | .o.oOo | &lt;-- S (reply)
encoding a virErrorPtr object. There is also a means to
add to/serve from a linked-list queue of messages.</dd>
<dt><code>virNetClientPtr</code> (virnetclient.h)</dt>
<dt><code>virNetClient *</code> (virnetclient.h)</dt>
<dd>The virNetClient APIs provide a way to connect to a
remote server and run one or more RPC protocols over
the connection. Connections can be made over TCP, UNIX
@ -510,7 +510,7 @@ C &lt;-- |32| 8 | 1 | 3 | 1 | 1 | 0 | .o.oOo | &lt;-- S (reply)
being interleaved on the wire as required.
</dd>
<dt><code>virNetClientProgramPtr</code> (virnetclientprogram.h)</dt>
<dt><code>virNetClientProgram *</code> (virnetclientprogram.h)</dt>
<dd>The virNetClientProgram APIs are used to register a
program+version with the connection. This then enables
invocation of method calls, receipt of asynchronous
@ -519,42 +519,42 @@ C &lt;-- |32| 8 | 1 | 3 | 1 | 1 | 0 | .o.oOo | &lt;-- S (reply)
care of dispatching any incoming asynchronous events.
</dd>
<dt><code>virNetClientStreamPtr</code> (virnetclientstream.h)</dt>
<dt><code>virNetClientStream *</code> (virnetclientstream.h)</dt>
<dd>The virNetClientStream APIs are used to control transmission and
receipt of data over a stream active on a client. Streams provide
a low latency, unlimited length, bi-directional raw data exchange
mechanism layered over the RPC connection
</dd>
<dt><code>virNetServerPtr</code> (virnetserver.h)</dt>
<dt><code>virNetServer *</code> (virnetserver.h)</dt>
<dd>The virNetServer APIs are used to manage a network server. A
server exposed one or more programs, over one or more services.
It manages multiple client connections invoking multiple RPC
calls in parallel, with dispatch across multiple worker threads.
</dd>
<dt><code>virNetDaemonPtr</code> (virnetdaemon.h)</dt>
<dt><code>virNetDaemon *</code> (virnetdaemon.h)</dt>
<dd>The virNetDaemon APIs are used to manage a daemon process. A
daemon is a process that might expose one or more servers. It
handles most process-related details, network-related should
be part of the underlying server.
</dd>
<dt><code>virNetServerClientPtr</code> (virnetserverclient.h)</dt>
<dt><code>virNetServerClient *</code> (virnetserverclient.h)</dt>
<dd>The virNetServerClient APIs are used to manage I/O related
to a single client network connection. It handles initial
validation and routing of incoming RPC packets, and transmission
of outgoing packets.
</dd>
<dt><code>virNetServerProgramPtr</code> (virnetserverprogram.h)</dt>
<dt><code>virNetServerProgram *</code> (virnetserverprogram.h)</dt>
<dd>The virNetServerProgram APIs are used to provide the implementation
of a single program/version set. Primarily this includes a set of
callbacks used to actually invoke the APIs corresponding to
program procedure numbers. It is responsible for all the serialization
of payloads to/from XDR.</dd>
<dt><code>virNetServerServicePtr</code> (virnetserverservice.h)</dt>
<dt><code>virNetServerService *</code> (virnetserverservice.h)</dt>
<dd>The virNetServerService APIs are used to connect the server to
one or more network protocols. A single service may involve multiple
sockets (ie both IPv4 and IPv6). A service also has an associated

View File

@ -690,14 +690,14 @@ class Object(GenericObject):
header += ((
"int esxVI_%s_Serialize(esxVI_%s *item, "
" const char *element, "
" virBufferPtr output);\n") %
" virBuffer *output);\n") %
(self.name, self.name))
if self.features & Object.FEATURE__LIST:
header += ((
"int esxVI_%s_SerializeList(esxVI_%s *list, "
" const char *element, "
" virBufferPtr output);\n") %
" virBuffer *output);\n") %
(self.name, self.name))
if self.features & Object.FEATURE__DESERIALIZE:
@ -1083,7 +1083,7 @@ class Enum(Type):
if self.features & Enum.FEATURE__SERIALIZE:
header += ("int esxVI_%s_Serialize(esxVI_%s item, const char *element, "
" virBufferPtr output);\n") \
" virBuffer *output);\n") \
% (self.name, self.name)
if self.features & Enum.FEATURE__DESERIALIZE:

View File

@ -54,7 +54,7 @@ class WmiClass:
header += "#define %s_WQL_SELECT \\\n" % name_upper
header += " \"SELECT * FROM %s \"\n" % self.name
header += "\n"
header += "extern hypervWmiClassInfoPtr %s_WmiInfo;\n\n" % self.name
header += "extern hypervWmiClassInfo *%s_WmiInfo;\n\n" % self.name
header += self._declare_data_structs()
header += self._declare_hypervObject_struct()
@ -128,7 +128,7 @@ class WmiClass:
header = "\n/* must match hypervObject */\n"
header += "struct _%s {\n" % self.name
header += " %s_Data *data;\n" % self.name
header += " hypervWmiClassInfoPtr info;\n"
header += " hypervWmiClassInfo *info;\n"
header += " %s *next;\n" % self.name
header += "};\n"
@ -142,7 +142,7 @@ class WmiClass:
This struct holds info with meta-data needed to make wsman requests for the WMI class.
"""
source = "hypervWmiClassInfoPtr %s_WmiInfo = &(hypervWmiClassInfo) {\n" % self.name
source = "hypervWmiClassInfo *%s_WmiInfo = &(hypervWmiClassInfo) {\n" % self.name
source += " .name = \"%s\",\n" % self.name
source += " .rootUri = %s,\n" % self.uri_info.rootUri
source += " .resourceUri = %s_RESOURCE_URI,\n" % self.name.upper()

View File

@ -23,58 +23,56 @@
#include "conf/domain_conf.h"
#include "access/viraccessmanager.h"
typedef int (*virAccessDriverCheckConnectDrv)(virAccessManagerPtr manager,
typedef int (*virAccessDriverCheckConnectDrv)(virAccessManager *manager,
const char *driverName,
virAccessPermConnect av);
typedef int (*virAccessDriverCheckDomainDrv)(virAccessManagerPtr manager,
typedef int (*virAccessDriverCheckDomainDrv)(virAccessManager *manager,
const char *driverName,
virDomainDefPtr domain,
virDomainDef *domain,
virAccessPermDomain av);
typedef int (*virAccessDriverCheckInterfaceDrv)(virAccessManagerPtr manager,
typedef int (*virAccessDriverCheckInterfaceDrv)(virAccessManager *manager,
const char *driverName,
virInterfaceDefPtr iface,
virInterfaceDef *iface,
virAccessPermInterface av);
typedef int (*virAccessDriverCheckNetworkDrv)(virAccessManagerPtr manager,
typedef int (*virAccessDriverCheckNetworkDrv)(virAccessManager *manager,
const char *driverName,
virNetworkDefPtr network,
virNetworkDef *network,
virAccessPermNetwork av);
typedef int (*virAccessDriverCheckNetworkPortDrv)(virAccessManagerPtr manager,
typedef int (*virAccessDriverCheckNetworkPortDrv)(virAccessManager *manager,
const char *driverName,
virNetworkDefPtr network,
virNetworkPortDefPtr port,
virNetworkDef *network,
virNetworkPortDef *port,
virAccessPermNetworkPort av);
typedef int (*virAccessDriverCheckNodeDeviceDrv)(virAccessManagerPtr manager,
typedef int (*virAccessDriverCheckNodeDeviceDrv)(virAccessManager *manager,
const char *driverName,
virNodeDeviceDefPtr nodedev,
virNodeDeviceDef *nodedev,
virAccessPermNodeDevice av);
typedef int (*virAccessDriverCheckNWFilterDrv)(virAccessManagerPtr manager,
typedef int (*virAccessDriverCheckNWFilterDrv)(virAccessManager *manager,
const char *driverName,
virNWFilterDefPtr nwfilter,
virNWFilterDef *nwfilter,
virAccessPermNWFilter av);
typedef int (*virAccessDriverCheckNWFilterBindingDrv)(virAccessManagerPtr manager,
typedef int (*virAccessDriverCheckNWFilterBindingDrv)(virAccessManager *manager,
const char *driverName,
virNWFilterBindingDefPtr binding,
virNWFilterBindingDef *binding,
virAccessPermNWFilterBinding av);
typedef int (*virAccessDriverCheckSecretDrv)(virAccessManagerPtr manager,
typedef int (*virAccessDriverCheckSecretDrv)(virAccessManager *manager,
const char *driverName,
virSecretDefPtr secret,
virSecretDef *secret,
virAccessPermSecret av);
typedef int (*virAccessDriverCheckStoragePoolDrv)(virAccessManagerPtr manager,
typedef int (*virAccessDriverCheckStoragePoolDrv)(virAccessManager *manager,
const char *driverName,
virStoragePoolDefPtr pool,
virStoragePoolDef *pool,
virAccessPermStoragePool av);
typedef int (*virAccessDriverCheckStorageVolDrv)(virAccessManagerPtr manager,
typedef int (*virAccessDriverCheckStorageVolDrv)(virAccessManager *manager,
const char *driverName,
virStoragePoolDefPtr pool,
virStorageVolDefPtr vol,
virStoragePoolDef *pool,
virStorageVolDef *vol,
virAccessPermStorageVol av);
typedef int (*virAccessDriverSetupDrv)(virAccessManagerPtr manager);
typedef void (*virAccessDriverCleanupDrv)(virAccessManagerPtr manager);
typedef int (*virAccessDriverSetupDrv)(virAccessManager *manager);
typedef void (*virAccessDriverCleanupDrv)(virAccessManager *manager);
typedef struct _virAccessDriver virAccessDriver;
typedef virAccessDriver *virAccessDriverPtr;
struct _virAccessDriver {
size_t privateDataLen;
const char *name;

View File

@ -23,7 +23,7 @@
#include "access/viraccessdrivernop.h"
static int
virAccessDriverNopCheckConnect(virAccessManagerPtr manager G_GNUC_UNUSED,
virAccessDriverNopCheckConnect(virAccessManager *manager G_GNUC_UNUSED,
const char *driverName G_GNUC_UNUSED,
virAccessPermConnect perm G_GNUC_UNUSED)
{
@ -31,92 +31,92 @@ virAccessDriverNopCheckConnect(virAccessManagerPtr manager G_GNUC_UNUSED,
}
static int
virAccessDriverNopCheckDomain(virAccessManagerPtr manager G_GNUC_UNUSED,
virAccessDriverNopCheckDomain(virAccessManager *manager G_GNUC_UNUSED,
const char *driverName G_GNUC_UNUSED,
virDomainDefPtr domain G_GNUC_UNUSED,
virDomainDef *domain G_GNUC_UNUSED,
virAccessPermDomain perm G_GNUC_UNUSED)
{
return 1; /* Allow */
}
static int
virAccessDriverNopCheckInterface(virAccessManagerPtr manager G_GNUC_UNUSED,
virAccessDriverNopCheckInterface(virAccessManager *manager G_GNUC_UNUSED,
const char *driverName G_GNUC_UNUSED,
virInterfaceDefPtr iface G_GNUC_UNUSED,
virInterfaceDef *iface G_GNUC_UNUSED,
virAccessPermInterface perm G_GNUC_UNUSED)
{
return 1; /* Allow */
}
static int
virAccessDriverNopCheckNetwork(virAccessManagerPtr manager G_GNUC_UNUSED,
virAccessDriverNopCheckNetwork(virAccessManager *manager G_GNUC_UNUSED,
const char *driverName G_GNUC_UNUSED,
virNetworkDefPtr network G_GNUC_UNUSED,
virNetworkDef *network G_GNUC_UNUSED,
virAccessPermNetwork perm G_GNUC_UNUSED)
{
return 1; /* Allow */
}
static int
virAccessDriverNopCheckNetworkPort(virAccessManagerPtr manager G_GNUC_UNUSED,
virAccessDriverNopCheckNetworkPort(virAccessManager *manager G_GNUC_UNUSED,
const char *driverName G_GNUC_UNUSED,
virNetworkDefPtr network G_GNUC_UNUSED,
virNetworkPortDefPtr port G_GNUC_UNUSED,
virNetworkDef *network G_GNUC_UNUSED,
virNetworkPortDef *port G_GNUC_UNUSED,
virAccessPermNetworkPort perm G_GNUC_UNUSED)
{
return 1; /* Allow */
}
static int
virAccessDriverNopCheckNodeDevice(virAccessManagerPtr manager G_GNUC_UNUSED,
virAccessDriverNopCheckNodeDevice(virAccessManager *manager G_GNUC_UNUSED,
const char *driverName G_GNUC_UNUSED,
virNodeDeviceDefPtr nodedev G_GNUC_UNUSED,
virNodeDeviceDef *nodedev G_GNUC_UNUSED,
virAccessPermNodeDevice perm G_GNUC_UNUSED)
{
return 1; /* Allow */
}
static int
virAccessDriverNopCheckNWFilter(virAccessManagerPtr manager G_GNUC_UNUSED,
virAccessDriverNopCheckNWFilter(virAccessManager *manager G_GNUC_UNUSED,
const char *driverName G_GNUC_UNUSED,
virNWFilterDefPtr nwfilter G_GNUC_UNUSED,
virNWFilterDef *nwfilter G_GNUC_UNUSED,
virAccessPermNWFilter perm G_GNUC_UNUSED)
{
return 1; /* Allow */
}
static int
virAccessDriverNopCheckNWFilterBinding(virAccessManagerPtr manager G_GNUC_UNUSED,
virAccessDriverNopCheckNWFilterBinding(virAccessManager *manager G_GNUC_UNUSED,
const char *driverName G_GNUC_UNUSED,
virNWFilterBindingDefPtr binding G_GNUC_UNUSED,
virNWFilterBindingDef *binding G_GNUC_UNUSED,
virAccessPermNWFilterBinding perm G_GNUC_UNUSED)
{
return 1; /* Allow */
}
static int
virAccessDriverNopCheckSecret(virAccessManagerPtr manager G_GNUC_UNUSED,
virAccessDriverNopCheckSecret(virAccessManager *manager G_GNUC_UNUSED,
const char *driverName G_GNUC_UNUSED,
virSecretDefPtr secret G_GNUC_UNUSED,
virSecretDef *secret G_GNUC_UNUSED,
virAccessPermSecret perm G_GNUC_UNUSED)
{
return 1; /* Allow */
}
static int
virAccessDriverNopCheckStoragePool(virAccessManagerPtr manager G_GNUC_UNUSED,
virAccessDriverNopCheckStoragePool(virAccessManager *manager G_GNUC_UNUSED,
const char *driverName G_GNUC_UNUSED,
virStoragePoolDefPtr pool G_GNUC_UNUSED,
virStoragePoolDef *pool G_GNUC_UNUSED,
virAccessPermStoragePool perm G_GNUC_UNUSED)
{
return 1; /* Allow */
}
static int
virAccessDriverNopCheckStorageVol(virAccessManagerPtr manager G_GNUC_UNUSED,
virAccessDriverNopCheckStorageVol(virAccessManager *manager G_GNUC_UNUSED,
const char *driverName G_GNUC_UNUSED,
virStoragePoolDefPtr pool G_GNUC_UNUSED,
virStorageVolDefPtr vol G_GNUC_UNUSED,
virStoragePoolDef *pool G_GNUC_UNUSED,
virStorageVolDef *vol G_GNUC_UNUSED,
virAccessPermStorageVol perm G_GNUC_UNUSED)
{
return 1; /* Allow */

View File

@ -40,14 +40,12 @@ VIR_LOG_INIT("access.accessdriverpolkit");
#define VIR_ACCESS_DRIVER_POLKIT_ACTION_PREFIX "org.libvirt.api"
typedef struct _virAccessDriverPolkitPrivate virAccessDriverPolkitPrivate;
typedef virAccessDriverPolkitPrivate *virAccessDriverPolkitPrivatePtr;
struct _virAccessDriverPolkitPrivate {
bool ignore;
};
static void virAccessDriverPolkitCleanup(virAccessManagerPtr manager G_GNUC_UNUSED)
static void virAccessDriverPolkitCleanup(virAccessManager *manager G_GNUC_UNUSED)
{
}
@ -118,7 +116,7 @@ virAccessDriverPolkitGetCaller(const char *actionid,
static int
virAccessDriverPolkitCheck(virAccessManagerPtr manager G_GNUC_UNUSED,
virAccessDriverPolkitCheck(virAccessManager *manager G_GNUC_UNUSED,
const char *typename,
const char *permname,
const char **attrs)
@ -161,7 +159,7 @@ virAccessDriverPolkitCheck(virAccessManagerPtr manager G_GNUC_UNUSED,
static int
virAccessDriverPolkitCheckConnect(virAccessManagerPtr manager,
virAccessDriverPolkitCheckConnect(virAccessManager *manager,
const char *driverName,
virAccessPermConnect perm)
{
@ -177,9 +175,9 @@ virAccessDriverPolkitCheckConnect(virAccessManagerPtr manager,
}
static int
virAccessDriverPolkitCheckDomain(virAccessManagerPtr manager,
virAccessDriverPolkitCheckDomain(virAccessManager *manager,
const char *driverName,
virDomainDefPtr domain,
virDomainDef *domain,
virAccessPermDomain perm)
{
char uuidstr[VIR_UUID_STRING_BUFLEN];
@ -198,9 +196,9 @@ virAccessDriverPolkitCheckDomain(virAccessManagerPtr manager,
}
static int
virAccessDriverPolkitCheckInterface(virAccessManagerPtr manager,
virAccessDriverPolkitCheckInterface(virAccessManager *manager,
const char *driverName,
virInterfaceDefPtr iface,
virInterfaceDef *iface,
virAccessPermInterface perm)
{
const char *attrs[] = {
@ -217,9 +215,9 @@ virAccessDriverPolkitCheckInterface(virAccessManagerPtr manager,
}
static int
virAccessDriverPolkitCheckNetwork(virAccessManagerPtr manager,
virAccessDriverPolkitCheckNetwork(virAccessManager *manager,
const char *driverName,
virNetworkDefPtr network,
virNetworkDef *network,
virAccessPermNetwork perm)
{
char uuidstr[VIR_UUID_STRING_BUFLEN];
@ -238,10 +236,10 @@ virAccessDriverPolkitCheckNetwork(virAccessManagerPtr manager,
}
static int
virAccessDriverPolkitCheckNetworkPort(virAccessManagerPtr manager,
virAccessDriverPolkitCheckNetworkPort(virAccessManager *manager,
const char *driverName,
virNetworkDefPtr network,
virNetworkPortDefPtr port,
virNetworkDef *network,
virNetworkPortDef *port,
virAccessPermNetworkPort perm)
{
char uuidstr1[VIR_UUID_STRING_BUFLEN];
@ -263,9 +261,9 @@ virAccessDriverPolkitCheckNetworkPort(virAccessManagerPtr manager,
}
static int
virAccessDriverPolkitCheckNodeDevice(virAccessManagerPtr manager,
virAccessDriverPolkitCheckNodeDevice(virAccessManager *manager,
const char *driverName,
virNodeDeviceDefPtr nodedev,
virNodeDeviceDef *nodedev,
virAccessPermNodeDevice perm)
{
const char *attrs[] = {
@ -281,9 +279,9 @@ virAccessDriverPolkitCheckNodeDevice(virAccessManagerPtr manager,
}
static int
virAccessDriverPolkitCheckNWFilter(virAccessManagerPtr manager,
virAccessDriverPolkitCheckNWFilter(virAccessManager *manager,
const char *driverName,
virNWFilterDefPtr nwfilter,
virNWFilterDef *nwfilter,
virAccessPermNWFilter perm)
{
char uuidstr[VIR_UUID_STRING_BUFLEN];
@ -302,9 +300,9 @@ virAccessDriverPolkitCheckNWFilter(virAccessManagerPtr manager,
}
static int
virAccessDriverPolkitCheckNWFilterBinding(virAccessManagerPtr manager,
virAccessDriverPolkitCheckNWFilterBinding(virAccessManager *manager,
const char *driverName,
virNWFilterBindingDefPtr binding,
virNWFilterBindingDef *binding,
virAccessPermNWFilterBinding perm)
{
const char *attrs[] = {
@ -322,9 +320,9 @@ virAccessDriverPolkitCheckNWFilterBinding(virAccessManagerPtr manager,
}
static int
virAccessDriverPolkitCheckSecret(virAccessManagerPtr manager,
virAccessDriverPolkitCheckSecret(virAccessManager *manager,
const char *driverName,
virSecretDefPtr secret,
virSecretDef *secret,
virAccessPermSecret perm)
{
char uuidstr[VIR_UUID_STRING_BUFLEN];
@ -400,9 +398,9 @@ virAccessDriverPolkitCheckSecret(virAccessManagerPtr manager,
}
static int
virAccessDriverPolkitCheckStoragePool(virAccessManagerPtr manager,
virAccessDriverPolkitCheckStoragePool(virAccessManager *manager,
const char *driverName,
virStoragePoolDefPtr pool,
virStoragePoolDef *pool,
virAccessPermStoragePool perm)
{
char uuidstr[VIR_UUID_STRING_BUFLEN];
@ -421,10 +419,10 @@ virAccessDriverPolkitCheckStoragePool(virAccessManagerPtr manager,
}
static int
virAccessDriverPolkitCheckStorageVol(virAccessManagerPtr manager,
virAccessDriverPolkitCheckStorageVol(virAccessManager *manager,
const char *driverName,
virStoragePoolDefPtr pool,
virStorageVolDefPtr vol,
virStoragePoolDef *pool,
virStorageVolDef *vol,
virAccessPermStorageVol perm)
{
char uuidstr[VIR_UUID_STRING_BUFLEN];

View File

@ -27,18 +27,16 @@
#define VIR_FROM_THIS VIR_FROM_ACCESS
typedef struct _virAccessDriverStackPrivate virAccessDriverStackPrivate;
typedef virAccessDriverStackPrivate *virAccessDriverStackPrivatePtr;
struct _virAccessDriverStackPrivate {
virAccessManagerPtr *managers;
virAccessManager **managers;
size_t managersLen;
};
int virAccessDriverStackAppend(virAccessManagerPtr manager,
virAccessManagerPtr child)
int virAccessDriverStackAppend(virAccessManager *manager,
virAccessManager *child)
{
virAccessDriverStackPrivatePtr priv = virAccessManagerGetPrivateData(manager);
virAccessDriverStackPrivate *priv = virAccessManagerGetPrivateData(manager);
VIR_EXPAND_N(priv->managers, priv->managersLen, 1);
@ -48,9 +46,9 @@ int virAccessDriverStackAppend(virAccessManagerPtr manager,
}
static void virAccessDriverStackCleanup(virAccessManagerPtr manager)
static void virAccessDriverStackCleanup(virAccessManager *manager)
{
virAccessDriverStackPrivatePtr priv = virAccessManagerGetPrivateData(manager);
virAccessDriverStackPrivate *priv = virAccessManagerGetPrivateData(manager);
size_t i;
for (i = 0; i < priv->managersLen; i++)
@ -60,11 +58,11 @@ static void virAccessDriverStackCleanup(virAccessManagerPtr manager)
static int
virAccessDriverStackCheckConnect(virAccessManagerPtr manager,
virAccessDriverStackCheckConnect(virAccessManager *manager,
const char *driverName,
virAccessPermConnect perm)
{
virAccessDriverStackPrivatePtr priv = virAccessManagerGetPrivateData(manager);
virAccessDriverStackPrivate *priv = virAccessManagerGetPrivateData(manager);
int ret = 1;
size_t i;
@ -82,12 +80,12 @@ virAccessDriverStackCheckConnect(virAccessManagerPtr manager,
}
static int
virAccessDriverStackCheckDomain(virAccessManagerPtr manager,
virAccessDriverStackCheckDomain(virAccessManager *manager,
const char *driverName,
virDomainDefPtr domain,
virDomainDef *domain,
virAccessPermDomain perm)
{
virAccessDriverStackPrivatePtr priv = virAccessManagerGetPrivateData(manager);
virAccessDriverStackPrivate *priv = virAccessManagerGetPrivateData(manager);
int ret = 1;
size_t i;
@ -105,12 +103,12 @@ virAccessDriverStackCheckDomain(virAccessManagerPtr manager,
}
static int
virAccessDriverStackCheckInterface(virAccessManagerPtr manager,
virAccessDriverStackCheckInterface(virAccessManager *manager,
const char *driverName,
virInterfaceDefPtr iface,
virInterfaceDef *iface,
virAccessPermInterface perm)
{
virAccessDriverStackPrivatePtr priv = virAccessManagerGetPrivateData(manager);
virAccessDriverStackPrivate *priv = virAccessManagerGetPrivateData(manager);
int ret = 1;
size_t i;
@ -128,12 +126,12 @@ virAccessDriverStackCheckInterface(virAccessManagerPtr manager,
}
static int
virAccessDriverStackCheckNetwork(virAccessManagerPtr manager,
virAccessDriverStackCheckNetwork(virAccessManager *manager,
const char *driverName,
virNetworkDefPtr network,
virNetworkDef *network,
virAccessPermNetwork perm)
{
virAccessDriverStackPrivatePtr priv = virAccessManagerGetPrivateData(manager);
virAccessDriverStackPrivate *priv = virAccessManagerGetPrivateData(manager);
int ret = 1;
size_t i;
@ -151,13 +149,13 @@ virAccessDriverStackCheckNetwork(virAccessManagerPtr manager,
}
static int
virAccessDriverStackCheckNetworkPort(virAccessManagerPtr manager,
virAccessDriverStackCheckNetworkPort(virAccessManager *manager,
const char *driverName,
virNetworkDefPtr network,
virNetworkPortDefPtr port,
virNetworkDef *network,
virNetworkPortDef *port,
virAccessPermNetworkPort perm)
{
virAccessDriverStackPrivatePtr priv = virAccessManagerGetPrivateData(manager);
virAccessDriverStackPrivate *priv = virAccessManagerGetPrivateData(manager);
int ret = 1;
size_t i;
@ -175,12 +173,12 @@ virAccessDriverStackCheckNetworkPort(virAccessManagerPtr manager,
}
static int
virAccessDriverStackCheckNodeDevice(virAccessManagerPtr manager,
virAccessDriverStackCheckNodeDevice(virAccessManager *manager,
const char *driverName,
virNodeDeviceDefPtr nodedev,
virNodeDeviceDef *nodedev,
virAccessPermNodeDevice perm)
{
virAccessDriverStackPrivatePtr priv = virAccessManagerGetPrivateData(manager);
virAccessDriverStackPrivate *priv = virAccessManagerGetPrivateData(manager);
int ret = 1;
size_t i;
@ -198,12 +196,12 @@ virAccessDriverStackCheckNodeDevice(virAccessManagerPtr manager,
}
static int
virAccessDriverStackCheckNWFilter(virAccessManagerPtr manager,
virAccessDriverStackCheckNWFilter(virAccessManager *manager,
const char *driverName,
virNWFilterDefPtr nwfilter,
virNWFilterDef *nwfilter,
virAccessPermNWFilter perm)
{
virAccessDriverStackPrivatePtr priv = virAccessManagerGetPrivateData(manager);
virAccessDriverStackPrivate *priv = virAccessManagerGetPrivateData(manager);
int ret = 1;
size_t i;
@ -221,12 +219,12 @@ virAccessDriverStackCheckNWFilter(virAccessManagerPtr manager,
}
static int
virAccessDriverStackCheckNWFilterBinding(virAccessManagerPtr manager,
virAccessDriverStackCheckNWFilterBinding(virAccessManager *manager,
const char *driverName,
virNWFilterBindingDefPtr binding,
virNWFilterBindingDef *binding,
virAccessPermNWFilterBinding perm)
{
virAccessDriverStackPrivatePtr priv = virAccessManagerGetPrivateData(manager);
virAccessDriverStackPrivate *priv = virAccessManagerGetPrivateData(manager);
int ret = 1;
size_t i;
@ -244,12 +242,12 @@ virAccessDriverStackCheckNWFilterBinding(virAccessManagerPtr manager,
}
static int
virAccessDriverStackCheckSecret(virAccessManagerPtr manager,
virAccessDriverStackCheckSecret(virAccessManager *manager,
const char *driverName,
virSecretDefPtr secret,
virSecretDef *secret,
virAccessPermSecret perm)
{
virAccessDriverStackPrivatePtr priv = virAccessManagerGetPrivateData(manager);
virAccessDriverStackPrivate *priv = virAccessManagerGetPrivateData(manager);
int ret = 1;
size_t i;
@ -267,12 +265,12 @@ virAccessDriverStackCheckSecret(virAccessManagerPtr manager,
}
static int
virAccessDriverStackCheckStoragePool(virAccessManagerPtr manager,
virAccessDriverStackCheckStoragePool(virAccessManager *manager,
const char *driverName,
virStoragePoolDefPtr pool,
virStoragePoolDef *pool,
virAccessPermStoragePool perm)
{
virAccessDriverStackPrivatePtr priv = virAccessManagerGetPrivateData(manager);
virAccessDriverStackPrivate *priv = virAccessManagerGetPrivateData(manager);
int ret = 1;
size_t i;
@ -290,13 +288,13 @@ virAccessDriverStackCheckStoragePool(virAccessManagerPtr manager,
}
static int
virAccessDriverStackCheckStorageVol(virAccessManagerPtr manager,
virAccessDriverStackCheckStorageVol(virAccessManager *manager,
const char *driverName,
virStoragePoolDefPtr pool,
virStorageVolDefPtr vol,
virStoragePoolDef *pool,
virStorageVolDef *vol,
virAccessPermStorageVol perm)
{
virAccessDriverStackPrivatePtr priv = virAccessManagerGetPrivateData(manager);
virAccessDriverStackPrivate *priv = virAccessManagerGetPrivateData(manager);
int ret = 1;
size_t i;

View File

@ -23,7 +23,7 @@
#include "access/viraccessdriver.h"
int virAccessDriverStackAppend(virAccessManagerPtr manager,
virAccessManagerPtr child);
int virAccessDriverStackAppend(virAccessManager *manager,
virAccessManager *child);
extern virAccessDriver accessDriverStack;

View File

@ -43,12 +43,12 @@ VIR_LOG_INIT("access.accessmanager");
struct _virAccessManager {
virObjectLockable parent;
virAccessDriverPtr drv;
virAccessDriver *drv;
void *privateData;
};
static virClassPtr virAccessManagerClass;
static virAccessManagerPtr virAccessManagerDefault;
static virClass *virAccessManagerClass;
static virAccessManager *virAccessManagerDefault;
static void virAccessManagerDispose(void *obj);
@ -63,7 +63,7 @@ static int virAccessManagerOnceInit(void)
VIR_ONCE_GLOBAL_INIT(virAccessManager);
virAccessManagerPtr virAccessManagerGetDefault(void)
virAccessManager *virAccessManagerGetDefault(void)
{
if (virAccessManagerDefault == NULL) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
@ -75,7 +75,7 @@ virAccessManagerPtr virAccessManagerGetDefault(void)
}
void virAccessManagerSetDefault(virAccessManagerPtr mgr)
void virAccessManagerSetDefault(virAccessManager *mgr)
{
virObjectUnref(virAccessManagerDefault);
@ -83,9 +83,9 @@ void virAccessManagerSetDefault(virAccessManagerPtr mgr)
}
static virAccessManagerPtr virAccessManagerNewDriver(virAccessDriverPtr drv)
static virAccessManager *virAccessManagerNewDriver(virAccessDriver *drv)
{
virAccessManagerPtr mgr;
virAccessManager *mgr;
char *privateData;
if (virAccessManagerInitialize() < 0)
@ -112,7 +112,7 @@ static virAccessManagerPtr virAccessManagerNewDriver(virAccessDriverPtr drv)
}
static virAccessDriverPtr accessDrivers[] = {
static virAccessDriver *accessDrivers[] = {
&accessDriverNop,
#if WITH_POLKIT
&accessDriverPolkit,
@ -120,7 +120,7 @@ static virAccessDriverPtr accessDrivers[] = {
};
static virAccessDriverPtr virAccessManagerFindDriver(const char *name)
static virAccessDriver *virAccessManagerFindDriver(const char *name)
{
size_t i;
for (i = 0; i < G_N_ELEMENTS(accessDrivers); i++) {
@ -132,9 +132,9 @@ static virAccessDriverPtr virAccessManagerFindDriver(const char *name)
}
virAccessManagerPtr virAccessManagerNew(const char *name)
virAccessManager *virAccessManagerNew(const char *name)
{
virAccessDriverPtr drv;
virAccessDriver *drv;
if (virAccessManagerInitialize() < 0)
return NULL;
@ -150,16 +150,16 @@ virAccessManagerPtr virAccessManagerNew(const char *name)
}
virAccessManagerPtr virAccessManagerNewStack(const char **names)
virAccessManager *virAccessManagerNewStack(const char **names)
{
virAccessManagerPtr manager = virAccessManagerNewDriver(&accessDriverStack);
virAccessManager *manager = virAccessManagerNewDriver(&accessDriverStack);
size_t i;
if (!manager)
return NULL;
for (i = 0; names[i] != NULL; i++) {
virAccessManagerPtr child = virAccessManagerNew(names[i]);
virAccessManager *child = virAccessManagerNew(names[i]);
if (!child)
goto error;
@ -178,7 +178,7 @@ virAccessManagerPtr virAccessManagerNewStack(const char **names)
}
void *virAccessManagerGetPrivateData(virAccessManagerPtr mgr)
void *virAccessManagerGetPrivateData(virAccessManager *mgr)
{
return mgr->privateData;
}
@ -186,7 +186,7 @@ void *virAccessManagerGetPrivateData(virAccessManagerPtr mgr)
static void virAccessManagerDispose(void *object)
{
virAccessManagerPtr mgr = object;
virAccessManager *mgr = object;
if (mgr->drv->cleanup)
mgr->drv->cleanup(mgr);
@ -213,7 +213,7 @@ virAccessManagerSanitizeError(int ret,
return ret;
}
int virAccessManagerCheckConnect(virAccessManagerPtr manager,
int virAccessManagerCheckConnect(virAccessManager *manager,
const char *driverName,
virAccessPermConnect perm)
{
@ -228,9 +228,9 @@ int virAccessManagerCheckConnect(virAccessManagerPtr manager,
}
int virAccessManagerCheckDomain(virAccessManagerPtr manager,
int virAccessManagerCheckDomain(virAccessManager *manager,
const char *driverName,
virDomainDefPtr domain,
virDomainDef *domain,
virAccessPermDomain perm)
{
int ret = 0;
@ -243,9 +243,9 @@ int virAccessManagerCheckDomain(virAccessManagerPtr manager,
return virAccessManagerSanitizeError(ret, driverName);
}
int virAccessManagerCheckInterface(virAccessManagerPtr manager,
int virAccessManagerCheckInterface(virAccessManager *manager,
const char *driverName,
virInterfaceDefPtr iface,
virInterfaceDef *iface,
virAccessPermInterface perm)
{
int ret = 0;
@ -258,9 +258,9 @@ int virAccessManagerCheckInterface(virAccessManagerPtr manager,
return virAccessManagerSanitizeError(ret, driverName);
}
int virAccessManagerCheckNetwork(virAccessManagerPtr manager,
int virAccessManagerCheckNetwork(virAccessManager *manager,
const char *driverName,
virNetworkDefPtr network,
virNetworkDef *network,
virAccessPermNetwork perm)
{
int ret = 0;
@ -273,10 +273,10 @@ int virAccessManagerCheckNetwork(virAccessManagerPtr manager,
return virAccessManagerSanitizeError(ret, driverName);
}
int virAccessManagerCheckNetworkPort(virAccessManagerPtr manager,
int virAccessManagerCheckNetworkPort(virAccessManager *manager,
const char *driverName,
virNetworkDefPtr network,
virNetworkPortDefPtr port,
virNetworkDef *network,
virNetworkPortDef *port,
virAccessPermNetworkPort perm)
{
int ret = 0;
@ -289,9 +289,9 @@ int virAccessManagerCheckNetworkPort(virAccessManagerPtr manager,
return virAccessManagerSanitizeError(ret, driverName);
}
int virAccessManagerCheckNodeDevice(virAccessManagerPtr manager,
int virAccessManagerCheckNodeDevice(virAccessManager *manager,
const char *driverName,
virNodeDeviceDefPtr nodedev,
virNodeDeviceDef *nodedev,
virAccessPermNodeDevice perm)
{
int ret = 0;
@ -304,9 +304,9 @@ int virAccessManagerCheckNodeDevice(virAccessManagerPtr manager,
return virAccessManagerSanitizeError(ret, driverName);
}
int virAccessManagerCheckNWFilter(virAccessManagerPtr manager,
int virAccessManagerCheckNWFilter(virAccessManager *manager,
const char *driverName,
virNWFilterDefPtr nwfilter,
virNWFilterDef *nwfilter,
virAccessPermNWFilter perm)
{
int ret = 0;
@ -319,9 +319,9 @@ int virAccessManagerCheckNWFilter(virAccessManagerPtr manager,
return virAccessManagerSanitizeError(ret, driverName);
}
int virAccessManagerCheckNWFilterBinding(virAccessManagerPtr manager,
int virAccessManagerCheckNWFilterBinding(virAccessManager *manager,
const char *driverName,
virNWFilterBindingDefPtr binding,
virNWFilterBindingDef *binding,
virAccessPermNWFilterBinding perm)
{
int ret = 0;
@ -334,9 +334,9 @@ int virAccessManagerCheckNWFilterBinding(virAccessManagerPtr manager,
return virAccessManagerSanitizeError(ret, driverName);
}
int virAccessManagerCheckSecret(virAccessManagerPtr manager,
int virAccessManagerCheckSecret(virAccessManager *manager,
const char *driverName,
virSecretDefPtr secret,
virSecretDef *secret,
virAccessPermSecret perm)
{
int ret = 0;
@ -349,9 +349,9 @@ int virAccessManagerCheckSecret(virAccessManagerPtr manager,
return virAccessManagerSanitizeError(ret, driverName);
}
int virAccessManagerCheckStoragePool(virAccessManagerPtr manager,
int virAccessManagerCheckStoragePool(virAccessManager *manager,
const char *driverName,
virStoragePoolDefPtr pool,
virStoragePoolDef *pool,
virAccessPermStoragePool perm)
{
int ret = 0;
@ -364,10 +364,10 @@ int virAccessManagerCheckStoragePool(virAccessManagerPtr manager,
return virAccessManagerSanitizeError(ret, driverName);
}
int virAccessManagerCheckStorageVol(virAccessManagerPtr manager,
int virAccessManagerCheckStorageVol(virAccessManager *manager,
const char *driverName,
virStoragePoolDefPtr pool,
virStorageVolDefPtr vol,
virStoragePoolDef *pool,
virStorageVolDef *vol,
virAccessPermStorageVol perm)
{
int ret = 0;

View File

@ -33,16 +33,15 @@
#include "access/viraccessperm.h"
typedef struct _virAccessManager virAccessManager;
typedef virAccessManager *virAccessManagerPtr;
virAccessManagerPtr virAccessManagerGetDefault(void);
void virAccessManagerSetDefault(virAccessManagerPtr manager);
virAccessManager *virAccessManagerGetDefault(void);
void virAccessManagerSetDefault(virAccessManager *manager);
virAccessManagerPtr virAccessManagerNew(const char *name);
virAccessManagerPtr virAccessManagerNewStack(const char **names);
virAccessManager *virAccessManagerNew(const char *name);
virAccessManager *virAccessManagerNewStack(const char **names);
void *virAccessManagerGetPrivateData(virAccessManagerPtr manager);
void *virAccessManagerGetPrivateData(virAccessManager *manager);
/*
@ -51,48 +50,48 @@ void *virAccessManagerGetPrivateData(virAccessManagerPtr manager);
* Return 0 on auth deny
* Return 1 on auth allow
*/
int virAccessManagerCheckConnect(virAccessManagerPtr manager,
int virAccessManagerCheckConnect(virAccessManager *manager,
const char *driverName,
virAccessPermConnect perm);
int virAccessManagerCheckDomain(virAccessManagerPtr manager,
int virAccessManagerCheckDomain(virAccessManager *manager,
const char *driverName,
virDomainDefPtr domain,
virDomainDef *domain,
virAccessPermDomain perm);
int virAccessManagerCheckInterface(virAccessManagerPtr manager,
int virAccessManagerCheckInterface(virAccessManager *manager,
const char *driverName,
virInterfaceDefPtr iface,
virInterfaceDef *iface,
virAccessPermInterface perm);
int virAccessManagerCheckNetwork(virAccessManagerPtr manager,
int virAccessManagerCheckNetwork(virAccessManager *manager,
const char *driverName,
virNetworkDefPtr network,
virNetworkDef *network,
virAccessPermNetwork perm);
int virAccessManagerCheckNetworkPort(virAccessManagerPtr manager,
int virAccessManagerCheckNetworkPort(virAccessManager *manager,
const char *driverName,
virNetworkDefPtr network,
virNetworkPortDefPtr port,
virNetworkDef *network,
virNetworkPortDef *port,
virAccessPermNetworkPort perm);
int virAccessManagerCheckNodeDevice(virAccessManagerPtr manager,
int virAccessManagerCheckNodeDevice(virAccessManager *manager,
const char *driverName,
virNodeDeviceDefPtr nodedev,
virNodeDeviceDef *nodedev,
virAccessPermNodeDevice perm);
int virAccessManagerCheckNWFilter(virAccessManagerPtr manager,
int virAccessManagerCheckNWFilter(virAccessManager *manager,
const char *driverName,
virNWFilterDefPtr nwfilter,
virNWFilterDef *nwfilter,
virAccessPermNWFilter perm);
int virAccessManagerCheckNWFilterBinding(virAccessManagerPtr manager,
int virAccessManagerCheckNWFilterBinding(virAccessManager *manager,
const char *driverName,
virNWFilterBindingDefPtr binding,
virNWFilterBindingDef *binding,
virAccessPermNWFilterBinding perm);
int virAccessManagerCheckSecret(virAccessManagerPtr manager,
int virAccessManagerCheckSecret(virAccessManager *manager,
const char *driverName,
virSecretDefPtr secret,
virSecretDef *secret,
virAccessPermSecret perm);
int virAccessManagerCheckStoragePool(virAccessManagerPtr manager,
int virAccessManagerCheckStoragePool(virAccessManager *manager,
const char *driverName,
virStoragePoolDefPtr pool,
virStoragePoolDef *pool,
virAccessPermStoragePool perm);
int virAccessManagerCheckStorageVol(virAccessManagerPtr manager,
int virAccessManagerCheckStorageVol(virAccessManager *manager,
const char *driverName,
virStoragePoolDefPtr pool,
virStorageVolDefPtr vol,
virStoragePoolDef *pool,
virStorageVolDef *vol,
virAccessPermStorageVol perm);

View File

@ -24,22 +24,20 @@
#include "admin_protocol.h"
typedef struct _remoteAdminPriv remoteAdminPriv;
typedef remoteAdminPriv *remoteAdminPrivPtr;
struct _remoteAdminPriv {
virObjectLockable parent;
int counter;
virNetClientPtr client;
virNetClientProgramPtr program;
virNetClient *client;
virNetClientProgram *program;
};
static virClassPtr remoteAdminPrivClass;
static virClass *remoteAdminPrivClass;
static void
remoteAdminPrivDispose(void *opaque)
{
remoteAdminPrivPtr priv = opaque;
remoteAdminPriv *priv = opaque;
virObjectUnref(priv->program);
virObjectUnref(priv->client);
@ -77,7 +75,7 @@ make_nonnull_client(admin_nonnull_client *client_dst,
static int
callFull(virAdmConnectPtr conn G_GNUC_UNUSED,
remoteAdminPrivPtr priv,
remoteAdminPriv *priv,
int *fdin,
size_t fdinlen,
int **fdout,
@ -87,9 +85,9 @@ callFull(virAdmConnectPtr conn G_GNUC_UNUSED,
xdrproc_t ret_filter, char *ret)
{
int rv;
virNetClientProgramPtr prog = priv->program;
virNetClientProgram *prog = priv->program;
int counter = priv->counter++;
virNetClientPtr client = priv->client;
virNetClient *client = priv->client;
/* Unlock, so that if we get any async events/stream data
* while processing the RPC, we don't deadlock when our
@ -130,11 +128,11 @@ call(virAdmConnectPtr conn,
#include "admin_client.h"
static void
remoteAdminClientCloseFunc(virNetClientPtr client G_GNUC_UNUSED,
remoteAdminClientCloseFunc(virNetClient *client G_GNUC_UNUSED,
int reason,
void *opaque)
{
virAdmConnectCloseCallbackDataPtr cbdata = opaque;
virAdmConnectCloseCallbackData *cbdata = opaque;
virObjectLock(cbdata);
@ -151,7 +149,7 @@ static int
remoteAdminConnectOpen(virAdmConnectPtr conn, unsigned int flags)
{
int rv = -1;
remoteAdminPrivPtr priv = conn->privateData;
remoteAdminPriv *priv = conn->privateData;
admin_connect_open_args args;
virObjectLock(priv);
@ -186,7 +184,7 @@ static int
remoteAdminConnectClose(virAdmConnectPtr conn)
{
int rv = -1;
remoteAdminPrivPtr priv = conn->privateData;
remoteAdminPriv *priv = conn->privateData;
virObjectLock(priv);
@ -216,10 +214,10 @@ remoteAdminPrivFree(void *opaque)
virObjectUnref(conn->privateData);
}
static remoteAdminPrivPtr
static remoteAdminPriv *
remoteAdminPrivNew(const char *sock_path)
{
remoteAdminPrivPtr priv = NULL;
remoteAdminPriv *priv = NULL;
if (!(priv = virObjectLockableNew(remoteAdminPrivClass)))
goto error;
@ -248,7 +246,7 @@ remoteAdminServerGetThreadPoolParameters(virAdmServerPtr srv,
unsigned int flags)
{
int rv = -1;
remoteAdminPrivPtr priv = srv->conn->privateData;
remoteAdminPriv *priv = srv->conn->privateData;
admin_server_get_threadpool_parameters_args args;
admin_server_get_threadpool_parameters_ret ret;
@ -263,7 +261,7 @@ remoteAdminServerGetThreadPoolParameters(virAdmServerPtr srv,
(xdrproc_t)xdr_admin_server_get_threadpool_parameters_ret, (char *) &ret) == -1)
goto cleanup;
if (virTypedParamsDeserialize((virTypedParameterRemotePtr) ret.params.params_val,
if (virTypedParamsDeserialize((struct _virTypedParameterRemote *) ret.params.params_val,
ret.params.params_len,
ADMIN_SERVER_THREADPOOL_PARAMETERS_MAX,
params,
@ -285,7 +283,7 @@ remoteAdminServerSetThreadPoolParameters(virAdmServerPtr srv,
unsigned int flags)
{
int rv = -1;
remoteAdminPrivPtr priv = srv->conn->privateData;
remoteAdminPriv *priv = srv->conn->privateData;
admin_server_set_threadpool_parameters_args args;
args.flags = flags;
@ -295,7 +293,7 @@ remoteAdminServerSetThreadPoolParameters(virAdmServerPtr srv,
if (virTypedParamsSerialize(params, nparams,
ADMIN_SERVER_THREADPOOL_PARAMETERS_MAX,
(virTypedParameterRemotePtr *) &args.params.params_val,
(struct _virTypedParameterRemote **) &args.params.params_val,
&args.params.params_len,
0) < 0)
goto cleanup;
@ -308,7 +306,7 @@ remoteAdminServerSetThreadPoolParameters(virAdmServerPtr srv,
rv = 0;
cleanup:
virTypedParamsRemoteFree((virTypedParameterRemotePtr) args.params.params_val,
virTypedParamsRemoteFree((struct _virTypedParameterRemote *) args.params.params_val,
args.params.params_len);
virObjectUnlock(priv);
return rv;
@ -321,7 +319,7 @@ remoteAdminClientGetInfo(virAdmClientPtr client,
unsigned int flags)
{
int rv = -1;
remoteAdminPrivPtr priv = client->srv->conn->privateData;
remoteAdminPriv *priv = client->srv->conn->privateData;
admin_client_get_info_args args;
admin_client_get_info_ret ret;
@ -336,7 +334,7 @@ remoteAdminClientGetInfo(virAdmClientPtr client,
(xdrproc_t)xdr_admin_client_get_info_ret, (char *) &ret) == -1)
goto cleanup;
if (virTypedParamsDeserialize((virTypedParameterRemotePtr) ret.params.params_val,
if (virTypedParamsDeserialize((struct _virTypedParameterRemote *) ret.params.params_val,
ret.params.params_len,
ADMIN_CLIENT_INFO_PARAMETERS_MAX,
params,
@ -360,7 +358,7 @@ remoteAdminServerGetClientLimits(virAdmServerPtr srv,
int rv = -1;
admin_server_get_client_limits_args args;
admin_server_get_client_limits_ret ret;
remoteAdminPrivPtr priv = srv->conn->privateData;
remoteAdminPriv *priv = srv->conn->privateData;
args.flags = flags;
make_nonnull_server(&args.srv, srv);
@ -374,7 +372,7 @@ remoteAdminServerGetClientLimits(virAdmServerPtr srv,
(char *) &ret) == -1)
goto cleanup;
if (virTypedParamsDeserialize((virTypedParameterRemotePtr) ret.params.params_val,
if (virTypedParamsDeserialize((struct _virTypedParameterRemote *) ret.params.params_val,
ret.params.params_len,
ADMIN_SERVER_CLIENT_LIMITS_MAX,
params,
@ -398,7 +396,7 @@ remoteAdminServerSetClientLimits(virAdmServerPtr srv,
{
int rv = -1;
admin_server_set_client_limits_args args;
remoteAdminPrivPtr priv = srv->conn->privateData;
remoteAdminPriv *priv = srv->conn->privateData;
args.flags = flags;
make_nonnull_server(&args.srv, srv);
@ -407,7 +405,7 @@ remoteAdminServerSetClientLimits(virAdmServerPtr srv,
if (virTypedParamsSerialize(params, nparams,
ADMIN_SERVER_CLIENT_LIMITS_MAX,
(virTypedParameterRemotePtr *) &args.params.params_val,
(struct _virTypedParameterRemote **) &args.params.params_val,
&args.params.params_len,
0) < 0)
goto cleanup;
@ -420,7 +418,7 @@ remoteAdminServerSetClientLimits(virAdmServerPtr srv,
rv = 0;
cleanup:
virTypedParamsRemoteFree((virTypedParameterRemotePtr) args.params.params_val,
virTypedParamsRemoteFree((struct _virTypedParameterRemote *) args.params.params_val,
args.params.params_len);
virObjectUnlock(priv);
return rv;
@ -432,7 +430,7 @@ remoteAdminConnectGetLoggingOutputs(virAdmConnectPtr conn,
unsigned int flags)
{
int rv = -1;
remoteAdminPrivPtr priv = conn->privateData;
remoteAdminPriv *priv = conn->privateData;
admin_connect_get_logging_outputs_args args;
admin_connect_get_logging_outputs_ret ret;
@ -467,7 +465,7 @@ remoteAdminConnectGetLoggingFilters(virAdmConnectPtr conn,
unsigned int flags)
{
int rv = -1;
remoteAdminPrivPtr priv = conn->privateData;
remoteAdminPriv *priv = conn->privateData;
admin_connect_get_logging_filters_args args;
admin_connect_get_logging_filters_ret ret;

View File

@ -37,12 +37,12 @@
VIR_LOG_INIT("daemon.admin_server");
int
adminConnectListServers(virNetDaemonPtr dmn,
virNetServerPtr **servers,
adminConnectListServers(virNetDaemon *dmn,
virNetServer ***servers,
unsigned int flags)
{
int ret = -1;
virNetServerPtr *srvs = NULL;
virNetServer **srvs = NULL;
virCheckFlags(0, -1);
@ -58,8 +58,8 @@ adminConnectListServers(virNetDaemonPtr dmn,
return ret;
}
virNetServerPtr
adminConnectLookupServer(virNetDaemonPtr dmn,
virNetServer *
adminConnectLookupServer(virNetDaemon *dmn,
const char *name,
unsigned int flags)
{
@ -69,7 +69,7 @@ adminConnectLookupServer(virNetDaemonPtr dmn,
}
int
adminServerGetThreadPoolParameters(virNetServerPtr srv,
adminServerGetThreadPoolParameters(virNetServer *srv,
virTypedParameterPtr *params,
int *nparams,
unsigned int flags)
@ -123,7 +123,7 @@ adminServerGetThreadPoolParameters(virNetServerPtr srv,
}
int
adminServerSetThreadPoolParameters(virNetServerPtr srv,
adminServerSetThreadPoolParameters(virNetServer *srv,
virTypedParameterPtr params,
int nparams,
unsigned int flags)
@ -165,12 +165,12 @@ adminServerSetThreadPoolParameters(virNetServerPtr srv,
}
int
adminServerListClients(virNetServerPtr srv,
virNetServerClientPtr **clients,
adminServerListClients(virNetServer *srv,
virNetServerClient ***clients,
unsigned int flags)
{
int ret = -1;
virNetServerClientPtr *clts;
virNetServerClient **clts;
virCheckFlags(0, -1);
@ -185,8 +185,8 @@ adminServerListClients(virNetServerPtr srv,
return ret;
}
virNetServerClientPtr
adminServerLookupClient(virNetServerPtr srv,
virNetServerClient *
adminServerLookupClient(virNetServer *srv,
unsigned long long id,
unsigned int flags)
{
@ -196,7 +196,7 @@ adminServerLookupClient(virNetServerPtr srv,
}
int
adminClientGetInfo(virNetServerClientPtr client,
adminClientGetInfo(virNetServerClient *client,
virTypedParameterPtr *params,
int *nparams,
unsigned int flags)
@ -287,7 +287,7 @@ adminClientGetInfo(virNetServerClientPtr client,
return 0;
}
int adminClientClose(virNetServerClientPtr client,
int adminClientClose(virNetServerClient *client,
unsigned int flags)
{
virCheckFlags(0, -1);
@ -297,7 +297,7 @@ int adminClientClose(virNetServerClientPtr client,
}
int
adminServerGetClientLimits(virNetServerPtr srv,
adminServerGetClientLimits(virNetServer *srv,
virTypedParameterPtr *params,
int *nparams,
unsigned int flags)
@ -332,7 +332,7 @@ adminServerGetClientLimits(virNetServerPtr srv,
}
int
adminServerSetClientLimits(virNetServerPtr srv,
adminServerSetClientLimits(virNetServer *srv,
virTypedParameterPtr params,
int nparams,
unsigned int flags)
@ -367,7 +367,7 @@ adminServerSetClientLimits(virNetServerPtr srv,
}
int
adminServerUpdateTlsFiles(virNetServerPtr srv,
adminServerUpdateTlsFiles(virNetServer *srv,
unsigned int flags)
{
virCheckFlags(0, -1);

View File

@ -23,50 +23,50 @@
#include "rpc/virnetdaemon.h"
#include "rpc/virnetserver.h"
int adminConnectListServers(virNetDaemonPtr dmn,
virNetServerPtr **servers,
int adminConnectListServers(virNetDaemon *dmn,
virNetServer ***servers,
unsigned int flags);
virNetServerPtr adminConnectLookupServer(virNetDaemonPtr dmn,
virNetServer *adminConnectLookupServer(virNetDaemon *dmn,
const char *name,
unsigned int flags);
int
adminServerGetThreadPoolParameters(virNetServerPtr srv,
adminServerGetThreadPoolParameters(virNetServer *srv,
virTypedParameterPtr *params,
int *nparams,
unsigned int flags);
int
adminServerSetThreadPoolParameters(virNetServerPtr srv,
adminServerSetThreadPoolParameters(virNetServer *srv,
virTypedParameterPtr params,
int nparams,
unsigned int flags);
int adminServerListClients(virNetServerPtr srv,
virNetServerClientPtr **clients,
int adminServerListClients(virNetServer *srv,
virNetServerClient ***clients,
unsigned int flags);
virNetServerClientPtr adminServerLookupClient(virNetServerPtr srv,
virNetServerClient *adminServerLookupClient(virNetServer *srv,
unsigned long long id,
unsigned int flags);
int adminClientGetInfo(virNetServerClientPtr client,
int adminClientGetInfo(virNetServerClient *client,
virTypedParameterPtr *params,
int *nparams,
unsigned int flags);
int adminClientClose(virNetServerClientPtr client,
int adminClientClose(virNetServerClient *client,
unsigned int flags);
int adminServerGetClientLimits(virNetServerPtr srv,
int adminServerGetClientLimits(virNetServer *srv,
virTypedParameterPtr *params,
int *nparams,
unsigned int flags);
int adminServerSetClientLimits(virNetServerPtr srv,
int adminServerSetClientLimits(virNetServer *srv,
virTypedParameterPtr params,
int nparams,
unsigned int flags);
int adminServerUpdateTlsFiles(virNetServerPtr srv,
int adminServerUpdateTlsFiles(virNetServer *srv,
unsigned int flags);

View File

@ -41,13 +41,12 @@
VIR_LOG_INIT("daemon.admin");
typedef struct daemonAdmClientPrivate daemonAdmClientPrivate;
typedef daemonAdmClientPrivate *daemonAdmClientPrivatePtr;
/* Separate private data for admin connection */
struct daemonAdmClientPrivate {
/* Just a placeholder, not that there is anything to be locked */
virMutex lock;
virNetDaemonPtr dmn;
virNetDaemon *dmn;
};
void
@ -61,7 +60,7 @@ remoteAdmClientFree(void *data)
}
void *
remoteAdmClientNew(virNetServerClientPtr client G_GNUC_UNUSED,
remoteAdmClientNew(virNetServerClient *client G_GNUC_UNUSED,
void *opaque)
{
struct daemonAdmClientPrivate *priv;
@ -106,17 +105,17 @@ remoteAdmClientNew(virNetServerClientPtr client G_GNUC_UNUSED,
return priv;
}
void *remoteAdmClientNewPostExecRestart(virNetServerClientPtr client,
virJSONValuePtr object G_GNUC_UNUSED,
void *remoteAdmClientNewPostExecRestart(virNetServerClient *client,
virJSONValue *object G_GNUC_UNUSED,
void *opaque)
{
return remoteAdmClientNew(client, opaque);
}
virJSONValuePtr remoteAdmClientPreExecRestart(virNetServerClientPtr client G_GNUC_UNUSED,
void *data G_GNUC_UNUSED)
virJSONValue *remoteAdmClientPreExecRestart(virNetServerClient *client G_GNUC_UNUSED,
void *data G_GNUC_UNUSED)
{
virJSONValuePtr object = virJSONValueNewObject();
virJSONValue *object = virJSONValueNewObject();
/* No content to add at this time - just need empty object */
@ -126,28 +125,28 @@ virJSONValuePtr remoteAdmClientPreExecRestart(virNetServerClientPtr client G_GNU
/* Helpers */
static virNetServerPtr
get_nonnull_server(virNetDaemonPtr dmn, admin_nonnull_server srv)
static virNetServer *
get_nonnull_server(virNetDaemon *dmn, admin_nonnull_server srv)
{
return virNetDaemonGetServer(dmn, srv.name);
}
static void
make_nonnull_server(admin_nonnull_server *srv_dst,
virNetServerPtr srv_src)
virNetServer *srv_src)
{
srv_dst->name = g_strdup(virNetServerGetName(srv_src));
}
static virNetServerClientPtr
get_nonnull_client(virNetServerPtr srv, admin_nonnull_client clnt)
static virNetServerClient *
get_nonnull_client(virNetServer *srv, admin_nonnull_client clnt)
{
return virNetServerGetClient(srv, clnt.id);
}
static void
make_nonnull_client(admin_nonnull_client *clt_dst,
virNetServerClientPtr clt_src)
virNetServerClient *clt_src)
{
clt_dst->id = virNetServerClientGetID(clt_src);
clt_dst->timestamp = virNetServerClientGetTimestamp(clt_src);
@ -156,10 +155,10 @@ make_nonnull_client(admin_nonnull_client *clt_dst,
/* Functions */
static int
adminDispatchConnectOpen(virNetServerPtr server G_GNUC_UNUSED,
virNetServerClientPtr client,
virNetMessagePtr msg G_GNUC_UNUSED,
virNetMessageErrorPtr rerr,
adminDispatchConnectOpen(virNetServer *server G_GNUC_UNUSED,
virNetServerClient *client,
virNetMessage *msg G_GNUC_UNUSED,
struct virNetMessageError *rerr,
struct admin_connect_open_args *args)
{
unsigned int flags;
@ -182,17 +181,17 @@ adminDispatchConnectOpen(virNetServerPtr server G_GNUC_UNUSED,
}
static int
adminDispatchConnectClose(virNetServerPtr server G_GNUC_UNUSED,
virNetServerClientPtr client,
virNetMessagePtr msg G_GNUC_UNUSED,
virNetMessageErrorPtr rerr G_GNUC_UNUSED)
adminDispatchConnectClose(virNetServer *server G_GNUC_UNUSED,
virNetServerClient *client,
virNetMessage *msg G_GNUC_UNUSED,
struct virNetMessageError *rerr G_GNUC_UNUSED)
{
virNetServerClientDelayedClose(client);
return 0;
}
static int
adminConnectGetLibVersion(virNetDaemonPtr dmn G_GNUC_UNUSED,
adminConnectGetLibVersion(virNetDaemon *dmn G_GNUC_UNUSED,
unsigned long long *libVer)
{
if (libVer)
@ -200,8 +199,8 @@ adminConnectGetLibVersion(virNetDaemonPtr dmn G_GNUC_UNUSED,
return 0;
}
static virNetDaemonPtr
adminGetConn(virNetServerClientPtr client)
static virNetDaemon *
adminGetConn(virNetServerClient *client)
{
struct daemonAdmClientPrivate *priv =
virNetServerClientGetPrivateData(client);
@ -210,15 +209,15 @@ adminGetConn(virNetServerClientPtr client)
}
static int
adminDispatchServerGetThreadpoolParameters(virNetServerPtr server G_GNUC_UNUSED,
virNetServerClientPtr client,
virNetMessagePtr msg G_GNUC_UNUSED,
virNetMessageErrorPtr rerr,
adminDispatchServerGetThreadpoolParameters(virNetServer *server G_GNUC_UNUSED,
virNetServerClient *client,
virNetMessage *msg G_GNUC_UNUSED,
struct virNetMessageError *rerr,
struct admin_server_get_threadpool_parameters_args *args,
struct admin_server_get_threadpool_parameters_ret *ret)
{
int rv = -1;
virNetServerPtr srv = NULL;
virNetServer *srv = NULL;
virTypedParameterPtr params = NULL;
int nparams = 0;
struct daemonAdmClientPrivate *priv =
@ -233,7 +232,7 @@ adminDispatchServerGetThreadpoolParameters(virNetServerPtr server G_GNUC_UNUSED,
if (virTypedParamsSerialize(params, nparams,
ADMIN_SERVER_THREADPOOL_PARAMETERS_MAX,
(virTypedParameterRemotePtr *) &ret->params.params_val,
(struct _virTypedParameterRemote **) &ret->params.params_val,
&ret->params.params_len, 0) < 0)
goto cleanup;
@ -248,14 +247,14 @@ adminDispatchServerGetThreadpoolParameters(virNetServerPtr server G_GNUC_UNUSED,
}
static int
adminDispatchServerSetThreadpoolParameters(virNetServerPtr server G_GNUC_UNUSED,
virNetServerClientPtr client,
virNetMessagePtr msg G_GNUC_UNUSED,
virNetMessageErrorPtr rerr,
adminDispatchServerSetThreadpoolParameters(virNetServer *server G_GNUC_UNUSED,
virNetServerClient *client,
virNetMessage *msg G_GNUC_UNUSED,
struct virNetMessageError *rerr,
struct admin_server_set_threadpool_parameters_args *args)
{
int rv = -1;
virNetServerPtr srv = NULL;
virNetServer *srv = NULL;
virTypedParameterPtr params = NULL;
int nparams = 0;
struct daemonAdmClientPrivate *priv =
@ -268,7 +267,7 @@ adminDispatchServerSetThreadpoolParameters(virNetServerPtr server G_GNUC_UNUSED,
goto cleanup;
}
if (virTypedParamsDeserialize((virTypedParameterRemotePtr) args->params.params_val,
if (virTypedParamsDeserialize((struct _virTypedParameterRemote *) args->params.params_val,
args->params.params_len,
ADMIN_SERVER_THREADPOOL_PARAMETERS_MAX,
&params,
@ -291,16 +290,16 @@ adminDispatchServerSetThreadpoolParameters(virNetServerPtr server G_GNUC_UNUSED,
}
static int
adminDispatchClientGetInfo(virNetServerPtr server G_GNUC_UNUSED,
virNetServerClientPtr client,
virNetMessagePtr msg G_GNUC_UNUSED,
virNetMessageErrorPtr rerr,
adminDispatchClientGetInfo(virNetServer *server G_GNUC_UNUSED,
virNetServerClient *client,
virNetMessage *msg G_GNUC_UNUSED,
struct virNetMessageError *rerr,
struct admin_client_get_info_args *args,
struct admin_client_get_info_ret *ret)
{
int rv = -1;
virNetServerPtr srv = NULL;
virNetServerClientPtr clnt = NULL;
virNetServer *srv = NULL;
virNetServerClient *clnt = NULL;
virTypedParameterPtr params = NULL;
int nparams = 0;
struct daemonAdmClientPrivate *priv =
@ -325,7 +324,7 @@ adminDispatchClientGetInfo(virNetServerPtr server G_GNUC_UNUSED,
if (virTypedParamsSerialize(params, nparams,
ADMIN_CLIENT_INFO_PARAMETERS_MAX,
(virTypedParameterRemotePtr *) &ret->params.params_val,
(struct _virTypedParameterRemote **) &ret->params.params_val,
&ret->params.params_len,
VIR_TYPED_PARAM_STRING_OKAY) < 0)
goto cleanup;
@ -343,15 +342,15 @@ adminDispatchClientGetInfo(virNetServerPtr server G_GNUC_UNUSED,
}
static int
adminDispatchServerGetClientLimits(virNetServerPtr server G_GNUC_UNUSED,
virNetServerClientPtr client,
virNetMessagePtr msg G_GNUC_UNUSED,
virNetMessageErrorPtr rerr G_GNUC_UNUSED,
adminDispatchServerGetClientLimits(virNetServer *server G_GNUC_UNUSED,
virNetServerClient *client,
virNetMessage *msg G_GNUC_UNUSED,
struct virNetMessageError *rerr G_GNUC_UNUSED,
admin_server_get_client_limits_args *args,
admin_server_get_client_limits_ret *ret)
{
int rv = -1;
virNetServerPtr srv = NULL;
virNetServer *srv = NULL;
virTypedParameterPtr params = NULL;
int nparams = 0;
struct daemonAdmClientPrivate *priv =
@ -365,7 +364,7 @@ adminDispatchServerGetClientLimits(virNetServerPtr server G_GNUC_UNUSED,
if (virTypedParamsSerialize(params, nparams,
ADMIN_SERVER_CLIENT_LIMITS_MAX,
(virTypedParameterRemotePtr *) &ret->params.params_val,
(struct _virTypedParameterRemote **) &ret->params.params_val,
&ret->params.params_len, 0) < 0)
goto cleanup;
@ -380,14 +379,14 @@ adminDispatchServerGetClientLimits(virNetServerPtr server G_GNUC_UNUSED,
}
static int
adminDispatchServerSetClientLimits(virNetServerPtr server G_GNUC_UNUSED,
virNetServerClientPtr client,
virNetMessagePtr msg G_GNUC_UNUSED,
virNetMessageErrorPtr rerr G_GNUC_UNUSED,
adminDispatchServerSetClientLimits(virNetServer *server G_GNUC_UNUSED,
virNetServerClient *client,
virNetMessage *msg G_GNUC_UNUSED,
struct virNetMessageError *rerr G_GNUC_UNUSED,
admin_server_set_client_limits_args *args)
{
int rv = -1;
virNetServerPtr srv = NULL;
virNetServer *srv = NULL;
virTypedParameterPtr params = NULL;
int nparams = 0;
struct daemonAdmClientPrivate *priv =
@ -400,7 +399,7 @@ adminDispatchServerSetClientLimits(virNetServerPtr server G_GNUC_UNUSED,
goto cleanup;
}
if (virTypedParamsDeserialize((virTypedParameterRemotePtr) args->params.params_val,
if (virTypedParamsDeserialize((struct _virTypedParameterRemote *) args->params.params_val,
args->params.params_len,
ADMIN_SERVER_CLIENT_LIMITS_MAX, &params, &nparams) < 0)
goto cleanup;
@ -449,7 +448,7 @@ adminConnectGetLoggingFilters(char **filters, unsigned int flags)
}
static int
adminConnectSetLoggingOutputs(virNetDaemonPtr dmn G_GNUC_UNUSED,
adminConnectSetLoggingOutputs(virNetDaemon *dmn G_GNUC_UNUSED,
const char *outputs,
unsigned int flags)
{
@ -459,7 +458,7 @@ adminConnectSetLoggingOutputs(virNetDaemonPtr dmn G_GNUC_UNUSED,
}
static int
adminConnectSetLoggingFilters(virNetDaemonPtr dmn G_GNUC_UNUSED,
adminConnectSetLoggingFilters(virNetDaemon *dmn G_GNUC_UNUSED,
const char *filters,
unsigned int flags)
{
@ -469,10 +468,10 @@ adminConnectSetLoggingFilters(virNetDaemonPtr dmn G_GNUC_UNUSED,
}
static int
adminDispatchConnectGetLoggingOutputs(virNetServerPtr server G_GNUC_UNUSED,
virNetServerClientPtr client G_GNUC_UNUSED,
virNetMessagePtr msg G_GNUC_UNUSED,
virNetMessageErrorPtr rerr,
adminDispatchConnectGetLoggingOutputs(virNetServer *server G_GNUC_UNUSED,
virNetServerClient *client G_GNUC_UNUSED,
virNetMessage *msg G_GNUC_UNUSED,
struct virNetMessageError *rerr,
admin_connect_get_logging_outputs_args *args,
admin_connect_get_logging_outputs_ret *ret)
{
@ -491,10 +490,10 @@ adminDispatchConnectGetLoggingOutputs(virNetServerPtr server G_GNUC_UNUSED,
}
static int
adminDispatchConnectGetLoggingFilters(virNetServerPtr server G_GNUC_UNUSED,
virNetServerClientPtr client G_GNUC_UNUSED,
virNetMessagePtr msg G_GNUC_UNUSED,
virNetMessageErrorPtr rerr,
adminDispatchConnectGetLoggingFilters(virNetServer *server G_GNUC_UNUSED,
virNetServerClient *client G_GNUC_UNUSED,
virNetMessage *msg G_GNUC_UNUSED,
struct virNetMessageError *rerr,
admin_connect_get_logging_filters_args *args,
admin_connect_get_logging_filters_ret *ret)
{

View File

@ -29,9 +29,9 @@ extern virNetServerProgramProc adminProcs[];
extern size_t adminNProcs;
void remoteAdmClientFree(void *data);
void *remoteAdmClientNew(virNetServerClientPtr client, void *opaque);
void *remoteAdmClientNewPostExecRestart(virNetServerClientPtr client,
virJSONValuePtr object,
void *remoteAdmClientNew(virNetServerClient *client, void *opaque);
void *remoteAdmClientNewPostExecRestart(virNetServerClient *client,
virJSONValue *object,
void *opaque);
virJSONValuePtr remoteAdmClientPreExecRestart(virNetServerClientPtr client,
virJSONValue *remoteAdmClientPreExecRestart(virNetServerClient *client,
void *data);

View File

@ -97,7 +97,7 @@ virAdmInitialize(void)
}
static char *
getSocketPath(virURIPtr uri)
getSocketPath(virURI *uri)
{
g_autofree char *rundir = virGetUserRuntimeDirectory();
g_autofree char *sock_path = NULL;
@ -108,7 +108,7 @@ getSocketPath(virURIPtr uri)
for (i = 0; i < uri->paramsCount; i++) {
virURIParamPtr param = &uri->params[i];
virURIParam *param = &uri->params[i];
if (STREQ(param->name, "socket")) {
g_free(sock_path);
@ -160,7 +160,7 @@ getSocketPath(virURIPtr uri)
}
static int
virAdmGetDefaultURI(virConfPtr conf, char **uristr)
virAdmGetDefaultURI(virConf *conf, char **uristr)
{
const char *defname = getenv("LIBVIRT_ADMIN_DEFAULT_URI");
if (defname && *defname) {
@ -381,7 +381,7 @@ int
virAdmConnectIsAlive(virAdmConnectPtr conn)
{
bool ret;
remoteAdminPrivPtr priv = NULL;
remoteAdminPriv *priv = NULL;
VIR_DEBUG("conn=%p", conn);

View File

@ -40,11 +40,11 @@
VIR_LOG_INIT("bhyve.bhyve_capabilities");
virCapsPtr
virCaps *
virBhyveCapsBuild(void)
{
virCapsPtr caps;
virCapsGuestPtr guest;
virCaps *caps;
virCapsGuest *guest;
if ((caps = virCapabilitiesNew(virArchFromHost(),
false, false)) == NULL)
@ -71,9 +71,9 @@ virBhyveCapsBuild(void)
}
int
virBhyveDomainCapsFill(virDomainCapsPtr caps,
virBhyveDomainCapsFill(virDomainCaps *caps,
unsigned int bhyvecaps,
virDomainCapsStringValuesPtr firmwares)
virDomainCapsStringValues *firmwares)
{
caps->disk.supported = VIR_TRISTATE_BOOL_YES;
caps->disk.diskDevice.report = true;
@ -125,21 +125,21 @@ virBhyveDomainCapsFill(virDomainCapsPtr caps,
}
virDomainCapsPtr
virBhyveDomainCapsBuild(bhyveConnPtr conn,
virDomainCaps *
virBhyveDomainCapsBuild(struct _bhyveConn *conn,
const char *emulatorbin,
const char *machine,
virArch arch,
virDomainVirtType virttype)
{
virDomainCapsPtr caps = NULL;
virDomainCaps *caps = NULL;
unsigned int bhyve_caps = 0;
g_autoptr(DIR) dir = NULL;
struct dirent *entry;
size_t firmwares_alloc = 0;
virBhyveDriverConfigPtr cfg = virBhyveDriverGetConfig(conn);
struct _virBhyveDriverConfig *cfg = virBhyveDriverGetConfig(conn);
const char *firmware_dir = cfg->firmwareDir;
virDomainCapsStringValuesPtr firmwares = NULL;
virDomainCapsStringValues *firmwares = NULL;
if (!(caps = virDomainCapsNew(emulatorbin, machine, arch, virttype)))
goto cleanup;
@ -176,7 +176,7 @@ int
virBhyveProbeGrubCaps(virBhyveGrubCapsFlags *caps)
{
char *binary, *help;
virCommandPtr cmd;
virCommand *cmd;
int ret, exit;
ret = 0;
@ -215,7 +215,7 @@ bhyveProbeCapsDeviceHelper(unsigned int *caps,
unsigned int flag)
{
char *error;
virCommandPtr cmd = NULL;
virCommand *cmd = NULL;
int ret = -1, exit;
cmd = virCommandNew(binary);
@ -238,7 +238,7 @@ static int
bhyveProbeCapsFromHelp(unsigned int *caps, char *binary)
{
char *help;
virCommandPtr cmd = NULL;
virCommand *cmd = NULL;
int ret = 0, exit;
cmd = virCommandNew(binary);

View File

@ -26,15 +26,15 @@
#include "bhyve_utils.h"
virCapsPtr virBhyveCapsBuild(void);
int virBhyveDomainCapsFill(virDomainCapsPtr caps,
virCaps *virBhyveCapsBuild(void);
int virBhyveDomainCapsFill(virDomainCaps *caps,
unsigned int bhyvecaps,
virDomainCapsStringValuesPtr firmwares);
virDomainCapsPtr virBhyveDomainCapsBuild(bhyveConnPtr,
const char *emulatorbin,
const char *machine,
virArch arch,
virDomainVirtType virttype);
virDomainCapsStringValues *firmwares);
virDomainCaps *virBhyveDomainCapsBuild(bhyveConn *conn,
const char *emulatorbin,
const char *machine,
virArch arch,
virDomainVirtType virttype);
/* These are bit flags: */
typedef enum {

View File

@ -41,9 +41,9 @@ VIR_LOG_INIT("bhyve.bhyve_command");
static int
bhyveBuildNetArgStr(const virDomainDef *def,
virDomainNetDefPtr net,
bhyveConnPtr driver,
virCommandPtr cmd,
virDomainNetDef *net,
struct _bhyveConn *driver,
virCommand *cmd,
bool dryRun)
{
char macaddr[VIR_MAC_STRING_BUFLEN];
@ -124,9 +124,9 @@ bhyveBuildNetArgStr(const virDomainDef *def,
}
static int
bhyveBuildConsoleArgStr(const virDomainDef *def, virCommandPtr cmd)
bhyveBuildConsoleArgStr(const virDomainDef *def, virCommand *cmd)
{
virDomainChrDefPtr chr = NULL;
virDomainChrDef *chr = NULL;
if (!def->nserials)
return 0;
@ -155,9 +155,9 @@ bhyveBuildConsoleArgStr(const virDomainDef *def, virCommandPtr cmd)
static int
bhyveBuildAHCIControllerArgStr(const virDomainDef *def,
virDomainControllerDefPtr controller,
bhyveConnPtr driver,
virCommandPtr cmd)
virDomainControllerDef *controller,
struct _bhyveConn *driver,
virCommand *cmd)
{
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
const char *disk_source;
@ -165,7 +165,7 @@ bhyveBuildAHCIControllerArgStr(const virDomainDef *def,
for (i = 0; i < def->ndisks; i++) {
g_auto(virBuffer) device = VIR_BUFFER_INITIALIZER;
virDomainDiskDefPtr disk = def->disks[i];
virDomainDiskDef *disk = def->disks[i];
if (disk->bus != VIR_DOMAIN_DISK_BUS_SATA)
continue;
@ -226,14 +226,14 @@ bhyveBuildAHCIControllerArgStr(const virDomainDef *def,
static int
bhyveBuildUSBControllerArgStr(const virDomainDef *def,
virDomainControllerDefPtr controller,
virCommandPtr cmd)
virDomainControllerDef *controller,
virCommand *cmd)
{
size_t i;
int ndevices = 0;
for (i = 0; i < def->ninputs; i++) {
virDomainInputDefPtr input = def->inputs[i];
virDomainInputDef *input = def->inputs[i];
if (input->bus != VIR_DOMAIN_INPUT_BUS_USB) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
@ -265,8 +265,8 @@ bhyveBuildUSBControllerArgStr(const virDomainDef *def,
static int
bhyveBuildVirtIODiskArgStr(const virDomainDef *def G_GNUC_UNUSED,
virDomainDiskDefPtr disk,
virCommandPtr cmd)
virDomainDiskDef *disk,
virCommand *cmd)
{
const char *disk_source;
@ -298,8 +298,8 @@ bhyveBuildVirtIODiskArgStr(const virDomainDef *def G_GNUC_UNUSED,
static int
bhyveBuildDiskArgStr(const virDomainDef *def,
virDomainDiskDefPtr disk,
virCommandPtr cmd)
virDomainDiskDef *disk,
virCommand *cmd)
{
switch (disk->bus) {
case VIR_DOMAIN_DISK_BUS_SATA:
@ -319,9 +319,9 @@ bhyveBuildDiskArgStr(const virDomainDef *def,
static int
bhyveBuildControllerArgStr(const virDomainDef *def,
virDomainControllerDefPtr controller,
bhyveConnPtr driver,
virCommandPtr cmd,
virDomainControllerDef *controller,
struct _bhyveConn *driver,
virCommand *cmd,
unsigned *nusbcontrollers,
unsigned *nisacontrollers)
{
@ -364,14 +364,14 @@ bhyveBuildControllerArgStr(const virDomainDef *def,
static int
bhyveBuildGraphicsArgStr(const virDomainDef *def,
virDomainGraphicsDefPtr graphics,
virDomainVideoDefPtr video,
bhyveConnPtr driver,
virCommandPtr cmd,
virDomainGraphicsDef *graphics,
virDomainVideoDef *video,
struct _bhyveConn *driver,
virCommand *cmd,
bool dryRun)
{
g_auto(virBuffer) opt = VIR_BUFFER_INITIALIZER;
virDomainGraphicsListenDefPtr glisten = NULL;
virDomainGraphicsListenDef *glisten = NULL;
bool escapeAddr;
unsigned short port;
@ -487,10 +487,10 @@ bhyveBuildGraphicsArgStr(const virDomainDef *def,
static int
bhyveBuildSoundArgStr(const virDomainDef *def G_GNUC_UNUSED,
virDomainSoundDefPtr sound,
virDomainAudioDefPtr audio,
bhyveConnPtr driver,
virCommandPtr cmd)
virDomainSoundDef *sound,
virDomainAudioDef *audio,
struct _bhyveConn *driver,
virCommand *cmd)
{
g_auto(virBuffer) params = VIR_BUFFER_INITIALIZER;
@ -560,8 +560,8 @@ bhyveBuildSoundArgStr(const virDomainDef *def G_GNUC_UNUSED,
static int
bhyveBuildFSArgStr(const virDomainDef *def G_GNUC_UNUSED,
virDomainFSDefPtr fs,
virCommandPtr cmd)
virDomainFSDef *fs,
virCommand *cmd)
{
g_auto(virBuffer) params = VIR_BUFFER_INITIALIZER;
@ -625,8 +625,8 @@ bhyveBuildFSArgStr(const virDomainDef *def G_GNUC_UNUSED,
return 0;
}
virCommandPtr
virBhyveProcessBuildBhyveCmd(bhyveConnPtr driver, virDomainDefPtr def,
virCommand *
virBhyveProcessBuildBhyveCmd(struct _bhyveConn *driver, virDomainDef *def,
bool dryRun)
{
/*
@ -637,7 +637,7 @@ virBhyveProcessBuildBhyveCmd(bhyveConnPtr driver, virDomainDefPtr def,
* -S 31,uart,stdio \
* vm0
*/
virCommandPtr cmd = virCommandNew(BHYVE);
virCommand *cmd = virCommandNew(BHYVE);
size_t i;
unsigned nusbcontrollers = 0;
unsigned nisacontrollers = 0;
@ -786,7 +786,7 @@ virBhyveProcessBuildBhyveCmd(bhyveConnPtr driver, virDomainDefPtr def,
goto error;
if (def->namespaceData) {
bhyveDomainCmdlineDefPtr bhyvecmd;
bhyveDomainCmdlineDef *bhyvecmd;
VIR_WARN("Booting the guest using command line pass-through feature, "
"which could potentially cause inconsistent state and "
@ -806,11 +806,11 @@ virBhyveProcessBuildBhyveCmd(bhyveConnPtr driver, virDomainDefPtr def,
return NULL;
}
virCommandPtr
virBhyveProcessBuildDestroyCmd(bhyveConnPtr driver G_GNUC_UNUSED,
virDomainDefPtr def)
virCommand *
virBhyveProcessBuildDestroyCmd(struct _bhyveConn *driver G_GNUC_UNUSED,
virDomainDef *def)
{
virCommandPtr cmd = virCommandNew(BHYVECTL);
virCommand *cmd = virCommandNew(BHYVECTL);
virCommandAddArg(cmd, "--destroy");
virCommandAddArgPair(cmd, "--vm", def->name);
@ -819,7 +819,7 @@ virBhyveProcessBuildDestroyCmd(bhyveConnPtr driver G_GNUC_UNUSED,
}
static void
virAppendBootloaderArgs(virCommandPtr cmd, virDomainDefPtr def)
virAppendBootloaderArgs(virCommand *cmd, virDomainDef *def)
{
char **blargs;
@ -829,10 +829,10 @@ virAppendBootloaderArgs(virCommandPtr cmd, virDomainDefPtr def)
g_strfreev(blargs);
}
static virCommandPtr
virBhyveProcessBuildBhyveloadCmd(virDomainDefPtr def, virDomainDiskDefPtr disk)
static virCommand *
virBhyveProcessBuildBhyveloadCmd(virDomainDef *def, virDomainDiskDef *disk)
{
virCommandPtr cmd;
virCommand *cmd;
cmd = virCommandNew(BHYVELOAD);
@ -858,10 +858,10 @@ virBhyveProcessBuildBhyveloadCmd(virDomainDefPtr def, virDomainDiskDefPtr disk)
return cmd;
}
static virCommandPtr
virBhyveProcessBuildCustomLoaderCmd(virDomainDefPtr def)
static virCommand *
virBhyveProcessBuildCustomLoaderCmd(virDomainDef *def)
{
virCommandPtr cmd;
virCommand *cmd;
if (def->os.bootloaderArgs == NULL) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
@ -878,7 +878,7 @@ virBhyveProcessBuildCustomLoaderCmd(virDomainDefPtr def)
}
static bool
virBhyveUsableDisk(virDomainDiskDefPtr disk)
virBhyveUsableDisk(virDomainDiskDef *disk)
{
if (virDomainDiskTranslateSourcePool(disk) < 0)
return false;
@ -901,7 +901,7 @@ virBhyveUsableDisk(virDomainDiskDefPtr disk)
}
static void
virBhyveFormatGrubDevice(virBufferPtr devicemap, virDomainDiskDefPtr def)
virBhyveFormatGrubDevice(virBuffer *devicemap, virDomainDiskDef *def)
{
if (def->device == VIR_DOMAIN_DISK_DEVICE_CDROM)
virBufferAsprintf(devicemap, "(cd) %s\n",
@ -911,17 +911,17 @@ virBhyveFormatGrubDevice(virBufferPtr devicemap, virDomainDiskDefPtr def)
virDomainDiskGetSource(def));
}
static virCommandPtr
virBhyveProcessBuildGrubbhyveCmd(virDomainDefPtr def,
bhyveConnPtr driver,
static virCommand *
virBhyveProcessBuildGrubbhyveCmd(virDomainDef *def,
struct _bhyveConn *driver,
const char *devmap_file,
char **devicesmap_out)
{
virDomainDiskDefPtr hdd;
virDomainDiskDefPtr cd;
virDomainDiskDefPtr userdef;
virDomainDiskDefPtr diskdef;
virCommandPtr cmd;
virDomainDiskDef *hdd;
virDomainDiskDef *cd;
virDomainDiskDef *userdef;
virDomainDiskDef *diskdef;
virCommand *cmd;
unsigned int best_idx = UINT_MAX;
size_t i;
@ -1000,7 +1000,7 @@ virBhyveProcessBuildGrubbhyveCmd(virDomainDefPtr def,
if ((bhyveDriverGetGrubCaps(driver) & BHYVE_GRUB_CAP_CONSDEV) != 0 &&
def->nserials > 0) {
virDomainChrDefPtr chr;
virDomainChrDef *chr;
chr = def->serials[0];
@ -1020,11 +1020,11 @@ virBhyveProcessBuildGrubbhyveCmd(virDomainDefPtr def,
return cmd;
}
static virDomainDiskDefPtr
virBhyveGetBootDisk(virDomainDefPtr def)
static virDomainDiskDef *
virBhyveGetBootDisk(virDomainDef *def)
{
size_t i;
virDomainDiskDefPtr match = NULL;
virDomainDiskDef *match = NULL;
int boot_dev = -1;
if (def->ndisks < 1) {
@ -1106,11 +1106,11 @@ virBhyveGetBootDisk(virDomainDefPtr def)
return match;
}
virCommandPtr
virBhyveProcessBuildLoadCmd(bhyveConnPtr driver, virDomainDefPtr def,
virCommand *
virBhyveProcessBuildLoadCmd(struct _bhyveConn *driver, virDomainDef *def,
const char *devmap_file, char **devicesmap_out)
{
virDomainDiskDefPtr disk = NULL;
virDomainDiskDef *disk = NULL;
if (def->os.bootloader == NULL) {
disk = virBhyveGetBootDisk(def);

View File

@ -29,14 +29,14 @@
#define BHYVE_CONFIG_FORMAT_ARGV "bhyve-argv"
virCommandPtr virBhyveProcessBuildBhyveCmd(bhyveConnPtr driver,
virDomainDefPtr def,
bool dryRun);
virCommand *virBhyveProcessBuildBhyveCmd(struct _bhyveConn *driver,
virDomainDef *def,
bool dryRun);
virCommandPtr
virBhyveProcessBuildDestroyCmd(bhyveConnPtr driver,
virDomainDefPtr def);
virCommand *
virBhyveProcessBuildDestroyCmd(struct _bhyveConn *driver,
virDomainDef *def);
virCommandPtr
virBhyveProcessBuildLoadCmd(bhyveConnPtr driver, virDomainDefPtr def,
virCommand *
virBhyveProcessBuildLoadCmd(struct _bhyveConn *driver, virDomainDef *def,
const char *devmap_file, char **devicesmap_out);

View File

@ -32,7 +32,7 @@
VIR_LOG_INIT("bhyve.bhyve_conf");
static virClassPtr virBhyveDriverConfigClass;
static virClass *virBhyveDriverConfigClass;
static void virBhyveDriverConfigDispose(void *obj);
static int virBhyveConfigOnceInit(void)
@ -45,10 +45,10 @@ static int virBhyveConfigOnceInit(void)
VIR_ONCE_GLOBAL_INIT(virBhyveConfig);
virBhyveDriverConfigPtr
struct _virBhyveDriverConfig *
virBhyveDriverConfigNew(void)
{
virBhyveDriverConfigPtr cfg;
struct _virBhyveDriverConfig *cfg;
if (virBhyveConfigInitialize() < 0)
return NULL;
@ -62,7 +62,7 @@ virBhyveDriverConfigNew(void)
}
int
virBhyveLoadDriverConfig(virBhyveDriverConfigPtr cfg,
virBhyveLoadDriverConfig(struct _virBhyveDriverConfig *cfg,
const char *filename)
{
g_autoptr(virConf) conf = NULL;
@ -82,10 +82,10 @@ virBhyveLoadDriverConfig(virBhyveDriverConfigPtr cfg,
return 0;
}
virBhyveDriverConfigPtr
virBhyveDriverGetConfig(bhyveConnPtr driver)
struct _virBhyveDriverConfig *
virBhyveDriverGetConfig(struct _bhyveConn *driver)
{
virBhyveDriverConfigPtr cfg;
struct _virBhyveDriverConfig *cfg;
bhyveDriverLock(driver);
cfg = virObjectRef(driver->config);
bhyveDriverUnlock(driver);
@ -95,13 +95,13 @@ virBhyveDriverGetConfig(bhyveConnPtr driver)
static void
virBhyveDriverConfigDispose(void *obj)
{
virBhyveDriverConfigPtr cfg = obj;
struct _virBhyveDriverConfig *cfg = obj;
g_free(cfg->firmwareDir);
}
void
bhyveDomainCmdlineDefFree(bhyveDomainCmdlineDefPtr def)
bhyveDomainCmdlineDefFree(bhyveDomainCmdlineDef *def)
{
size_t i;

View File

@ -23,16 +23,15 @@
#include "bhyve_utils.h"
virBhyveDriverConfigPtr virBhyveDriverConfigNew(void);
virBhyveDriverConfigPtr virBhyveDriverGetConfig(bhyveConnPtr driver);
int virBhyveLoadDriverConfig(virBhyveDriverConfigPtr cfg,
struct _virBhyveDriverConfig *virBhyveDriverConfigNew(void);
struct _virBhyveDriverConfig *virBhyveDriverGetConfig(struct _bhyveConn *driver);
int virBhyveLoadDriverConfig(struct _virBhyveDriverConfig *cfg,
const char *filename);
typedef struct _bhyveDomainCmdlineDef bhyveDomainCmdlineDef;
typedef bhyveDomainCmdlineDef *bhyveDomainCmdlineDefPtr;
struct _bhyveDomainCmdlineDef {
size_t num_args;
char **args;
};
void bhyveDomainCmdlineDefFree(bhyveDomainCmdlineDefPtr def);
void bhyveDomainCmdlineDefFree(bhyveDomainCmdlineDef *def);

View File

@ -31,16 +31,16 @@
VIR_LOG_INIT("bhyve.bhyve_device");
static int
bhyveCollectPCIAddress(virDomainDefPtr def G_GNUC_UNUSED,
virDomainDeviceDefPtr device G_GNUC_UNUSED,
virDomainDeviceInfoPtr info,
bhyveCollectPCIAddress(virDomainDef *def G_GNUC_UNUSED,
virDomainDeviceDef *device G_GNUC_UNUSED,
virDomainDeviceInfo *info,
void *opaque)
{
if (info->type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_DRIVE)
return 0;
virDomainPCIAddressSetPtr addrs = opaque;
virPCIDeviceAddressPtr addr = &info->addr.pci;
virDomainPCIAddressSet *addrs = opaque;
virPCIDeviceAddress *addr = &info->addr.pci;
if (addr->domain == 0 && addr->bus == 0 && addr->slot == 0) {
return 0;
@ -54,10 +54,10 @@ bhyveCollectPCIAddress(virDomainDefPtr def G_GNUC_UNUSED,
return 0;
}
virDomainPCIAddressSetPtr
bhyveDomainPCIAddressSetCreate(virDomainDefPtr def, unsigned int nbuses)
virDomainPCIAddressSet *
bhyveDomainPCIAddressSetCreate(virDomainDef *def, unsigned int nbuses)
{
virDomainPCIAddressSetPtr addrs;
virDomainPCIAddressSet *addrs;
if ((addrs = virDomainPCIAddressSetAlloc(nbuses,
VIR_PCI_ADDRESS_EXTENSION_NONE)) == NULL)
@ -79,8 +79,8 @@ bhyveDomainPCIAddressSetCreate(virDomainDefPtr def, unsigned int nbuses)
}
static int
bhyveAssignDevicePCISlots(virDomainDefPtr def,
virDomainPCIAddressSetPtr addrs)
bhyveAssignDevicePCISlots(virDomainDef *def,
virDomainPCIAddressSet *addrs)
{
size_t i;
virPCIDeviceAddress lpc_addr;
@ -188,11 +188,11 @@ bhyveAssignDevicePCISlots(virDomainDefPtr def,
return 0;
}
int bhyveDomainAssignPCIAddresses(virDomainDefPtr def,
virDomainObjPtr obj)
int bhyveDomainAssignPCIAddresses(virDomainDef *def,
virDomainObj *obj)
{
virDomainPCIAddressSetPtr addrs = NULL;
bhyveDomainObjPrivatePtr priv = NULL;
virDomainPCIAddressSet *addrs = NULL;
bhyveDomainObjPrivate *priv = NULL;
if (!(addrs = bhyveDomainPCIAddressSetCreate(def, 1)))
return -1;
@ -214,7 +214,7 @@ int bhyveDomainAssignPCIAddresses(virDomainDefPtr def,
return 0;
}
int bhyveDomainAssignAddresses(virDomainDefPtr def, virDomainObjPtr obj)
int bhyveDomainAssignAddresses(virDomainDef *def, virDomainObj *obj)
{
return bhyveDomainAssignPCIAddresses(def, obj);
}

View File

@ -24,10 +24,10 @@
#include "virpci.h"
#include "bhyve_domain.h"
int bhyveDomainAssignPCIAddresses(virDomainDefPtr def, virDomainObjPtr obj);
int bhyveDomainAssignPCIAddresses(virDomainDef *def, virDomainObj *obj);
virDomainPCIAddressSetPtr bhyveDomainPCIAddressSetCreate(virDomainDefPtr def,
unsigned int nbuses);
virDomainPCIAddressSet *bhyveDomainPCIAddressSetCreate(virDomainDef *def,
unsigned int nbuses);
int bhyveDomainAssignAddresses(virDomainDefPtr def, virDomainObjPtr obj)
int bhyveDomainAssignAddresses(virDomainDef *def, virDomainObj *obj)
ATTRIBUTE_NONNULL(1);

View File

@ -36,7 +36,7 @@ VIR_LOG_INIT("bhyve.bhyve_domain");
static void *
bhyveDomainObjPrivateAlloc(void *opaque G_GNUC_UNUSED)
{
bhyveDomainObjPrivatePtr priv;
bhyveDomainObjPrivate *priv;
priv = g_new0(bhyveDomainObjPrivate, 1);
@ -46,7 +46,7 @@ bhyveDomainObjPrivateAlloc(void *opaque G_GNUC_UNUSED)
static void
bhyveDomainObjPrivateFree(void *data)
{
bhyveDomainObjPrivatePtr priv = data;
bhyveDomainObjPrivate *priv = data;
virDomainPCIAddressSetFree(priv->pciaddrs);
@ -59,7 +59,7 @@ virDomainXMLPrivateDataCallbacks virBhyveDriverPrivateDataCallbacks = {
};
static bool
bhyveDomainDefNeedsISAController(virDomainDefPtr def)
bhyveDomainDefNeedsISAController(virDomainDef *def)
{
if (def->os.bootloader == NULL && def->os.loader)
return true;
@ -77,12 +77,12 @@ bhyveDomainDefNeedsISAController(virDomainDefPtr def)
}
static int
bhyveDomainDefPostParse(virDomainDefPtr def,
bhyveDomainDefPostParse(virDomainDef *def,
unsigned int parseFlags G_GNUC_UNUSED,
void *opaque,
void *parseOpaque G_GNUC_UNUSED)
{
bhyveConnPtr driver = opaque;
struct _bhyveConn *driver = opaque;
g_autoptr(virCaps) caps = bhyveDriverGetCapabilities(driver);
if (!caps)
return -1;
@ -106,8 +106,8 @@ bhyveDomainDefPostParse(virDomainDefPtr def,
}
static int
bhyveDomainDiskDefAssignAddress(bhyveConnPtr driver,
virDomainDiskDefPtr def,
bhyveDomainDiskDefAssignAddress(struct _bhyveConn *driver,
virDomainDiskDef *def,
const virDomainDef *vmdef G_GNUC_UNUSED)
{
int idx = virDiskNameToIndex(def->dst);
@ -138,16 +138,16 @@ bhyveDomainDiskDefAssignAddress(bhyveConnPtr driver,
}
static int
bhyveDomainDeviceDefPostParse(virDomainDeviceDefPtr dev,
bhyveDomainDeviceDefPostParse(virDomainDeviceDef *dev,
const virDomainDef *def,
unsigned int parseFlags G_GNUC_UNUSED,
void *opaque,
void *parseOpaque G_GNUC_UNUSED)
{
bhyveConnPtr driver = opaque;
struct _bhyveConn *driver = opaque;
if (dev->type == VIR_DOMAIN_DEVICE_DISK) {
virDomainDiskDefPtr disk = dev->data.disk;
virDomainDiskDef *disk = dev->data.disk;
if (disk->info.type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE &&
bhyveDomainDiskDefAssignAddress(driver, disk, def) < 0)
@ -155,7 +155,7 @@ bhyveDomainDeviceDefPostParse(virDomainDeviceDefPtr dev,
}
if (dev->type == VIR_DOMAIN_DEVICE_CONTROLLER) {
virDomainControllerDefPtr cont = dev->data.controller;
virDomainControllerDef *cont = dev->data.controller;
if (cont->type == VIR_DOMAIN_CONTROLLER_TYPE_PCI &&
(cont->model == VIR_DOMAIN_CONTROLLER_MODEL_PCI_ROOT ||
@ -175,7 +175,7 @@ bhyveDomainDeviceDefPostParse(virDomainDeviceDefPtr dev,
if (dev->type == VIR_DOMAIN_DEVICE_CHR &&
dev->data.chr->source->type == VIR_DOMAIN_CHR_TYPE_NMDM) {
virDomainChrDefPtr chr = dev->data.chr;
virDomainChrDef *chr = dev->data.chr;
if (!chr->source->data.nmdm.master) {
char uuidstr[VIR_UUID_STRING_BUFLEN];
@ -202,8 +202,8 @@ bhyveDomainDefAssignAddresses(virDomainDef *def,
return 0;
}
virDomainXMLOptionPtr
virBhyveDriverCreateXMLConf(bhyveConnPtr driver)
virDomainXMLOption *
virBhyveDriverCreateXMLConf(struct _bhyveConn *driver)
{
virBhyveDriverDomainDefParserConfig.priv = driver;
return virDomainXMLOptionNew(&virBhyveDriverDomainDefParserConfig,
@ -240,7 +240,7 @@ virDomainDefParserConfig virBhyveDriverDomainDefParserConfig = {
static void
bhyveDomainDefNamespaceFree(void *nsdata)
{
bhyveDomainCmdlineDefPtr cmd = nsdata;
bhyveDomainCmdlineDef *cmd = nsdata;
bhyveDomainCmdlineDefFree(cmd);
}
@ -249,7 +249,7 @@ static int
bhyveDomainDefNamespaceParse(xmlXPathContextPtr ctxt,
void **data)
{
bhyveDomainCmdlineDefPtr cmd = NULL;
bhyveDomainCmdlineDef *cmd = NULL;
xmlNodePtr *nodes = NULL;
int n;
size_t i;
@ -286,10 +286,10 @@ bhyveDomainDefNamespaceParse(xmlXPathContextPtr ctxt,
}
static int
bhyveDomainDefNamespaceFormatXML(virBufferPtr buf,
bhyveDomainDefNamespaceFormatXML(virBuffer *buf,
void *nsdata)
{
bhyveDomainCmdlineDefPtr cmd = nsdata;
bhyveDomainCmdlineDef *cmd = nsdata;
size_t i;
if (!cmd->num_args)

View File

@ -26,15 +26,14 @@
#include "bhyve_monitor.h"
typedef struct _bhyveDomainObjPrivate bhyveDomainObjPrivate;
typedef bhyveDomainObjPrivate *bhyveDomainObjPrivatePtr;
struct _bhyveDomainObjPrivate {
virDomainPCIAddressSetPtr pciaddrs;
virDomainPCIAddressSet *pciaddrs;
bool persistentAddrs;
bhyveMonitorPtr mon;
bhyveMonitor *mon;
};
virDomainXMLOptionPtr virBhyveDriverCreateXMLConf(bhyveConnPtr);
virDomainXMLOption *virBhyveDriverCreateXMLConf(struct _bhyveConn *);
extern virDomainXMLPrivateDataCallbacks virBhyveDriverPrivateDataCallbacks;
extern virDomainDefParserConfig virBhyveDriverDomainDefParserConfig;

View File

@ -68,22 +68,22 @@
VIR_LOG_INIT("bhyve.bhyve_driver");
bhyveConnPtr bhyve_driver = NULL;
struct _bhyveConn *bhyve_driver = NULL;
void
bhyveDriverLock(bhyveConnPtr driver)
bhyveDriverLock(struct _bhyveConn *driver)
{
virMutexLock(&driver->lock);
}
void
bhyveDriverUnlock(bhyveConnPtr driver)
bhyveDriverUnlock(struct _bhyveConn *driver)
{
virMutexUnlock(&driver->lock);
}
static int
bhyveAutostartDomain(virDomainObjPtr vm, void *opaque)
bhyveAutostartDomain(virDomainObj *vm, void *opaque)
{
const struct bhyveAutostartData *data = opaque;
int ret = 0;
@ -103,7 +103,7 @@ bhyveAutostartDomain(virDomainObjPtr vm, void *opaque)
}
static void
bhyveAutostartDomains(bhyveConnPtr driver)
bhyveAutostartDomains(struct _bhyveConn *driver)
{
/* XXX: Figure out a better way todo this. The domain
* startup code needs a connection handle in order
@ -123,15 +123,15 @@ bhyveAutostartDomains(bhyveConnPtr driver)
/**
* bhyveDriverGetCapabilities:
*
* Get a reference to the virCapsPtr instance for the
* Get a reference to the virCaps *instance for the
* driver.
*
* The caller must release the reference with virObjetUnref
*
* Returns: a reference to a virCapsPtr instance or NULL
* Returns: a reference to a virCaps *instance or NULL
*/
virCapsPtr ATTRIBUTE_NONNULL(1)
bhyveDriverGetCapabilities(bhyveConnPtr driver)
virCaps *ATTRIBUTE_NONNULL(1)
bhyveDriverGetCapabilities(struct _bhyveConn *driver)
{
return virObjectRef(driver->caps);
}
@ -139,8 +139,8 @@ bhyveDriverGetCapabilities(bhyveConnPtr driver)
static char *
bhyveConnectGetCapabilities(virConnectPtr conn)
{
bhyveConnPtr privconn = conn->privateData;
virCapsPtr caps;
struct _bhyveConn *privconn = conn->privateData;
virCaps *caps;
char *xml = NULL;
if (virConnectGetCapabilitiesEnsureACL(conn) < 0)
@ -160,11 +160,11 @@ bhyveConnectGetCapabilities(virConnectPtr conn)
return xml;
}
static virDomainObjPtr
static virDomainObj *
bhyveDomObjFromDomain(virDomainPtr domain)
{
virDomainObjPtr vm;
bhyveConnPtr privconn = domain->conn->privateData;
virDomainObj *vm;
struct _bhyveConn *privconn = domain->conn->privateData;
char uuidstr[VIR_UUID_STRING_BUFLEN];
vm = virDomainObjListFindByUUID(privconn->domains, domain->uuid);
@ -194,7 +194,7 @@ bhyveConnectURIProbe(char **uri)
static virDrvOpenStatus
bhyveConnectOpen(virConnectPtr conn,
virConnectAuthPtr auth G_GNUC_UNUSED,
virConfPtr conf G_GNUC_UNUSED,
virConf *conf G_GNUC_UNUSED,
unsigned int flags)
{
virCheckFlags(VIR_CONNECT_RO, VIR_DRV_OPEN_ERROR);
@ -223,7 +223,7 @@ bhyveConnectOpen(virConnectPtr conn,
static int
bhyveConnectClose(virConnectPtr conn)
{
bhyveConnPtr privconn = conn->privateData;
struct _bhyveConn *privconn = conn->privateData;
virCloseCallbacksRun(privconn->closeCallbacks, conn, privconn->domains, privconn);
conn->privateData = NULL;
@ -243,7 +243,7 @@ bhyveConnectGetHostname(virConnectPtr conn)
static char *
bhyveConnectGetSysinfo(virConnectPtr conn, unsigned int flags)
{
bhyveConnPtr privconn = conn->privateData;
struct _bhyveConn *privconn = conn->privateData;
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
virCheckFlags(0, NULL);
@ -285,7 +285,7 @@ bhyveConnectGetVersion(virConnectPtr conn, unsigned long *version)
static int
bhyveDomainGetInfo(virDomainPtr domain, virDomainInfoPtr info)
{
virDomainObjPtr vm;
virDomainObj *vm;
int ret = -1;
if (!(vm = bhyveDomObjFromDomain(domain)))
@ -317,7 +317,7 @@ bhyveDomainGetState(virDomainPtr domain,
int *reason,
unsigned int flags)
{
virDomainObjPtr vm;
virDomainObj *vm;
int ret = -1;
virCheckFlags(0, -1);
@ -339,7 +339,7 @@ bhyveDomainGetState(virDomainPtr domain,
static int
bhyveDomainGetAutostart(virDomainPtr domain, int *autostart)
{
virDomainObjPtr vm;
virDomainObj *vm;
int ret = -1;
if (!(vm = bhyveDomObjFromDomain(domain)))
@ -359,7 +359,7 @@ bhyveDomainGetAutostart(virDomainPtr domain, int *autostart)
static int
bhyveDomainSetAutostart(virDomainPtr domain, int autostart)
{
virDomainObjPtr vm;
virDomainObj *vm;
char *configFile = NULL;
char *autostartLink = NULL;
int ret = -1;
@ -422,7 +422,7 @@ bhyveDomainSetAutostart(virDomainPtr domain, int autostart)
static int
bhyveDomainIsActive(virDomainPtr domain)
{
virDomainObjPtr obj;
virDomainObj *obj;
int ret = -1;
if (!(obj = bhyveDomObjFromDomain(domain)))
@ -441,7 +441,7 @@ bhyveDomainIsActive(virDomainPtr domain)
static int
bhyveDomainIsPersistent(virDomainPtr domain)
{
virDomainObjPtr obj;
virDomainObj *obj;
int ret = -1;
if (!(obj = bhyveDomObjFromDomain(domain)))
@ -460,7 +460,7 @@ bhyveDomainIsPersistent(virDomainPtr domain)
static char *
bhyveDomainGetOSType(virDomainPtr dom)
{
virDomainObjPtr vm;
virDomainObj *vm;
char *ret = NULL;
if (!(vm = bhyveDomObjFromDomain(dom)))
@ -479,8 +479,8 @@ bhyveDomainGetOSType(virDomainPtr dom)
static char *
bhyveDomainGetXMLDesc(virDomainPtr domain, unsigned int flags)
{
bhyveConnPtr privconn = domain->conn->privateData;
virDomainObjPtr vm;
struct _bhyveConn *privconn = domain->conn->privateData;
virDomainObj *vm;
char *ret = NULL;
virCheckFlags(VIR_DOMAIN_XML_COMMON_FLAGS, NULL);
@ -502,13 +502,13 @@ bhyveDomainGetXMLDesc(virDomainPtr domain, unsigned int flags)
static virDomainPtr
bhyveDomainDefineXMLFlags(virConnectPtr conn, const char *xml, unsigned int flags)
{
bhyveConnPtr privconn = conn->privateData;
struct _bhyveConn *privconn = conn->privateData;
virDomainPtr dom = NULL;
virDomainDefPtr def = NULL;
virDomainDefPtr oldDef = NULL;
virDomainObjPtr vm = NULL;
virObjectEventPtr event = NULL;
virCapsPtr caps = NULL;
virDomainDef *def = NULL;
virDomainDef *oldDef = NULL;
virDomainObj *vm = NULL;
virObjectEvent *event = NULL;
virCaps *caps = NULL;
unsigned int parse_flags = VIR_DOMAIN_DEF_PARSE_INACTIVE;
virCheckFlags(VIR_DOMAIN_DEFINE_VALIDATE, NULL);
@ -573,9 +573,9 @@ bhyveDomainDefineXML(virConnectPtr conn, const char *xml)
static int
bhyveDomainUndefineFlags(virDomainPtr domain, unsigned int flags)
{
bhyveConnPtr privconn = domain->conn->privateData;
virObjectEventPtr event = NULL;
virDomainObjPtr vm;
struct _bhyveConn *privconn = domain->conn->privateData;
virObjectEvent *event = NULL;
virDomainObj *vm;
int ret = -1;
virCheckFlags(0, -1);
@ -622,7 +622,7 @@ bhyveDomainUndefine(virDomainPtr domain)
static int
bhyveConnectListDomains(virConnectPtr conn, int *ids, int maxids)
{
bhyveConnPtr privconn = conn->privateData;
struct _bhyveConn *privconn = conn->privateData;
if (virConnectListDomainsEnsureACL(conn) < 0)
return -1;
@ -634,7 +634,7 @@ bhyveConnectListDomains(virConnectPtr conn, int *ids, int maxids)
static int
bhyveConnectNumOfDomains(virConnectPtr conn)
{
bhyveConnPtr privconn = conn->privateData;
struct _bhyveConn *privconn = conn->privateData;
if (virConnectNumOfDomainsEnsureACL(conn) < 0)
return -1;
@ -647,7 +647,7 @@ static int
bhyveConnectListDefinedDomains(virConnectPtr conn, char **const names,
int maxnames)
{
bhyveConnPtr privconn = conn->privateData;
struct _bhyveConn *privconn = conn->privateData;
if (virConnectListDefinedDomainsEnsureACL(conn) < 0)
return -1;
@ -662,7 +662,7 @@ bhyveConnectListDefinedDomains(virConnectPtr conn, char **const names,
static int
bhyveConnectNumOfDefinedDomains(virConnectPtr conn)
{
bhyveConnPtr privconn = conn->privateData;
struct _bhyveConn *privconn = conn->privateData;
if (virConnectNumOfDefinedDomainsEnsureACL(conn) < 0)
return -1;
@ -679,10 +679,10 @@ bhyveConnectDomainXMLToNative(virConnectPtr conn,
unsigned int flags)
{
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
bhyveConnPtr privconn = conn->privateData;
virDomainDefPtr def = NULL;
virCommandPtr cmd = NULL;
virCommandPtr loadcmd = NULL;
struct _bhyveConn *privconn = conn->privateData;
virDomainDef *def = NULL;
virCommand *cmd = NULL;
virCommand *loadcmd = NULL;
char *ret = NULL;
virCheckFlags(0, NULL);
@ -746,7 +746,7 @@ bhyveConnectListAllDomains(virConnectPtr conn,
virDomainPtr **domains,
unsigned int flags)
{
bhyveConnPtr privconn = conn->privateData;
struct _bhyveConn *privconn = conn->privateData;
virCheckFlags(VIR_CONNECT_LIST_DOMAINS_FILTERS_ALL, -1);
@ -761,8 +761,8 @@ static virDomainPtr
bhyveDomainLookupByUUID(virConnectPtr conn,
const unsigned char *uuid)
{
bhyveConnPtr privconn = conn->privateData;
virDomainObjPtr vm;
struct _bhyveConn *privconn = conn->privateData;
virDomainObj *vm;
virDomainPtr dom = NULL;
vm = virDomainObjListFindByUUID(privconn->domains, uuid);
@ -788,8 +788,8 @@ bhyveDomainLookupByUUID(virConnectPtr conn,
static virDomainPtr bhyveDomainLookupByName(virConnectPtr conn,
const char *name)
{
bhyveConnPtr privconn = conn->privateData;
virDomainObjPtr vm;
struct _bhyveConn *privconn = conn->privateData;
virDomainObj *vm;
virDomainPtr dom = NULL;
vm = virDomainObjListFindByName(privconn->domains, name);
@ -814,8 +814,8 @@ static virDomainPtr
bhyveDomainLookupByID(virConnectPtr conn,
int id)
{
bhyveConnPtr privconn = conn->privateData;
virDomainObjPtr vm;
struct _bhyveConn *privconn = conn->privateData;
virDomainObj *vm;
virDomainPtr dom = NULL;
vm = virDomainObjListFindByID(privconn->domains, id);
@ -840,9 +840,9 @@ static int
bhyveDomainCreateWithFlags(virDomainPtr dom,
unsigned int flags)
{
bhyveConnPtr privconn = dom->conn->privateData;
virDomainObjPtr vm;
virObjectEventPtr event = NULL;
struct _bhyveConn *privconn = dom->conn->privateData;
virDomainObj *vm;
virObjectEvent *event = NULL;
unsigned int start_flags = 0;
int ret = -1;
@ -889,11 +889,11 @@ bhyveDomainCreateXML(virConnectPtr conn,
const char *xml,
unsigned int flags)
{
bhyveConnPtr privconn = conn->privateData;
struct _bhyveConn *privconn = conn->privateData;
virDomainPtr dom = NULL;
virDomainDefPtr def = NULL;
virDomainObjPtr vm = NULL;
virObjectEventPtr event = NULL;
virDomainDef *def = NULL;
virDomainObj *vm = NULL;
virObjectEvent *event = NULL;
unsigned int start_flags = 0;
unsigned int parse_flags = VIR_DOMAIN_DEF_PARSE_INACTIVE;
@ -949,9 +949,9 @@ static int
bhyveDomainDestroyFlags(virDomainPtr dom, unsigned int flags)
{
virConnectPtr conn = dom->conn;
bhyveConnPtr privconn = conn->privateData;
virDomainObjPtr vm;
virObjectEventPtr event = NULL;
struct _bhyveConn *privconn = conn->privateData;
virDomainObj *vm;
virObjectEvent *event = NULL;
int ret = -1;
virCheckFlags(0, -1);
@ -988,7 +988,7 @@ bhyveDomainDestroy(virDomainPtr dom)
static int
bhyveDomainShutdownFlags(virDomainPtr dom, unsigned int flags)
{
virDomainObjPtr vm;
virDomainObj *vm;
int ret = -1;
virCheckFlags(0, -1);
@ -1019,8 +1019,8 @@ static int
bhyveDomainReboot(virDomainPtr dom, unsigned int flags)
{
virConnectPtr conn = dom->conn;
virDomainObjPtr vm;
bhyveDomainObjPrivatePtr priv;
virDomainObj *vm;
bhyveDomainObjPrivate *priv;
int ret = -1;
virCheckFlags(VIR_DOMAIN_REBOOT_ACPI_POWER_BTN, -1);
@ -1050,8 +1050,8 @@ bhyveDomainOpenConsole(virDomainPtr dom,
virStreamPtr st,
unsigned int flags)
{
virDomainObjPtr vm = NULL;
virDomainChrDefPtr chr = NULL;
virDomainObj *vm = NULL;
virDomainChrDef *chr = NULL;
int ret = -1;
virCheckFlags(0, -1);
@ -1093,8 +1093,8 @@ bhyveDomainSetMetadata(virDomainPtr dom,
unsigned int flags)
{
virConnectPtr conn = dom->conn;
bhyveConnPtr privconn = conn->privateData;
virDomainObjPtr vm;
struct _bhyveConn *privconn = conn->privateData;
virDomainObj *vm;
int ret = -1;
virCheckFlags(VIR_DOMAIN_AFFECT_LIVE |
@ -1111,7 +1111,7 @@ bhyveDomainSetMetadata(virDomainPtr dom,
BHYVE_CONFIG_DIR, flags);
if (ret == 0) {
virObjectEventPtr ev = NULL;
virObjectEvent *ev = NULL;
ev = virDomainEventMetadataChangeNewFromObj(vm, type, uri);
virObjectEventStateQueue(privconn->domainEventState, ev);
}
@ -1128,7 +1128,7 @@ bhyveDomainGetMetadata(virDomainPtr dom,
const char *uri,
unsigned int flags)
{
virDomainObjPtr vm;
virDomainObj *vm;
char *ret = NULL;
if (!(vm = bhyveDomObjFromDomain(dom)))
@ -1314,7 +1314,7 @@ bhyveStateInitialize(bool privileged,
}
unsigned
bhyveDriverGetBhyveCaps(bhyveConnPtr driver)
bhyveDriverGetBhyveCaps(struct _bhyveConn *driver)
{
if (driver != NULL)
return driver->bhyvecaps;
@ -1322,7 +1322,7 @@ bhyveDriverGetBhyveCaps(bhyveConnPtr driver)
}
unsigned
bhyveDriverGetGrubCaps(bhyveConnPtr driver)
bhyveDriverGetGrubCaps(struct _bhyveConn *driver)
{
if (driver != NULL)
return driver->grubcaps;
@ -1403,8 +1403,8 @@ bhyveConnectBaselineCPU(virConnectPtr conn,
unsigned int ncpus,
unsigned int flags)
{
virCPUDefPtr *cpus = NULL;
virCPUDefPtr cpu = NULL;
virCPUDef **cpus = NULL;
virCPUDef *cpu = NULL;
char *cpustr = NULL;
virCheckFlags(VIR_CONNECT_BASELINE_CPU_EXPAND_FEATURES |
@ -1438,9 +1438,9 @@ bhyveConnectCompareCPU(virConnectPtr conn,
const char *xmlDesc,
unsigned int flags)
{
bhyveConnPtr driver = conn->privateData;
struct _bhyveConn *driver = conn->privateData;
int ret = VIR_CPU_COMPARE_ERROR;
virCapsPtr caps = NULL;
virCaps *caps = NULL;
bool failIncompatible;
bool validateXML;
@ -1484,7 +1484,7 @@ bhyveConnectDomainEventRegisterAny(virConnectPtr conn,
void *opaque,
virFreeCallback freecb)
{
bhyveConnPtr privconn = conn->privateData;
struct _bhyveConn *privconn = conn->privateData;
int ret;
if (virConnectDomainEventRegisterAnyEnsureACL(conn) < 0)
@ -1503,7 +1503,7 @@ static int
bhyveConnectDomainEventDeregisterAny(virConnectPtr conn,
int callbackID)
{
bhyveConnPtr privconn = conn->privateData;
struct _bhyveConn *privconn = conn->privateData;
if (virConnectDomainEventDeregisterAnyEnsureACL(conn) < 0)
return -1;
@ -1519,7 +1519,7 @@ bhyveConnectDomainEventDeregisterAny(virConnectPtr conn,
static int
bhyveDomainHasManagedSaveImage(virDomainPtr domain, unsigned int flags)
{
virDomainObjPtr vm = NULL;
virDomainObj *vm = NULL;
int ret = -1;
virCheckFlags(0, -1);
@ -1572,8 +1572,8 @@ bhyveConnectDomainXMLFromNative(virConnectPtr conn,
unsigned int flags)
{
char *xml = NULL;
virDomainDefPtr def = NULL;
bhyveConnPtr privconn = conn->privateData;
virDomainDef *def = NULL;
struct _bhyveConn *privconn = conn->privateData;
unsigned bhyveCaps = bhyveDriverGetBhyveCaps(privconn);
virCheckFlags(0, NULL);
@ -1607,7 +1607,7 @@ bhyveConnectGetDomainCapabilities(virConnectPtr conn,
const char *virttype_str,
unsigned int flags)
{
virDomainCapsPtr caps = NULL;
virDomainCaps *caps = NULL;
char *ret = NULL;
int virttype = VIR_DOMAIN_VIRT_BHYVE;
int arch = virArchFromHost(); /* virArch */

View File

@ -25,8 +25,8 @@
int bhyveRegister(void);
unsigned bhyveDriverGetBhyveCaps(bhyveConnPtr driver);
unsigned bhyveDriverGetBhyveCaps(struct _bhyveConn *driver);
unsigned bhyveDriverGetGrubCaps(bhyveConnPtr driver);
unsigned bhyveDriverGetGrubCaps(struct _bhyveConn *driver);
virCapsPtr bhyveDriverGetCapabilities(bhyveConnPtr driver);
virCaps *bhyveDriverGetCapabilities(struct _bhyveConn *driver);

View File

@ -36,8 +36,8 @@ VIR_LOG_INIT("bhyve.bhyve_firmware");
#define BHYVE_DEFAULT_FIRMWARE "BHYVE_UEFI.fd"
int
bhyveFirmwareFillDomain(bhyveConnPtr driver,
virDomainDefPtr def,
bhyveFirmwareFillDomain(bhyveConn *driver,
virDomainDef *def,
unsigned int flags)
{
g_autoptr(DIR) dir = NULL;

View File

@ -25,6 +25,6 @@
#include "bhyve_utils.h"
int
bhyveFirmwareFillDomain(bhyveConnPtr driver,
virDomainDefPtr def,
bhyveFirmwareFillDomain(bhyveConn *driver,
virDomainDef *def,
unsigned int flags);

View File

@ -41,19 +41,19 @@ VIR_LOG_INIT("bhyve.bhyve_monitor");
struct _bhyveMonitor {
virObject parent;
bhyveConnPtr driver;
virDomainObjPtr vm;
struct _bhyveConn *driver;
virDomainObj *vm;
int kq;
int watch;
bool reboot;
};
static virClassPtr bhyveMonitorClass;
static virClass *bhyveMonitorClass;
static void
bhyveMonitorDispose(void *obj)
{
bhyveMonitorPtr mon = obj;
bhyveMonitor *mon = obj;
VIR_FORCE_CLOSE(mon->kq);
virObjectUnref(mon->vm);
@ -73,7 +73,7 @@ VIR_ONCE_GLOBAL_INIT(bhyveMonitor);
static void bhyveMonitorIO(int, int, int, void *);
static bool
bhyveMonitorRegister(bhyveMonitorPtr mon)
bhyveMonitorRegister(bhyveMonitor *mon)
{
virObjectRef(mon);
mon->watch = virEventAddHandle(mon->kq,
@ -92,7 +92,7 @@ bhyveMonitorRegister(bhyveMonitorPtr mon)
}
static void
bhyveMonitorUnregister(bhyveMonitorPtr mon)
bhyveMonitorUnregister(bhyveMonitor *mon)
{
if (mon->watch < 0)
return;
@ -102,7 +102,7 @@ bhyveMonitorUnregister(bhyveMonitorPtr mon)
}
void
bhyveMonitorSetReboot(bhyveMonitorPtr mon)
bhyveMonitorSetReboot(bhyveMonitor *mon)
{
mon->reboot = true;
}
@ -111,9 +111,9 @@ static void
bhyveMonitorIO(int watch, int kq, int events G_GNUC_UNUSED, void *opaque)
{
const struct timespec zerowait = { 0, 0 };
bhyveMonitorPtr mon = opaque;
virDomainObjPtr vm = mon->vm;
bhyveConnPtr driver = mon->driver;
bhyveMonitor *mon = opaque;
virDomainObj *vm = mon->vm;
struct _bhyveConn *driver = mon->driver;
const char *name;
struct kevent kev;
int rc, status;
@ -172,10 +172,10 @@ bhyveMonitorIO(int watch, int kq, int events G_GNUC_UNUSED, void *opaque)
}
}
static bhyveMonitorPtr
bhyveMonitorOpenImpl(virDomainObjPtr vm, bhyveConnPtr driver)
static bhyveMonitor *
bhyveMonitorOpenImpl(virDomainObj *vm, struct _bhyveConn *driver)
{
bhyveMonitorPtr mon;
bhyveMonitor *mon;
struct kevent kev;
if (bhyveMonitorInitialize() < 0)
@ -217,10 +217,10 @@ bhyveMonitorOpenImpl(virDomainObjPtr vm, bhyveConnPtr driver)
return NULL;
}
bhyveMonitorPtr
bhyveMonitorOpen(virDomainObjPtr vm, bhyveConnPtr driver)
bhyveMonitor *
bhyveMonitorOpen(virDomainObj *vm, struct _bhyveConn *driver)
{
bhyveMonitorPtr mon;
bhyveMonitor *mon;
virObjectRef(vm);
mon = bhyveMonitorOpenImpl(vm, driver);
@ -230,7 +230,7 @@ bhyveMonitorOpen(virDomainObjPtr vm, bhyveConnPtr driver)
}
void
bhyveMonitorClose(bhyveMonitorPtr mon)
bhyveMonitorClose(bhyveMonitor *mon)
{
if (mon == NULL)
return;

View File

@ -25,9 +25,8 @@
#include "bhyve_utils.h"
typedef struct _bhyveMonitor bhyveMonitor;
typedef bhyveMonitor *bhyveMonitorPtr;
bhyveMonitorPtr bhyveMonitorOpen(virDomainObjPtr vm, bhyveConnPtr driver);
void bhyveMonitorClose(bhyveMonitorPtr mon);
bhyveMonitor *bhyveMonitorOpen(virDomainObj *vm, struct _bhyveConn *driver);
void bhyveMonitorClose(bhyveMonitor *mon);
void bhyveMonitorSetReboot(bhyveMonitorPtr mon);
void bhyveMonitorSetReboot(bhyveMonitor *mon);

View File

@ -258,7 +258,7 @@ bhyveCommandLineToArgv(const char *nativeConfig,
}
static int
bhyveParseBhyveLPCArg(virDomainDefPtr def,
bhyveParseBhyveLPCArg(virDomainDef *def,
unsigned caps G_GNUC_UNUSED,
const char *arg)
{
@ -266,7 +266,7 @@ bhyveParseBhyveLPCArg(virDomainDefPtr def,
const char *separator = NULL;
const char *param = NULL;
size_t last = 0;
virDomainChrDefPtr chr = NULL;
virDomainChrDef *chr = NULL;
char *type = NULL;
separator = strchr(arg, ',');
@ -400,7 +400,7 @@ bhyveParsePCISlot(const char *slotdef,
}
static int
bhyveParsePCIDisk(virDomainDefPtr def,
bhyveParsePCIDisk(virDomainDef *def,
unsigned caps G_GNUC_UNUSED,
unsigned pcibus,
unsigned pcislot,
@ -414,7 +414,7 @@ bhyveParsePCIDisk(virDomainDefPtr def,
/* -s slot,virtio-blk|ahci-cd|ahci-hd,/path/to/file */
const char *separator = NULL;
int idx = -1;
virDomainDiskDefPtr disk = NULL;
virDomainDiskDef *disk = NULL;
if (!(disk = virDomainDiskDefNew(NULL)))
return 0;
@ -470,8 +470,8 @@ bhyveParsePCIDisk(virDomainDefPtr def,
}
static int
bhyveParsePCINet(virDomainDefPtr def,
virDomainXMLOptionPtr xmlopt,
bhyveParsePCINet(virDomainDef *def,
virDomainXMLOption *xmlopt,
unsigned caps G_GNUC_UNUSED,
unsigned bus,
unsigned slot,
@ -481,7 +481,7 @@ bhyveParsePCINet(virDomainDefPtr def,
{
/* -s slot,virtio-net,tapN[,mac=xx:xx:xx:xx:xx:xx] */
virDomainNetDefPtr net = NULL;
virDomainNetDef *net = NULL;
const char *separator = NULL;
const char *mac = NULL;
@ -546,8 +546,8 @@ bhyveParsePCINet(virDomainDefPtr def,
}
static int
bhyveParsePCIFbuf(virDomainDefPtr def,
virDomainXMLOptionPtr xmlopt,
bhyveParsePCIFbuf(virDomainDef *def,
virDomainXMLOption *xmlopt,
unsigned caps G_GNUC_UNUSED,
unsigned bus,
unsigned slot,
@ -556,8 +556,8 @@ bhyveParsePCIFbuf(virDomainDefPtr def,
{
/* -s slot,fbuf,wait,vga=on|io|off,rfb=<ip>:port,w=width,h=height */
virDomainVideoDefPtr video = NULL;
virDomainGraphicsDefPtr graphics = NULL;
virDomainVideoDef *video = NULL;
virDomainGraphicsDef *graphics = NULL;
g_auto(GStrv) params = NULL;
GStrv next;
@ -657,8 +657,8 @@ bhyveParsePCIFbuf(virDomainDefPtr def,
}
static int
bhyveParseBhyvePCIArg(virDomainDefPtr def,
virDomainXMLOptionPtr xmlopt,
bhyveParseBhyvePCIArg(virDomainDef *def,
virDomainXMLOption *xmlopt,
unsigned caps,
unsigned *nvirtiodisk,
unsigned *nahcidisk,
@ -742,8 +742,8 @@ bhyveParseBhyvePCIArg(virDomainDefPtr def,
* Parse the /usr/sbin/bhyve command line.
*/
static int
bhyveParseBhyveCommandLine(virDomainDefPtr def,
virDomainXMLOptionPtr xmlopt,
bhyveParseBhyveCommandLine(virDomainDef *def,
virDomainXMLOption *xmlopt,
unsigned caps,
int argc, char **argv)
{
@ -852,7 +852,7 @@ bhyveParseBhyveCommandLine(virDomainDefPtr def,
* Parse the /usr/sbin/bhyveload command line.
*/
static int
bhyveParseBhyveLoadCommandLine(virDomainDefPtr def,
bhyveParseBhyveLoadCommandLine(virDomainDef *def,
int argc, char **argv)
{
/* bhyveload called with default arguments when only -m and -d are given.
@ -932,7 +932,7 @@ bhyveParseBhyveLoadCommandLine(virDomainDefPtr def,
#undef CONSUME_ARG
static int
bhyveParseCustomLoaderCommandLine(virDomainDefPtr def,
bhyveParseCustomLoaderCommandLine(virDomainDef *def,
int argc G_GNUC_UNUSED,
char **argv)
{
@ -945,12 +945,12 @@ bhyveParseCustomLoaderCommandLine(virDomainDefPtr def,
return 0;
}
virDomainDefPtr
virDomainDef *
bhyveParseCommandLineString(const char* nativeConfig,
unsigned caps,
virDomainXMLOptionPtr xmlopt)
virDomainXMLOption *xmlopt)
{
virDomainDefPtr def = NULL;
virDomainDef *def = NULL;
int bhyve_argc = 0;
char **bhyve_argv = NULL;
int loader_argc = 0;

View File

@ -20,6 +20,6 @@
#pragma once
virDomainDefPtr bhyveParseCommandLineString(const char* nativeConfig,
unsigned caps,
virDomainXMLOptionPtr xmlopt);
virDomainDef *bhyveParseCommandLineString(const char* nativeConfig,
unsigned caps,
virDomainXMLOption *xmlopt);

View File

@ -55,11 +55,11 @@
VIR_LOG_INIT("bhyve.bhyve_process");
static void
bhyveProcessAutoDestroy(virDomainObjPtr vm,
bhyveProcessAutoDestroy(virDomainObj *vm,
virConnectPtr conn G_GNUC_UNUSED,
void *opaque)
{
bhyveConnPtr driver = opaque;
struct _bhyveConn *driver = opaque;
virBhyveProcessStop(driver, vm, VIR_DOMAIN_SHUTOFF_DESTROYED);
@ -68,12 +68,12 @@ bhyveProcessAutoDestroy(virDomainObjPtr vm,
}
static void
bhyveNetCleanup(virDomainObjPtr vm)
bhyveNetCleanup(virDomainObj *vm)
{
size_t i;
for (i = 0; i < vm->def->nnets; i++) {
virDomainNetDefPtr net = vm->def->nets[i];
virDomainNetDef *net = vm->def->nets[i];
virDomainNetType actualType = virDomainNetGetActualType(net);
if (actualType == VIR_DOMAIN_NET_TYPE_BRIDGE) {
@ -94,7 +94,7 @@ virBhyveFormatDevMapFile(const char *vm_name, char **fn_out)
}
static int
bhyveProcessStartHook(virDomainObjPtr vm, virHookBhyveOpType op)
bhyveProcessStartHook(virDomainObj *vm, virHookBhyveOpType op)
{
if (!virHookPresent(VIR_HOOK_DRIVER_BHYVE))
return 0;
@ -104,7 +104,7 @@ bhyveProcessStartHook(virDomainObjPtr vm, virHookBhyveOpType op)
}
static void
bhyveProcessStopHook(virDomainObjPtr vm, virHookBhyveOpType op)
bhyveProcessStopHook(virDomainObj *vm, virHookBhyveOpType op)
{
if (virHookPresent(VIR_HOOK_DRIVER_BHYVE))
virHookCall(VIR_HOOK_DRIVER_BHYVE, vm->def->name, op,
@ -112,17 +112,17 @@ bhyveProcessStopHook(virDomainObjPtr vm, virHookBhyveOpType op)
}
static int
virBhyveProcessStartImpl(bhyveConnPtr driver,
virDomainObjPtr vm,
virBhyveProcessStartImpl(struct _bhyveConn *driver,
virDomainObj *vm,
virDomainRunningReason reason)
{
char *devmap_file = NULL;
char *devicemap = NULL;
char *logfile = NULL;
int logfd = -1;
virCommandPtr cmd = NULL;
virCommandPtr load_cmd = NULL;
bhyveDomainObjPrivatePtr priv = vm->privateData;
virCommand *cmd = NULL;
virCommand *load_cmd = NULL;
bhyveDomainObjPrivate *priv = vm->privateData;
int ret = -1, rc;
logfile = g_strdup_printf("%s/%s.log", BHYVE_LOG_DIR, vm->def->name);
@ -233,7 +233,7 @@ virBhyveProcessStartImpl(bhyveConnPtr driver,
if (ret < 0) {
int exitstatus; /* Needed to avoid logging non-zero status */
virCommandPtr destroy_cmd;
virCommand *destroy_cmd;
if ((destroy_cmd = virBhyveProcessBuildDestroyCmd(driver,
vm->def)) != NULL) {
virCommandSetOutputFD(load_cmd, &logfd);
@ -253,8 +253,8 @@ virBhyveProcessStartImpl(bhyveConnPtr driver,
}
int
bhyveProcessPrepareDomain(bhyveConnPtr driver,
virDomainObjPtr vm,
bhyveProcessPrepareDomain(bhyveConn *driver,
virDomainObj *vm,
unsigned int flags)
{
if (bhyveFirmwareFillDomain(driver, vm->def, flags) < 0)
@ -265,11 +265,11 @@ bhyveProcessPrepareDomain(bhyveConnPtr driver,
int
virBhyveProcessStart(virConnectPtr conn,
virDomainObjPtr vm,
virDomainObj *vm,
virDomainRunningReason reason,
unsigned int flags)
{
bhyveConnPtr driver = conn->privateData;
struct _bhyveConn *driver = conn->privateData;
/* Run an early hook to setup missing devices. */
if (bhyveProcessStartHook(vm, VIR_HOOK_BHYVE_OP_PREPARE) < 0)
@ -287,13 +287,13 @@ virBhyveProcessStart(virConnectPtr conn,
}
int
virBhyveProcessStop(bhyveConnPtr driver,
virDomainObjPtr vm,
virBhyveProcessStop(struct _bhyveConn *driver,
virDomainObj *vm,
virDomainShutoffReason reason)
{
int ret = -1;
virCommandPtr cmd = NULL;
bhyveDomainObjPrivatePtr priv = vm->privateData;
virCommand *cmd = NULL;
bhyveDomainObjPrivate *priv = vm->privateData;
if (!virDomainObjIsActive(vm)) {
VIR_DEBUG("VM '%s' not active", vm->def->name);
@ -351,7 +351,7 @@ virBhyveProcessStop(bhyveConnPtr driver,
}
int
virBhyveProcessShutdown(virDomainObjPtr vm)
virBhyveProcessShutdown(virDomainObj *vm)
{
if (vm->pid <= 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
@ -374,8 +374,8 @@ virBhyveProcessShutdown(virDomainObjPtr vm)
}
int
virBhyveProcessRestart(bhyveConnPtr driver,
virDomainObjPtr vm)
virBhyveProcessRestart(struct _bhyveConn *driver,
virDomainObj *vm)
{
if (virBhyveProcessStop(driver, vm, VIR_DOMAIN_SHUTOFF_SHUTDOWN) < 0)
return -1;
@ -387,7 +387,7 @@ virBhyveProcessRestart(bhyveConnPtr driver,
}
int
virBhyveGetDomainTotalCpuStats(virDomainObjPtr vm,
virBhyveGetDomainTotalCpuStats(virDomainObj *vm,
unsigned long long *cpustats)
{
struct kinfo_proc *kp;
@ -423,12 +423,12 @@ virBhyveGetDomainTotalCpuStats(virDomainObjPtr vm,
}
struct bhyveProcessReconnectData {
bhyveConnPtr driver;
struct _bhyveConn *driver;
kvm_t *kd;
};
static int
virBhyveProcessReconnect(virDomainObjPtr vm,
virBhyveProcessReconnect(virDomainObj *vm,
void *opaque)
{
struct bhyveProcessReconnectData *data = opaque;
@ -436,7 +436,7 @@ virBhyveProcessReconnect(virDomainObjPtr vm,
int nprocs;
char **proc_argv;
char *expected_proctitle = NULL;
bhyveDomainObjPrivatePtr priv = vm->privateData;
bhyveDomainObjPrivate *priv = vm->privateData;
int ret = -1;
if (!virDomainObjIsActive(vm))
@ -489,7 +489,7 @@ virBhyveProcessReconnect(virDomainObjPtr vm,
}
void
virBhyveProcessReconnectAll(bhyveConnPtr driver)
virBhyveProcessReconnectAll(struct _bhyveConn *driver)
{
kvm_t *kd;
struct bhyveProcessReconnectData data;

View File

@ -24,28 +24,28 @@
#include "bhyve_utils.h"
int
bhyveProcessPrepareDomain(bhyveConnPtr driver,
virDomainObjPtr vm,
bhyveProcessPrepareDomain(bhyveConn *driver,
virDomainObj *vm,
unsigned int flags);
int virBhyveProcessStart(virConnectPtr conn,
virDomainObjPtr vm,
int virBhyveProcessStart(virConnect *conn,
virDomainObj *vm,
virDomainRunningReason reason,
unsigned int flags);
int virBhyveProcessStop(bhyveConnPtr driver,
virDomainObjPtr vm,
int virBhyveProcessStop(struct _bhyveConn *driver,
virDomainObj *vm,
virDomainShutoffReason reason);
int virBhyveProcessRestart(bhyveConnPtr driver,
virDomainObjPtr vm);
int virBhyveProcessRestart(struct _bhyveConn *driver,
virDomainObj *vm);
int virBhyveProcessShutdown(virDomainObjPtr vm);
int virBhyveProcessShutdown(virDomainObj *vm);
int virBhyveGetDomainTotalCpuStats(virDomainObjPtr vm,
int virBhyveGetDomainTotalCpuStats(virDomainObj *vm,
unsigned long long *cpustats);
void virBhyveProcessReconnectAll(bhyveConnPtr driver);
void virBhyveProcessReconnectAll(struct _bhyveConn *driver);
typedef enum {
VIR_BHYVE_PROCESS_START_AUTODESTROY = 1 << 0,

View File

@ -35,8 +35,6 @@
#define BHYVE_LOG_DIR LOCALSTATEDIR "/log/libvirt/bhyve"
typedef struct _virBhyveDriverConfig virBhyveDriverConfig;
typedef struct _virBhyveDriverConfig *virBhyveDriverConfigPtr;
struct _virBhyveDriverConfig {
virObject parent;
@ -48,34 +46,33 @@ G_DEFINE_AUTOPTR_CLEANUP_FUNC(virBhyveDriverConfig, virObjectUnref);
struct _bhyveConn {
virMutex lock;
virBhyveDriverConfigPtr config;
struct _virBhyveDriverConfig *config;
/* pid file FD, ensures two copies of the driver can't use the same root */
int lockFD;
virDomainObjListPtr domains;
virCapsPtr caps;
virDomainXMLOptionPtr xmlopt;
virDomainObjList *domains;
virCaps *caps;
virDomainXMLOption *xmlopt;
char *pidfile;
virSysinfoDefPtr hostsysinfo;
virSysinfoDef *hostsysinfo;
virObjectEventStatePtr domainEventState;
virObjectEventState *domainEventState;
virCloseCallbacksPtr closeCallbacks;
virCloseCallbacks *closeCallbacks;
virPortAllocatorRangePtr remotePorts;
virPortAllocatorRange *remotePorts;
unsigned bhyvecaps;
unsigned grubcaps;
};
typedef struct _bhyveConn bhyveConn;
typedef struct _bhyveConn *bhyveConnPtr;
struct bhyveAutostartData {
bhyveConnPtr driver;
struct _bhyveConn *driver;
virConnectPtr conn;
};
void bhyveDriverLock(bhyveConnPtr driver);
void bhyveDriverUnlock(bhyveConnPtr driver);
void bhyveDriverLock(struct _bhyveConn *driver);
void bhyveDriverUnlock(struct _bhyveConn *driver);

View File

@ -64,7 +64,7 @@ VIR_ENUM_IMPL(virDomainBackupDiskBackupMode,
"incremental");
void
virDomainBackupDefFree(virDomainBackupDefPtr def)
virDomainBackupDefFree(virDomainBackupDef *def)
{
size_t i;
@ -76,7 +76,7 @@ virDomainBackupDefFree(virDomainBackupDefPtr def)
virStorageNetHostDefFree(1, def->server);
for (i = 0; i < def->ndisks; i++) {
virDomainBackupDiskDefPtr disk = def->disks + i;
virDomainBackupDiskDef *disk = def->disks + i;
g_free(disk->name);
g_free(disk->incremental);
@ -97,10 +97,10 @@ virDomainBackupDefFree(virDomainBackupDefPtr def)
static int
virDomainBackupDiskDefParseXML(xmlNodePtr node,
xmlXPathContextPtr ctxt,
virDomainBackupDiskDefPtr def,
virDomainBackupDiskDef *def,
bool push,
unsigned int flags,
virDomainXMLOptionPtr xmlopt)
virDomainXMLOption *xmlopt)
{
VIR_XPATH_NODE_AUTORESTORE(ctxt)
g_autofree char *type = NULL;
@ -200,7 +200,7 @@ virDomainBackupDiskDefParseXML(xmlNodePtr node,
static void
virDomainBackupDefParsePrivate(virDomainBackupDefPtr def,
virDomainBackupDefParsePrivate(virDomainBackupDef *def,
xmlXPathContextPtr ctxt,
unsigned int flags)
{
@ -212,9 +212,9 @@ virDomainBackupDefParsePrivate(virDomainBackupDefPtr def,
}
static virDomainBackupDefPtr
static virDomainBackupDef *
virDomainBackupDefParse(xmlXPathContextPtr ctxt,
virDomainXMLOptionPtr xmlopt,
virDomainXMLOption *xmlopt,
unsigned int flags)
{
g_autoptr(virDomainBackupDef) def = NULL;
@ -302,12 +302,12 @@ virDomainBackupDefParse(xmlXPathContextPtr ctxt,
}
virDomainBackupDefPtr
virDomainBackupDef *
virDomainBackupDefParseString(const char *xmlStr,
virDomainXMLOptionPtr xmlopt,
virDomainXMLOption *xmlopt,
unsigned int flags)
{
virDomainBackupDefPtr ret = NULL;
virDomainBackupDef *ret = NULL;
g_autoptr(xmlDoc) xml = NULL;
int keepBlanksDefault = xmlKeepBlanksDefault(0);
@ -322,10 +322,10 @@ virDomainBackupDefParseString(const char *xmlStr,
}
virDomainBackupDefPtr
virDomainBackupDef *
virDomainBackupDefParseNode(xmlDocPtr xml,
xmlNodePtr root,
virDomainXMLOptionPtr xmlopt,
virDomainXMLOption *xmlopt,
unsigned int flags)
{
g_autoptr(xmlXPathContext) ctxt = NULL;
@ -355,8 +355,8 @@ virDomainBackupDefParseNode(xmlDocPtr xml,
static int
virDomainBackupDiskDefFormat(virBufferPtr buf,
virDomainBackupDiskDefPtr disk,
virDomainBackupDiskDefFormat(virBuffer *buf,
virDomainBackupDiskDef *disk,
bool push,
bool internal)
{
@ -408,8 +408,8 @@ virDomainBackupDiskDefFormat(virBufferPtr buf,
static void
virDomainBackupDefFormatPrivate(virBufferPtr buf,
virDomainBackupDefPtr def,
virDomainBackupDefFormatPrivate(virBuffer *buf,
virDomainBackupDef *def,
bool internal)
{
g_auto(virBuffer) privChildBuf = VIR_BUFFER_INIT_CHILD(buf);
@ -428,8 +428,8 @@ virDomainBackupDefFormatPrivate(virBufferPtr buf,
int
virDomainBackupDefFormat(virBufferPtr buf,
virDomainBackupDefPtr def,
virDomainBackupDefFormat(virBuffer *buf,
virDomainBackupDef *def,
bool internal)
{
g_auto(virBuffer) attrBuf = VIR_BUFFER_INITIALIZER;
@ -473,8 +473,8 @@ virDomainBackupDefFormat(virBufferPtr buf,
static int
virDomainBackupDefAssignStore(virDomainBackupDiskDefPtr disk,
virStorageSourcePtr src,
virDomainBackupDefAssignStore(virDomainBackupDiskDef *disk,
virStorageSource *src,
const char *suffix)
{
if (virStorageSourceIsEmpty(src)) {
@ -501,8 +501,8 @@ virDomainBackupDefAssignStore(virDomainBackupDiskDefPtr disk,
int
virDomainBackupAlignDisks(virDomainBackupDefPtr def,
virDomainDefPtr dom,
virDomainBackupAlignDisks(virDomainBackupDef *def,
virDomainDef *dom,
const char *suffix)
{
g_autoptr(GHashTable) disks = virHashNew(NULL);
@ -519,8 +519,8 @@ virDomainBackupAlignDisks(virDomainBackupDefPtr def,
/* Double check requested disks. */
for (i = 0; i < def->ndisks; i++) {
virDomainBackupDiskDefPtr backupdisk = &def->disks[i];
virDomainDiskDefPtr domdisk;
virDomainBackupDiskDef *backupdisk = &def->disks[i];
virDomainDiskDef *domdisk;
if (!(domdisk = virDomainDiskByTarget(dom, backupdisk->name))) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
@ -557,8 +557,8 @@ virDomainBackupAlignDisks(virDomainBackupDefPtr def,
VIR_EXPAND_N(def->disks, def->ndisks, dom->ndisks - def->ndisks);
for (i = 0; i < dom->ndisks; i++) {
virDomainBackupDiskDefPtr backupdisk = NULL;
virDomainDiskDefPtr domdisk = dom->disks[i];
virDomainBackupDiskDef *backupdisk = NULL;
virDomainDiskDef *domdisk = dom->disks[i];
if (virHashHasEntry(disks, domdisk->dst))
continue;
@ -579,7 +579,7 @@ virDomainBackupAlignDisks(virDomainBackupDefPtr def,
}
for (i = 0; i < def->ndisks; i++) {
virDomainBackupDiskDefPtr backupdisk = &def->disks[i];
virDomainBackupDiskDef *backupdisk = &def->disks[i];
if (backupdisk->backupmode == VIR_DOMAIN_BACKUP_DISK_BACKUP_MODE_DEFAULT) {
if (def->incremental || backupdisk->incremental) {

View File

@ -57,7 +57,6 @@ typedef enum {
/* Stores disk-backup information */
typedef struct _virDomainBackupDiskDef virDomainBackupDiskDef;
typedef virDomainBackupDiskDef *virDomainBackupDiskDefPtr;
struct _virDomainBackupDiskDef {
char *name; /* name matching the <target dev='...' of the domain */
virTristateBool backup; /* whether backup is requested */
@ -67,7 +66,7 @@ struct _virDomainBackupDiskDef {
char *exportbitmap; /* name of the bitmap exposed in NBD for pull mode backup */
/* details of target for push-mode, or of the scratch file for pull-mode */
virStorageSourcePtr store;
virStorageSource *store;
/* internal data */
virDomainBackupDiskState state;
@ -75,12 +74,11 @@ struct _virDomainBackupDiskDef {
/* Stores the complete backup metadata */
typedef struct _virDomainBackupDef virDomainBackupDef;
typedef virDomainBackupDef *virDomainBackupDefPtr;
struct _virDomainBackupDef {
/* Public XML. */
int type; /* virDomainBackupType */
char *incremental;
virStorageNetHostDefPtr server; /* only when type == PULL */
virStorageNetHostDef *server; /* only when type == PULL */
virTristateBool tls; /* use TLS for NBD */
size_t ndisks; /* should not exceed dom->ndisks */
@ -107,26 +105,26 @@ typedef enum {
VIR_DOMAIN_BACKUP_PARSE_INTERNAL = 1 << 0,
} virDomainBackupParseFlags;
virDomainBackupDefPtr
virDomainBackupDef *
virDomainBackupDefParseString(const char *xmlStr,
virDomainXMLOptionPtr xmlopt,
virDomainXMLOption *xmlopt,
unsigned int flags);
virDomainBackupDefPtr
virDomainBackupDef *
virDomainBackupDefParseNode(xmlDocPtr xml,
xmlNodePtr root,
virDomainXMLOptionPtr xmlopt,
virDomainXMLOption *xmlopt,
unsigned int flags);
void
virDomainBackupDefFree(virDomainBackupDefPtr def);
virDomainBackupDefFree(virDomainBackupDef *def);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(virDomainBackupDef, virDomainBackupDefFree);
int
virDomainBackupDefFormat(virBufferPtr buf,
virDomainBackupDefPtr def,
virDomainBackupDefFormat(virBuffer *buf,
virDomainBackupDef *def,
bool internal);
int
virDomainBackupAlignDisks(virDomainBackupDefPtr backup,
virDomainDefPtr dom,
virDomainBackupAlignDisks(virDomainBackupDef *backup,
virDomainDef *dom,
const char *suffix);

View File

@ -54,7 +54,7 @@ VIR_ENUM_IMPL(virCapsHostPMTarget,
"suspend_mem", "suspend_disk", "suspend_hybrid",
);
static virClassPtr virCapsClass;
static virClass *virCapsClass;
static void virCapsDispose(void *obj);
static int virCapabilitiesOnceInit(void)
@ -75,12 +75,12 @@ VIR_ONCE_GLOBAL_INIT(virCapabilities);
*
* Allocate a new capabilities object
*/
virCapsPtr
virCaps *
virCapabilitiesNew(virArch hostarch,
bool offlineMigrate,
bool liveMigrate)
{
virCapsPtr caps;
virCaps *caps;
if (virCapabilitiesInitialize() < 0)
return NULL;
@ -96,7 +96,7 @@ virCapabilitiesNew(virArch hostarch,
}
void
virCapabilitiesClearHostNUMACellCPUTopology(virCapsHostNUMACellCPUPtr cpus,
virCapabilitiesClearHostNUMACellCPUTopology(virCapsHostNUMACellCPU *cpus,
size_t ncpus)
{
size_t i;
@ -111,7 +111,7 @@ virCapabilitiesClearHostNUMACellCPUTopology(virCapsHostNUMACellCPUPtr cpus,
}
static void
virCapabilitiesFreeHostNUMACell(virCapsHostNUMACellPtr cell)
virCapabilitiesFreeHostNUMACell(virCapsHostNUMACell *cell)
{
if (cell == NULL)
return;
@ -125,7 +125,7 @@ virCapabilitiesFreeHostNUMACell(virCapsHostNUMACellPtr cell)
}
static void
virCapabilitiesFreeGuestMachine(virCapsGuestMachinePtr machine)
virCapabilitiesFreeGuestMachine(virCapsGuestMachine *machine)
{
if (machine == NULL)
return;
@ -135,7 +135,7 @@ virCapabilitiesFreeGuestMachine(virCapsGuestMachinePtr machine)
}
static void
virCapabilitiesFreeGuestDomain(virCapsGuestDomainPtr dom)
virCapabilitiesFreeGuestDomain(virCapsGuestDomain *dom)
{
size_t i;
if (dom == NULL)
@ -151,7 +151,7 @@ virCapabilitiesFreeGuestDomain(virCapsGuestDomainPtr dom)
}
void
virCapabilitiesFreeGuest(virCapsGuestPtr guest)
virCapabilitiesFreeGuest(virCapsGuest *guest)
{
size_t i;
if (guest == NULL)
@ -172,7 +172,7 @@ virCapabilitiesFreeGuest(virCapsGuestPtr guest)
static void
virCapabilitiesFreeStoragePool(virCapsStoragePoolPtr pool)
virCapabilitiesFreeStoragePool(virCapsStoragePool *pool)
{
if (!pool)
return;
@ -182,7 +182,7 @@ virCapabilitiesFreeStoragePool(virCapsStoragePoolPtr pool)
void
virCapabilitiesHostNUMAUnref(virCapsHostNUMAPtr caps)
virCapabilitiesHostNUMAUnref(virCapsHostNUMA *caps)
{
if (!caps)
return;
@ -195,13 +195,13 @@ virCapabilitiesHostNUMAUnref(virCapsHostNUMAPtr caps)
}
void
virCapabilitiesHostNUMARef(virCapsHostNUMAPtr caps)
virCapabilitiesHostNUMARef(virCapsHostNUMA *caps)
{
g_atomic_int_inc(&caps->refs);
}
static void
virCapsHostMemBWNodeFree(virCapsHostMemBWNodePtr ptr)
virCapsHostMemBWNodeFree(virCapsHostMemBWNode *ptr)
{
if (!ptr)
return;
@ -211,7 +211,7 @@ virCapsHostMemBWNodeFree(virCapsHostMemBWNodePtr ptr)
}
static void
virCapabilitiesClearSecModel(virCapsHostSecModelPtr secmodel)
virCapabilitiesClearSecModel(virCapsHostSecModel *secmodel)
{
size_t i;
for (i = 0; i < secmodel->nlabels; i++) {
@ -227,7 +227,7 @@ virCapabilitiesClearSecModel(virCapsHostSecModelPtr secmodel)
static void
virCapsDispose(void *object)
{
virCapsPtr caps = object;
virCaps *caps = object;
size_t i;
for (i = 0; i < caps->npools; i++)
@ -277,7 +277,7 @@ virCapsDispose(void *object)
* Registers a new host CPU feature, eg 'pae', or 'vmx'
*/
int
virCapabilitiesAddHostFeature(virCapsPtr caps,
virCapabilitiesAddHostFeature(virCaps *caps,
const char *name)
{
VIR_RESIZE_N(caps->host.features, caps->host.nfeatures_max,
@ -296,7 +296,7 @@ virCapabilitiesAddHostFeature(virCapsPtr caps,
* Registers a new domain migration transport URI
*/
int
virCapabilitiesAddHostMigrateTransport(virCapsPtr caps,
virCapabilitiesAddHostMigrateTransport(virCaps *caps,
const char *name)
{
VIR_RESIZE_N(caps->host.migrateTrans, caps->host.nmigrateTrans_max,
@ -315,7 +315,7 @@ virCapabilitiesAddHostMigrateTransport(virCapsPtr caps,
* Registers the prefix that is used for generated network interfaces
*/
int
virCapabilitiesSetNetPrefix(virCapsPtr caps,
virCapabilitiesSetNetPrefix(virCaps *caps,
const char *prefix)
{
caps->host.netprefix = g_strdup(prefix);
@ -340,17 +340,17 @@ virCapabilitiesSetNetPrefix(virCapsPtr caps,
* array of CPU IDs belonging to the cell
*/
void
virCapabilitiesHostNUMAAddCell(virCapsHostNUMAPtr caps,
virCapabilitiesHostNUMAAddCell(virCapsHostNUMA *caps,
int num,
unsigned long long mem,
int ncpus,
virCapsHostNUMACellCPUPtr cpus,
virCapsHostNUMACellCPU *cpus,
int nsiblings,
virCapsHostNUMACellSiblingInfoPtr siblings,
virCapsHostNUMACellSiblingInfo *siblings,
int npageinfo,
virCapsHostNUMACellPageInfoPtr pageinfo)
virCapsHostNUMACellPageInfo *pageinfo)
{
virCapsHostNUMACellPtr cell = g_new0(virCapsHostNUMACell, 1);
virCapsHostNUMACell *cell = g_new0(virCapsHostNUMACell, 1);
cell->num = num;
cell->mem = mem;
@ -369,16 +369,16 @@ virCapabilitiesHostNUMAAddCell(virCapsHostNUMAPtr caps,
* @machines: machine variants for emulator ('pc', or 'isapc', etc)
* @nmachines: number of machine variants for emulator
*
* Allocate a table of virCapsGuestMachinePtr from the supplied table
* Allocate a table of virCapsGuestMachine *from the supplied table
* of machine names.
*/
virCapsGuestMachinePtr *
virCapsGuestMachine **
virCapabilitiesAllocMachines(const char *const *names, int nnames)
{
virCapsGuestMachinePtr *machines;
virCapsGuestMachine **machines;
size_t i;
machines = g_new0(virCapsGuestMachinePtr, nnames);
machines = g_new0(virCapsGuestMachine *, nnames);
for (i = 0; i < nnames; i++) {
machines[i] = g_new0(virCapsGuestMachine, 1);
@ -392,10 +392,10 @@ virCapabilitiesAllocMachines(const char *const *names, int nnames)
* virCapabilitiesFreeMachines:
* @machines: table of vircapsGuestMachinePtr
*
* Free a table of virCapsGuestMachinePtr
* Free a table of virCapsGuestMachine *
*/
void
virCapabilitiesFreeMachines(virCapsGuestMachinePtr *machines,
virCapabilitiesFreeMachines(virCapsGuestMachine **machines,
int nmachines)
{
size_t i;
@ -423,16 +423,16 @@ virCapabilitiesFreeMachines(virCapsGuestMachinePtr *machines,
* followed by registration of at least one domain for
* running the guest
*/
virCapsGuestPtr
virCapabilitiesAddGuest(virCapsPtr caps,
virCapsGuest *
virCapabilitiesAddGuest(virCaps *caps,
int ostype,
virArch arch,
const char *emulator,
const char *loader,
int nmachines,
virCapsGuestMachinePtr *machines)
virCapsGuestMachine **machines)
{
virCapsGuestPtr guest;
virCapsGuest *guest;
guest = g_new0(virCapsGuest, 1);
@ -467,15 +467,15 @@ virCapabilitiesAddGuest(virCapsPtr caps,
* Registers a virtual domain capable of running a
* guest operating system
*/
virCapsGuestDomainPtr
virCapabilitiesAddGuestDomain(virCapsGuestPtr guest,
virCapsGuestDomain *
virCapabilitiesAddGuestDomain(virCapsGuest *guest,
int hvtype,
const char *emulator,
const char *loader,
int nmachines,
virCapsGuestMachinePtr *machines)
virCapsGuestMachine **machines)
{
virCapsGuestDomainPtr dom;
virCapsGuestDomain *dom;
dom = g_new0(virCapsGuestDomain, 1);
@ -516,7 +516,7 @@ static const struct virCapsGuestFeatureInfo virCapsGuestFeatureInfos[VIR_CAPS_GU
static void
virCapabilitiesAddGuestFeatureInternal(virCapsGuestPtr guest,
virCapabilitiesAddGuestFeatureInternal(virCapsGuest *guest,
virCapsGuestFeatureType feature,
bool defaultOn,
bool toggle)
@ -538,7 +538,7 @@ virCapabilitiesAddGuestFeatureInternal(virCapsGuestPtr guest,
* Registers a feature for a guest domain.
*/
void
virCapabilitiesAddGuestFeature(virCapsGuestPtr guest,
virCapabilitiesAddGuestFeature(virCapsGuest *guest,
virCapsGuestFeatureType feature)
{
virCapabilitiesAddGuestFeatureInternal(guest, feature, false, false);
@ -555,7 +555,7 @@ virCapabilitiesAddGuestFeature(virCapsGuestPtr guest,
* Registers a feature with toggles for a guest domain.
*/
void
virCapabilitiesAddGuestFeatureWithToggle(virCapsGuestPtr guest,
virCapabilitiesAddGuestFeatureWithToggle(virCapsGuest *guest,
virCapsGuestFeatureType feature,
bool defaultOn,
bool toggle)
@ -573,7 +573,7 @@ virCapabilitiesAddGuestFeatureWithToggle(virCapsGuestPtr guest,
* Returns non-zero on error.
*/
extern int
virCapabilitiesHostSecModelAddBaseLabel(virCapsHostSecModelPtr secmodel,
virCapabilitiesHostSecModelAddBaseLabel(virCapsHostSecModel *secmodel,
const char *type,
const char *label)
{
@ -588,24 +588,24 @@ virCapabilitiesHostSecModelAddBaseLabel(virCapsHostSecModelPtr secmodel,
}
static virCapsDomainDataPtr
virCapabilitiesDomainDataLookupInternal(virCapsPtr caps,
static virCapsDomainData *
virCapabilitiesDomainDataLookupInternal(virCaps *caps,
int ostype,
virArch arch,
virDomainVirtType domaintype,
const char *emulator,
const char *machinetype)
{
virCapsGuestPtr foundguest = NULL;
virCapsGuestDomainPtr founddomain = NULL;
virCapsGuestMachinePtr foundmachine = NULL;
virCapsDomainDataPtr ret = NULL;
virCapsGuest *foundguest = NULL;
virCapsGuestDomain *founddomain = NULL;
virCapsGuestMachine *foundmachine = NULL;
virCapsDomainData *ret = NULL;
size_t i, j, k;
VIR_DEBUG("Lookup ostype=%d arch=%d domaintype=%d emulator=%s machine=%s",
ostype, arch, domaintype, NULLSTR(emulator), NULLSTR(machinetype));
for (i = 0; i < caps->nguests; i++) {
virCapsGuestPtr guest = caps->guests[i];
virCapsGuest *guest = caps->guests[i];
if (ostype != -1 && guest->ostype != ostype) {
VIR_DEBUG("Skip os type want=%d vs got=%d", ostype, guest->ostype);
@ -620,8 +620,8 @@ virCapabilitiesDomainDataLookupInternal(virCapsPtr caps,
VIR_DEBUG("Match arch %d", arch);
for (j = 0; j < guest->arch.ndomains; j++) {
virCapsGuestDomainPtr domain = guest->arch.domains[j];
virCapsGuestMachinePtr *machinelist;
virCapsGuestDomain *domain = guest->arch.domains[j];
virCapsGuestMachine **machinelist;
int nmachines;
const char *check_emulator = NULL;
@ -651,7 +651,7 @@ virCapabilitiesDomainDataLookupInternal(virCapsPtr caps,
}
for (k = 0; k < nmachines; k++) {
virCapsGuestMachinePtr machine = machinelist[k];
virCapsGuestMachine *machine = machinelist[k];
if (machinetype &&
STRNEQ(machine->name, machinetype) &&
@ -733,15 +733,15 @@ virCapabilitiesDomainDataLookupInternal(virCapsPtr caps,
* Search capabilities for the passed values, and if found return
* virCapabilitiesDomainDataLookup filled in with the default values
*/
virCapsDomainDataPtr
virCapabilitiesDomainDataLookup(virCapsPtr caps,
virCapsDomainData *
virCapabilitiesDomainDataLookup(virCaps *caps,
int ostype,
virArch arch,
int domaintype,
const char *emulator,
const char *machinetype)
{
virCapsDomainDataPtr ret;
virCapsDomainData *ret;
if (arch == VIR_ARCH_NONE) {
/* Prefer host arch if its available */
@ -760,12 +760,12 @@ virCapabilitiesDomainDataLookup(virCapsPtr caps,
bool
virCapabilitiesDomainSupported(virCapsPtr caps,
virCapabilitiesDomainSupported(virCaps *caps,
int ostype,
virArch arch,
int virttype)
{
g_autofree virCapsDomainDataPtr capsdata = NULL;
g_autofree virCapsDomainData *capsdata = NULL;
capsdata = virCapabilitiesDomainDataLookup(caps, ostype,
arch,
@ -777,10 +777,10 @@ virCapabilitiesDomainSupported(virCapsPtr caps,
int
virCapabilitiesAddStoragePool(virCapsPtr caps,
virCapabilitiesAddStoragePool(virCaps *caps,
int poolType)
{
virCapsStoragePoolPtr pool;
virCapsStoragePool *pool;
pool = g_new0(virCapsStoragePool, 1);
@ -794,8 +794,8 @@ virCapabilitiesAddStoragePool(virCapsPtr caps,
static int
virCapabilitiesHostNUMAFormat(virCapsHostNUMAPtr caps,
virBufferPtr buf)
virCapabilitiesHostNUMAFormat(virCapsHostNUMA *caps,
virBuffer *buf)
{
size_t i;
size_t j;
@ -806,7 +806,7 @@ virCapabilitiesHostNUMAFormat(virCapsHostNUMAPtr caps,
virBufferAsprintf(buf, "<cells num='%d'>\n", caps->cells->len);
virBufferAdjustIndent(buf, 2);
for (i = 0; i < caps->cells->len; i++) {
virCapsHostNUMACellPtr cell = g_ptr_array_index(caps->cells, i);
virCapsHostNUMACell *cell = g_ptr_array_index(caps->cells, i);
virBufferAsprintf(buf, "<cell id='%d'>\n", cell->num);
virBufferAdjustIndent(buf, 2);
@ -866,8 +866,8 @@ virCapabilitiesHostNUMAFormat(virCapsHostNUMAPtr caps,
static int
virCapabilitiesFormatResctrlMonitor(virBufferPtr buf,
virResctrlInfoMonPtr monitor)
virCapabilitiesFormatResctrlMonitor(virBuffer *buf,
virResctrlInfoMon *monitor)
{
size_t i = 0;
g_auto(virBuffer) childrenBuf = VIR_BUFFER_INIT_CHILD(buf);
@ -905,8 +905,8 @@ virCapabilitiesFormatResctrlMonitor(virBufferPtr buf,
}
static int
virCapabilitiesFormatCaches(virBufferPtr buf,
virCapsHostCachePtr cache)
virCapabilitiesFormatCaches(virBuffer *buf,
virCapsHostCache *cache)
{
size_t i = 0;
size_t j = 0;
@ -920,7 +920,7 @@ virCapabilitiesFormatCaches(virBufferPtr buf,
for (i = 0; i < cache->nbanks; i++) {
g_auto(virBuffer) attrBuf = VIR_BUFFER_INITIALIZER;
g_auto(virBuffer) childrenBuf = VIR_BUFFER_INIT_CHILD(buf);
virCapsHostCacheBankPtr bank = cache->banks[i];
virCapsHostCacheBank *bank = cache->banks[i];
g_autofree char *cpus_str = virBitmapFormat(bank->cpus);
const char *unit = NULL;
unsigned long long short_size = virFormatIntPretty(bank->size, &unit);
@ -941,7 +941,7 @@ virCapabilitiesFormatCaches(virBufferPtr buf,
for (j = 0; j < bank->ncontrols; j++) {
const char *min_unit;
virResctrlInfoPerCachePtr controls = bank->controls[j];
virResctrlInfoPerCache *controls = bank->controls[j];
unsigned long long gran_short_size = controls->granularity;
unsigned long long min_short_size = controls->min;
@ -991,8 +991,8 @@ virCapabilitiesFormatCaches(virBufferPtr buf,
}
static int
virCapabilitiesFormatMemoryBandwidth(virBufferPtr buf,
virCapsHostMemBWPtr memBW)
virCapabilitiesFormatMemoryBandwidth(virBuffer *buf,
virCapsHostMemBW *memBW)
{
size_t i = 0;
@ -1005,8 +1005,8 @@ virCapabilitiesFormatMemoryBandwidth(virBufferPtr buf,
for (i = 0; i < memBW->nnodes; i++) {
g_auto(virBuffer) attrBuf = VIR_BUFFER_INITIALIZER;
g_auto(virBuffer) childrenBuf = VIR_BUFFER_INIT_CHILD(buf);
virCapsHostMemBWNodePtr node = memBW->nodes[i];
virResctrlInfoMemBWPerNodePtr control = &node->control;
virCapsHostMemBWNode *node = memBW->nodes[i];
virResctrlInfoMemBWPerNode *control = &node->control;
g_autofree char *cpus_str = virBitmapFormat(node->cpus);
if (!cpus_str)
@ -1036,8 +1036,8 @@ virCapabilitiesFormatMemoryBandwidth(virBufferPtr buf,
static int
virCapabilitiesFormatHostXML(virCapsHostPtr host,
virBufferPtr buf)
virCapabilitiesFormatHostXML(virCapsHost *host,
virBuffer *buf)
{
size_t i, j;
char host_uuid[VIR_UUID_STRING_BUFLEN];
@ -1159,14 +1159,14 @@ virCapabilitiesFormatHostXML(virCapsHostPtr host,
static void
virCapabilitiesFormatGuestFeatures(virCapsGuestPtr guest,
virBufferPtr buf)
virCapabilitiesFormatGuestFeatures(virCapsGuest *guest,
virBuffer *buf)
{
g_auto(virBuffer) childBuf = VIR_BUFFER_INIT_CHILD(buf);
size_t i;
for (i = 0; i < VIR_CAPS_GUEST_FEATURE_TYPE_LAST; i++) {
virCapsGuestFeaturePtr feature = guest->features + i;
virCapsGuestFeature *feature = guest->features + i;
if (!feature->present)
continue;
@ -1191,9 +1191,9 @@ virCapabilitiesFormatGuestFeatures(virCapsGuestPtr guest,
static void
virCapabilitiesFormatGuestXML(virCapsGuestPtr *guests,
virCapabilitiesFormatGuestXML(virCapsGuest **guests,
size_t nguests,
virBufferPtr buf)
virBuffer *buf)
{
size_t i, j, k;
@ -1216,7 +1216,7 @@ virCapabilitiesFormatGuestXML(virCapsGuestPtr *guests,
guests[i]->arch.defaultInfo.loader);
for (j = 0; j < guests[i]->arch.defaultInfo.nmachines; j++) {
virCapsGuestMachinePtr machine = guests[i]->arch.defaultInfo.machines[j];
virCapsGuestMachine *machine = guests[i]->arch.defaultInfo.machines[j];
virBufferAddLit(buf, "<machine");
if (machine->canonical)
virBufferAsprintf(buf, " canonical='%s'", machine->canonical);
@ -1246,7 +1246,7 @@ virCapabilitiesFormatGuestXML(virCapsGuestPtr *guests,
guests[i]->arch.domains[j]->info.loader);
for (k = 0; k < guests[i]->arch.domains[j]->info.nmachines; k++) {
virCapsGuestMachinePtr machine = guests[i]->arch.domains[j]->info.machines[k];
virCapsGuestMachine *machine = guests[i]->arch.domains[j]->info.machines[k];
virBufferAddLit(buf, "<machine");
if (machine->canonical)
virBufferAsprintf(buf, " canonical='%s'", machine->canonical);
@ -1270,9 +1270,9 @@ virCapabilitiesFormatGuestXML(virCapsGuestPtr *guests,
static void
virCapabilitiesFormatStoragePoolXML(virCapsStoragePoolPtr *pools,
virCapabilitiesFormatStoragePoolXML(virCapsStoragePool **pools,
size_t npools,
virBufferPtr buf)
virBuffer *buf)
{
size_t i;
@ -1304,7 +1304,7 @@ virCapabilitiesFormatStoragePoolXML(virCapsStoragePoolPtr *pools,
* Returns the XML document as a string
*/
char *
virCapabilitiesFormatXML(virCapsPtr caps)
virCapabilitiesFormatXML(virCaps *caps)
{
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
@ -1326,15 +1326,14 @@ virCapabilitiesFormatXML(virCapsPtr caps)
/* get the maximum ID of cpus in the host */
static unsigned int
virCapabilitiesHostNUMAGetMaxcpu(virCapsHostNUMAPtr caps)
virCapabilitiesHostNUMAGetMaxcpu(virCapsHostNUMA *caps)
{
unsigned int maxcpu = 0;
size_t node;
size_t cpu;
for (node = 0; node < caps->cells->len; node++) {
virCapsHostNUMACellPtr cell =
g_ptr_array_index(caps->cells, node);
virCapsHostNUMACell *cell = g_ptr_array_index(caps->cells, node);
for (cpu = 0; cpu < cell->ncpus; cpu++) {
if (cell->cpus[cpu].id > maxcpu)
@ -1347,11 +1346,11 @@ virCapabilitiesHostNUMAGetMaxcpu(virCapsHostNUMAPtr caps)
/* set cpus of a numa node in the bitmask */
static int
virCapabilitiesHostNUMAGetCellCpus(virCapsHostNUMAPtr caps,
virCapabilitiesHostNUMAGetCellCpus(virCapsHostNUMA *caps,
size_t node,
virBitmapPtr cpumask)
virBitmap *cpumask)
{
virCapsHostNUMACellPtr cell = NULL;
virCapsHostNUMACell *cell = NULL;
size_t cpu;
size_t i;
/* The numa node numbers can be non-contiguous. Ex: 0,1,16,17. */
@ -1375,11 +1374,11 @@ virCapabilitiesHostNUMAGetCellCpus(virCapsHostNUMAPtr caps,
return 0;
}
virBitmapPtr
virCapabilitiesHostNUMAGetCpus(virCapsHostNUMAPtr caps,
virBitmapPtr nodemask)
virBitmap *
virCapabilitiesHostNUMAGetCpus(virCapsHostNUMA *caps,
virBitmap *nodemask)
{
virBitmapPtr ret = NULL;
virBitmap *ret = NULL;
unsigned int maxcpu = virCapabilitiesHostNUMAGetMaxcpu(caps);
ssize_t node = -1;
@ -1423,7 +1422,7 @@ virCapabilitiesGetNodeInfo(virNodeInfoPtr nodeinfo)
/* returns 1 on success, 0 if the detection failed and -1 on hard error */
static int
virCapabilitiesFillCPUInfo(int cpu_id G_GNUC_UNUSED,
virCapsHostNUMACellCPUPtr cpu G_GNUC_UNUSED)
virCapsHostNUMACellCPU *cpu G_GNUC_UNUSED)
{
#ifdef __linux__
cpu->id = cpu_id;
@ -1446,10 +1445,10 @@ virCapabilitiesFillCPUInfo(int cpu_id G_GNUC_UNUSED,
static int
virCapabilitiesGetNUMASiblingInfo(int node,
virCapsHostNUMACellSiblingInfoPtr *siblings,
virCapsHostNUMACellSiblingInfo **siblings,
int *nsiblings)
{
virCapsHostNUMACellSiblingInfoPtr tmp = NULL;
virCapsHostNUMACellSiblingInfo *tmp = NULL;
int tmp_size = 0;
int ret = -1;
int *distances = NULL;
@ -1490,7 +1489,7 @@ virCapabilitiesGetNUMASiblingInfo(int node,
static int
virCapabilitiesGetNUMAPagesInfo(int node,
virCapsHostNUMACellPageInfoPtr *pageinfo,
virCapsHostNUMACellPageInfo **pageinfo,
int *npageinfo)
{
int ret = -1;
@ -1519,10 +1518,10 @@ virCapabilitiesGetNUMAPagesInfo(int node,
static int
virCapabilitiesHostNUMAInitFake(virCapsHostNUMAPtr caps)
virCapabilitiesHostNUMAInitFake(virCapsHostNUMA *caps)
{
virNodeInfo nodeinfo;
virCapsHostNUMACellCPUPtr cpus;
virCapsHostNUMACellCPU *cpus;
int ncpus;
int n, s, c, t;
int id, cid;
@ -1583,15 +1582,15 @@ virCapabilitiesHostNUMAInitFake(virCapsHostNUMAPtr caps)
static int
virCapabilitiesHostNUMAInitReal(virCapsHostNUMAPtr caps)
virCapabilitiesHostNUMAInitReal(virCapsHostNUMA *caps)
{
int n;
unsigned long long memory;
virCapsHostNUMACellCPUPtr cpus = NULL;
virBitmapPtr cpumap = NULL;
virCapsHostNUMACellSiblingInfoPtr siblings = NULL;
virCapsHostNUMACellCPU *cpus = NULL;
virBitmap *cpumap = NULL;
virCapsHostNUMACellSiblingInfo *siblings = NULL;
int nsiblings = 0;
virCapsHostNUMACellPageInfoPtr pageinfo = NULL;
virCapsHostNUMACellPageInfo *pageinfo = NULL;
int npageinfo;
int ret = -1;
int ncpus = 0;
@ -1654,10 +1653,10 @@ virCapabilitiesHostNUMAInitReal(virCapsHostNUMAPtr caps)
}
virCapsHostNUMAPtr
virCapsHostNUMA *
virCapabilitiesHostNUMANew(void)
{
virCapsHostNUMAPtr caps = NULL;
virCapsHostNUMA *caps = NULL;
caps = g_new0(virCapsHostNUMA, 1);
caps->refs = 1;
@ -1668,10 +1667,10 @@ virCapabilitiesHostNUMANew(void)
}
virCapsHostNUMAPtr
virCapsHostNUMA *
virCapabilitiesHostNUMANewHost(void)
{
virCapsHostNUMAPtr caps = virCapabilitiesHostNUMANew();
virCapsHostNUMA *caps = virCapabilitiesHostNUMANew();
if (virNumaIsAvailable()) {
if (virCapabilitiesHostNUMAInitReal(caps) == 0)
@ -1692,7 +1691,7 @@ virCapabilitiesHostNUMANewHost(void)
int
virCapabilitiesInitPages(virCapsPtr caps)
virCapabilitiesInitPages(virCaps *caps)
{
int ret = -1;
unsigned int *pages_size = NULL;
@ -1714,8 +1713,8 @@ virCapabilitiesInitPages(virCapsPtr caps)
bool
virCapsHostCacheBankEquals(virCapsHostCacheBankPtr a,
virCapsHostCacheBankPtr b)
virCapsHostCacheBankEquals(virCapsHostCacheBank *a,
virCapsHostCacheBank *b)
{
return (a->id == b->id &&
a->level == b->level &&
@ -1725,7 +1724,7 @@ virCapsHostCacheBankEquals(virCapsHostCacheBankPtr a,
}
void
virCapsHostCacheBankFree(virCapsHostCacheBankPtr ptr)
virCapsHostCacheBankFree(virCapsHostCacheBank *ptr)
{
size_t i;
@ -1744,8 +1743,8 @@ static int
virCapsHostCacheBankSorter(const void *a,
const void *b)
{
virCapsHostCacheBankPtr ca = *(virCapsHostCacheBankPtr *)a;
virCapsHostCacheBankPtr cb = *(virCapsHostCacheBankPtr *)b;
virCapsHostCacheBank *ca = *(virCapsHostCacheBank **)a;
virCapsHostCacheBank *cb = *(virCapsHostCacheBank **)b;
if (ca->level < cb->level)
return -1;
@ -1757,7 +1756,7 @@ virCapsHostCacheBankSorter(const void *a,
static int
virCapabilitiesInitResctrl(virCapsPtr caps)
virCapabilitiesInitResctrl(virCaps *caps)
{
if (caps->host.resctrl)
return 0;
@ -1771,16 +1770,16 @@ virCapabilitiesInitResctrl(virCapsPtr caps)
static int
virCapabilitiesInitResctrlMemory(virCapsPtr caps)
virCapabilitiesInitResctrlMemory(virCaps *caps)
{
virCapsHostMemBWNodePtr node = NULL;
virCapsHostMemBWNode *node = NULL;
size_t i = 0;
int ret = -1;
const virResctrlMonitorType montype = VIR_RESCTRL_MONITOR_TYPE_MEMBW;
const char *prefix = virResctrlMonitorPrefixTypeToString(montype);
for (i = 0; i < caps->host.cache.nbanks; i++) {
virCapsHostCacheBankPtr bank = caps->host.cache.banks[i];
virCapsHostCacheBank *bank = caps->host.cache.banks[i];
node = g_new0(virCapsHostMemBWNode, 1);
if (virResctrlInfoGetMemoryBandwidth(caps->host.resctrl,
@ -1809,16 +1808,16 @@ virCapabilitiesInitResctrlMemory(virCapsPtr caps)
int
virCapabilitiesInitCaches(virCapsPtr caps)
virCapabilitiesInitCaches(virCaps *caps)
{
size_t i = 0;
virBitmapPtr cpus = NULL;
virBitmap *cpus = NULL;
ssize_t pos = -1;
int ret = -1;
char *path = NULL;
char *type = NULL;
struct dirent *ent = NULL;
virCapsHostCacheBankPtr bank = NULL;
virCapsHostCacheBank *bank = NULL;
const virResctrlMonitorType montype = VIR_RESCTRL_MONITOR_TYPE_CACHE;
const char *prefix = virResctrlMonitorPrefixTypeToString(montype);
@ -1952,7 +1951,7 @@ virCapabilitiesInitCaches(virCapsPtr caps)
void
virCapabilitiesHostInitIOMMU(virCapsPtr caps)
virCapabilitiesHostInitIOMMU(virCaps *caps)
{
caps->host.iommu = virHostHasIOMMU();
}

View File

@ -63,7 +63,7 @@ struct _virCapsGuestDomainInfo {
char *emulator;
char *loader;
int nmachines;
virCapsGuestMachinePtr *machines;
virCapsGuestMachine **machines;
};
struct _virCapsGuestDomain {
@ -77,7 +77,7 @@ struct _virCapsGuestArch {
virCapsGuestDomainInfo defaultInfo;
size_t ndomains;
size_t ndomains_max;
virCapsGuestDomainPtr *domains;
virCapsGuestDomain **domains;
};
struct _virCapsGuest {
@ -91,7 +91,7 @@ struct _virCapsHostNUMACellCPU {
unsigned int socket_id;
unsigned int die_id;
unsigned int core_id;
virBitmapPtr siblings;
virBitmap *siblings;
};
struct _virCapsHostNUMACellSiblingInfo {
@ -108,11 +108,11 @@ struct _virCapsHostNUMACell {
int num;
int ncpus;
unsigned long long mem; /* in kibibytes */
virCapsHostNUMACellCPUPtr cpus;
virCapsHostNUMACellCPU *cpus;
int nsiblings;
virCapsHostNUMACellSiblingInfoPtr siblings;
virCapsHostNUMACellSiblingInfo *siblings;
int npageinfo;
virCapsHostNUMACellPageInfoPtr pageinfo;
virCapsHostNUMACellPageInfo *pageinfo;
};
struct _virCapsHostNUMA {
@ -129,7 +129,7 @@ struct _virCapsHostSecModel {
char *model;
char *doi;
size_t nlabels;
virCapsHostSecModelLabelPtr labels;
virCapsHostSecModelLabel *labels;
};
struct _virCapsHostCacheBank {
@ -137,29 +137,29 @@ struct _virCapsHostCacheBank {
unsigned int level; /* 1=L1, 2=L2, 3=L3, etc. */
unsigned long long size; /* B */
virCacheType type; /* Data, Instruction or Unified */
virBitmapPtr cpus; /* All CPUs that share this bank */
virBitmap *cpus; /* All CPUs that share this bank */
size_t ncontrols;
virResctrlInfoPerCachePtr *controls;
virResctrlInfoPerCache **controls;
};
struct _virCapsHostCache {
size_t nbanks;
virCapsHostCacheBankPtr *banks;
virCapsHostCacheBank **banks;
virResctrlInfoMonPtr monitor;
virResctrlInfoMon *monitor;
};
struct _virCapsHostMemBWNode {
unsigned int id;
virBitmapPtr cpus; /* All CPUs that belong to this node */
virBitmap *cpus; /* All CPUs that belong to this node */
virResctrlInfoMemBWPerNode control;
};
struct _virCapsHostMemBW {
size_t nnodes;
virCapsHostMemBWNodePtr *nodes;
virCapsHostMemBWNode **nodes;
virResctrlInfoMonPtr monitor;
virResctrlInfoMon *monitor;
};
struct _virCapsHost {
@ -176,19 +176,19 @@ struct _virCapsHost {
size_t nmigrateTrans_max;
char **migrateTrans;
virCapsHostNUMAPtr numa;
virCapsHostNUMA *numa;
virResctrlInfoPtr resctrl;
virResctrlInfo *resctrl;
virCapsHostCache cache;
virCapsHostMemBW memBW;
size_t nsecModels;
virCapsHostSecModelPtr secModels;
virCapsHostSecModel *secModels;
char *netprefix;
virCPUDefPtr cpu;
virCPUDef *cpu;
int nPagesSize; /* size of pagesSize array */
unsigned int *pagesSize; /* page sizes support on the system */
unsigned char host_uuid[VIR_UUID_BUFLEN];
@ -206,11 +206,11 @@ struct _virCaps {
virCapsHost host;
size_t nguests;
size_t nguests_max;
virCapsGuestPtr *guests;
virCapsGuest **guests;
size_t npools;
size_t npools_max;
virCapsStoragePoolPtr *pools;
virCapsStoragePool **pools;
};
G_DEFINE_AUTOPTR_CLEANUP_FUNC(virCaps, virObjectUnref);
@ -225,88 +225,88 @@ struct _virCapsDomainData {
};
virCapsPtr
virCaps *
virCapabilitiesNew(virArch hostarch,
bool offlineMigrate,
bool liveMigrate);
void
virCapabilitiesHostNUMAUnref(virCapsHostNUMAPtr caps);
virCapabilitiesHostNUMAUnref(virCapsHostNUMA *caps);
void
virCapabilitiesHostNUMARef(virCapsHostNUMAPtr caps);
virCapabilitiesHostNUMARef(virCapsHostNUMA *caps);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(virCapsHostNUMA, virCapabilitiesHostNUMAUnref);
int
virCapabilitiesAddHostFeature(virCapsPtr caps,
virCapabilitiesAddHostFeature(virCaps *caps,
const char *name);
int
virCapabilitiesAddHostMigrateTransport(virCapsPtr caps,
virCapabilitiesAddHostMigrateTransport(virCaps *caps,
const char *name);
int
virCapabilitiesSetNetPrefix(virCapsPtr caps,
virCapabilitiesSetNetPrefix(virCaps *caps,
const char *prefix);
void
virCapabilitiesHostNUMAAddCell(virCapsHostNUMAPtr caps,
virCapabilitiesHostNUMAAddCell(virCapsHostNUMA *caps,
int num,
unsigned long long mem,
int ncpus,
virCapsHostNUMACellCPUPtr cpus,
virCapsHostNUMACellCPU *cpus,
int nsiblings,
virCapsHostNUMACellSiblingInfoPtr siblings,
virCapsHostNUMACellSiblingInfo *siblings,
int npageinfo,
virCapsHostNUMACellPageInfoPtr pageinfo);
virCapsHostNUMACellPageInfo *pageinfo);
virCapsGuestMachinePtr *
virCapsGuestMachine **
virCapabilitiesAllocMachines(const char *const *names,
int nnames);
void
virCapabilitiesFreeMachines(virCapsGuestMachinePtr *machines,
virCapabilitiesFreeMachines(virCapsGuestMachine **machines,
int nmachines);
void
virCapabilitiesFreeGuest(virCapsGuestPtr guest);
virCapabilitiesFreeGuest(virCapsGuest *guest);
virCapsGuestPtr
virCapabilitiesAddGuest(virCapsPtr caps,
virCapsGuest *
virCapabilitiesAddGuest(virCaps *caps,
int ostype,
virArch arch,
const char *emulator,
const char *loader,
int nmachines,
virCapsGuestMachinePtr *machines);
virCapsGuestMachine **machines);
virCapsGuestDomainPtr
virCapabilitiesAddGuestDomain(virCapsGuestPtr guest,
virCapsGuestDomain *
virCapabilitiesAddGuestDomain(virCapsGuest *guest,
int hvtype,
const char *emulator,
const char *loader,
int nmachines,
virCapsGuestMachinePtr *machines);
virCapsGuestMachine **machines);
void
virCapabilitiesAddGuestFeature(virCapsGuestPtr guest,
virCapabilitiesAddGuestFeature(virCapsGuest *guest,
virCapsGuestFeatureType feature);
void
virCapabilitiesAddGuestFeatureWithToggle(virCapsGuestPtr guest,
virCapabilitiesAddGuestFeatureWithToggle(virCapsGuest *guest,
virCapsGuestFeatureType feature,
bool defaultOn,
bool toggle);
int
virCapabilitiesAddStoragePool(virCapsPtr caps,
virCapabilitiesAddStoragePool(virCaps *caps,
int poolType);
int
virCapabilitiesHostSecModelAddBaseLabel(virCapsHostSecModelPtr secmodel,
virCapabilitiesHostSecModelAddBaseLabel(virCapsHostSecModel *secmodel,
const char *type,
const char *label);
virCapsDomainDataPtr
virCapabilitiesDomainDataLookup(virCapsPtr caps,
virCapsDomainData *
virCapabilitiesDomainDataLookup(virCaps *caps,
int ostype,
virArch arch,
int domaintype,
@ -314,33 +314,33 @@ virCapabilitiesDomainDataLookup(virCapsPtr caps,
const char *machinetype);
bool
virCapabilitiesDomainSupported(virCapsPtr caps,
virCapabilitiesDomainSupported(virCaps *caps,
int ostype,
virArch arch,
int domaintype);
void
virCapabilitiesClearHostNUMACellCPUTopology(virCapsHostNUMACellCPUPtr cpu,
virCapabilitiesClearHostNUMACellCPUTopology(virCapsHostNUMACellCPU *cpu,
size_t ncpus);
char *
virCapabilitiesFormatXML(virCapsPtr caps);
virCapabilitiesFormatXML(virCaps *caps);
virBitmapPtr virCapabilitiesHostNUMAGetCpus(virCapsHostNUMAPtr caps,
virBitmapPtr nodemask);
virBitmap *virCapabilitiesHostNUMAGetCpus(virCapsHostNUMA *caps,
virBitmap *nodemask);
int virCapabilitiesGetNodeInfo(virNodeInfoPtr nodeinfo);
int virCapabilitiesInitPages(virCapsPtr caps);
int virCapabilitiesInitPages(virCaps *caps);
virCapsHostNUMAPtr virCapabilitiesHostNUMANew(void);
virCapsHostNUMAPtr virCapabilitiesHostNUMANewHost(void);
virCapsHostNUMA *virCapabilitiesHostNUMANew(void);
virCapsHostNUMA *virCapabilitiesHostNUMANewHost(void);
bool virCapsHostCacheBankEquals(virCapsHostCacheBankPtr a,
virCapsHostCacheBankPtr b);
void virCapsHostCacheBankFree(virCapsHostCacheBankPtr ptr);
bool virCapsHostCacheBankEquals(virCapsHostCacheBank *a,
virCapsHostCacheBank *b);
void virCapsHostCacheBankFree(virCapsHostCacheBank *ptr);
int virCapabilitiesInitCaches(virCapsPtr caps);
int virCapabilitiesInitCaches(virCaps *caps);
void virCapabilitiesHostInitIOMMU(virCapsPtr caps);
void virCapabilitiesHostInitIOMMU(virCaps *caps);

View File

@ -42,7 +42,7 @@
VIR_LOG_INIT("conf.checkpoint_conf");
static virClassPtr virDomainCheckpointDefClass;
static virClass *virDomainCheckpointDefClass;
static void virDomainCheckpointDefDispose(void *obj);
static int
@ -63,14 +63,14 @@ VIR_ENUM_IMPL(virDomainCheckpoint,
/* Checkpoint Def functions */
static void
virDomainCheckpointDiskDefClear(virDomainCheckpointDiskDefPtr disk)
virDomainCheckpointDiskDefClear(virDomainCheckpointDiskDef *disk)
{
VIR_FREE(disk->name);
VIR_FREE(disk->bitmap);
}
/* Allocate a new virDomainCheckpointDef; free with virObjectUnref() */
virDomainCheckpointDefPtr
virDomainCheckpointDef *
virDomainCheckpointDefNew(void)
{
if (virDomainCheckpointInitialize() < 0)
@ -82,7 +82,7 @@ virDomainCheckpointDefNew(void)
static void
virDomainCheckpointDefDispose(void *obj)
{
virDomainCheckpointDefPtr def = obj;
virDomainCheckpointDef *def = obj;
size_t i;
for (i = 0; i < def->ndisks; i++)
@ -93,7 +93,7 @@ virDomainCheckpointDefDispose(void *obj)
static int
virDomainCheckpointDiskDefParseXML(xmlNodePtr node,
xmlXPathContextPtr ctxt,
virDomainCheckpointDiskDefPtr def)
virDomainCheckpointDiskDef *def)
{
g_autofree char *checkpoint = NULL;
VIR_XPATH_NODE_AUTORESTORE(ctxt)
@ -117,13 +117,13 @@ virDomainCheckpointDiskDefParseXML(xmlNodePtr node,
/* flags is bitwise-or of virDomainCheckpointParseFlags.
*/
static virDomainCheckpointDefPtr
static virDomainCheckpointDef *
virDomainCheckpointDefParse(xmlXPathContextPtr ctxt,
virDomainXMLOptionPtr xmlopt,
virDomainXMLOption *xmlopt,
void *parseOpaque,
unsigned int flags)
{
virDomainCheckpointDefPtr ret = NULL;
virDomainCheckpointDef *ret = NULL;
size_t i;
int n;
g_autofree xmlNodePtr *nodes = NULL;
@ -185,10 +185,10 @@ virDomainCheckpointDefParse(xmlXPathContextPtr ctxt,
return ret;
}
static virDomainCheckpointDefPtr
static virDomainCheckpointDef *
virDomainCheckpointDefParseNode(xmlDocPtr xml,
xmlNodePtr root,
virDomainXMLOptionPtr xmlopt,
virDomainXMLOption *xmlopt,
void *parseOpaque,
unsigned int flags)
{
@ -216,13 +216,13 @@ virDomainCheckpointDefParseNode(xmlDocPtr xml,
return virDomainCheckpointDefParse(ctxt, xmlopt, parseOpaque, flags);
}
virDomainCheckpointDefPtr
virDomainCheckpointDef *
virDomainCheckpointDefParseString(const char *xmlStr,
virDomainXMLOptionPtr xmlopt,
virDomainXMLOption *xmlopt,
void *parseOpaque,
unsigned int flags)
{
virDomainCheckpointDefPtr ret = NULL;
virDomainCheckpointDef *ret = NULL;
xmlDocPtr xml;
int keepBlanksDefault = xmlKeepBlanksDefault(0);
@ -246,12 +246,12 @@ virDomainCheckpointDefParseString(const char *xmlStr,
* success, -1 on error.
*/
static int
virDomainCheckpointDefAssignBitmapNames(virDomainCheckpointDefPtr def)
virDomainCheckpointDefAssignBitmapNames(virDomainCheckpointDef *def)
{
size_t i;
for (i = 0; i < def->ndisks; i++) {
virDomainCheckpointDiskDefPtr disk = &def->disks[i];
virDomainCheckpointDiskDef *disk = &def->disks[i];
if (disk->type != VIR_DOMAIN_CHECKPOINT_TYPE_BITMAP ||
disk->bitmap)
@ -270,11 +270,11 @@ virDomainCheckpointDefAssignBitmapNames(virDomainCheckpointDefPtr def)
* if any def->disks[n]->name appears more than once or does not map
* to dom->disks. */
int
virDomainCheckpointAlignDisks(virDomainCheckpointDefPtr chkdef)
virDomainCheckpointAlignDisks(virDomainCheckpointDef *chkdef)
{
virDomainDefPtr domdef = chkdef->parent.dom;
virDomainDef *domdef = chkdef->parent.dom;
g_autoptr(GHashTable) map = virHashNew(NULL);
g_autofree virDomainCheckpointDiskDefPtr olddisks = NULL;
g_autofree virDomainCheckpointDiskDef *olddisks = NULL;
size_t i;
int checkpoint_default = VIR_DOMAIN_CHECKPOINT_TYPE_NONE;
@ -304,8 +304,8 @@ virDomainCheckpointAlignDisks(virDomainCheckpointDefPtr chkdef)
/* Double check requested disks. */
for (i = 0; i < chkdef->ndisks; i++) {
virDomainCheckpointDiskDefPtr chkdisk = &chkdef->disks[i];
virDomainDiskDefPtr domdisk = virDomainDiskByName(domdef, chkdisk->name, false);
virDomainCheckpointDiskDef *chkdisk = &chkdef->disks[i];
virDomainDiskDef *domdisk = virDomainDiskByName(domdef, chkdisk->name, false);
if (!domdisk) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
@ -343,9 +343,9 @@ virDomainCheckpointAlignDisks(virDomainCheckpointDefPtr chkdef)
chkdef->ndisks = domdef->ndisks;
for (i = 0; i < domdef->ndisks; i++) {
virDomainDiskDefPtr domdisk = domdef->disks[i];
virDomainCheckpointDiskDefPtr chkdisk = chkdef->disks + i;
virDomainCheckpointDiskDefPtr existing;
virDomainDiskDef *domdisk = domdef->disks[i];
virDomainCheckpointDiskDef *chkdisk = chkdef->disks + i;
virDomainCheckpointDiskDef *existing;
/* copy existing disks */
if ((existing = virHashLookup(map, domdisk->dst))) {
@ -391,8 +391,8 @@ unsigned int virDomainCheckpointFormatConvertXMLFlags(unsigned int flags)
static int
virDomainCheckpointDiskDefFormat(virBufferPtr buf,
virDomainCheckpointDiskDefPtr disk,
virDomainCheckpointDiskDefFormat(virBuffer *buf,
virDomainCheckpointDiskDef *disk,
unsigned int flags)
{
if (!disk->name)
@ -413,9 +413,9 @@ virDomainCheckpointDiskDefFormat(virBufferPtr buf,
static int
virDomainCheckpointDefFormatInternal(virBufferPtr buf,
virDomainCheckpointDefPtr def,
virDomainXMLOptionPtr xmlopt,
virDomainCheckpointDefFormatInternal(virBuffer *buf,
virDomainCheckpointDef *def,
virDomainXMLOption *xmlopt,
unsigned int flags)
{
size_t i;
@ -469,8 +469,8 @@ virDomainCheckpointDefFormatInternal(virBufferPtr buf,
char *
virDomainCheckpointDefFormat(virDomainCheckpointDefPtr def,
virDomainXMLOptionPtr xmlopt,
virDomainCheckpointDefFormat(virDomainCheckpointDef *def,
virDomainXMLOption *xmlopt,
unsigned int flags)
{
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
@ -487,11 +487,11 @@ virDomainCheckpointDefFormat(virDomainCheckpointDefPtr def,
int
virDomainCheckpointRedefinePrep(virDomainObjPtr vm,
virDomainCheckpointDefPtr def,
virDomainCheckpointRedefinePrep(virDomainObj *vm,
virDomainCheckpointDef *def,
bool *update_current)
{
virDomainMomentObjPtr parent = NULL;
virDomainMomentObj *parent = NULL;
if (virDomainCheckpointCheckCycles(vm->checkpoints, def, vm->def->name) < 0)
return -1;
@ -528,14 +528,14 @@ virDomainCheckpointRedefinePrep(virDomainObjPtr vm,
}
virDomainMomentObjPtr
virDomainCheckpointRedefineCommit(virDomainObjPtr vm,
virDomainCheckpointDefPtr *defptr)
virDomainMomentObj *
virDomainCheckpointRedefineCommit(virDomainObj *vm,
virDomainCheckpointDef **defptr)
{
virDomainCheckpointDefPtr def = *defptr;
virDomainMomentObjPtr other = NULL;
virDomainCheckpointDefPtr otherdef = NULL;
virDomainMomentObjPtr chk = NULL;
virDomainCheckpointDef *def = *defptr;
virDomainMomentObj *other = NULL;
virDomainCheckpointDef *otherdef = NULL;
virDomainMomentObj *chk = NULL;
other = virDomainCheckpointFindByName(vm->checkpoints, def->parent.name);
if (other) {

View File

@ -39,7 +39,6 @@ typedef enum {
/* Stores disk-checkpoint information */
typedef struct _virDomainCheckpointDiskDef virDomainCheckpointDiskDef;
typedef virDomainCheckpointDiskDef *virDomainCheckpointDiskDefPtr;
struct _virDomainCheckpointDiskDef {
char *name; /* name matching the <target dev='...' of the domain */
int type; /* virDomainCheckpointType */
@ -72,30 +71,30 @@ typedef enum {
unsigned int
virDomainCheckpointFormatConvertXMLFlags(unsigned int flags);
virDomainCheckpointDefPtr
virDomainCheckpointDef *
virDomainCheckpointDefParseString(const char *xmlStr,
virDomainXMLOptionPtr xmlopt,
virDomainXMLOption *xmlopt,
void *parseOpaque,
unsigned int flags);
virDomainCheckpointDefPtr
virDomainCheckpointDef *
virDomainCheckpointDefNew(void);
char *
virDomainCheckpointDefFormat(virDomainCheckpointDefPtr def,
virDomainXMLOptionPtr xmlopt,
virDomainCheckpointDefFormat(virDomainCheckpointDef *def,
virDomainXMLOption *xmlopt,
unsigned int flags);
int
virDomainCheckpointAlignDisks(virDomainCheckpointDefPtr checkpoint);
virDomainCheckpointAlignDisks(virDomainCheckpointDef *checkpoint);
int
virDomainCheckpointRedefinePrep(virDomainObjPtr vm,
virDomainCheckpointDefPtr def,
virDomainCheckpointRedefinePrep(virDomainObj *vm,
virDomainCheckpointDef *def,
bool *update_current);
virDomainMomentObjPtr
virDomainCheckpointRedefineCommit(virDomainObjPtr vm,
virDomainCheckpointDefPtr *defptr);
virDomainMomentObj *
virDomainCheckpointRedefineCommit(virDomainObj *vm,
virDomainCheckpointDef **defptr);
VIR_ENUM_DECL(virDomainCheckpoint);

View File

@ -85,15 +85,15 @@ VIR_ENUM_IMPL(virCPUCacheMode,
);
virCPUDefPtr virCPUDefNew(void)
virCPUDef *virCPUDefNew(void)
{
virCPUDefPtr cpu = g_new0(virCPUDef, 1);
virCPUDef *cpu = g_new0(virCPUDef, 1);
cpu->refs = 1;
return cpu;
}
void
virCPUDefFreeFeatures(virCPUDefPtr def)
virCPUDefFreeFeatures(virCPUDef *def)
{
size_t i;
@ -106,7 +106,7 @@ virCPUDefFreeFeatures(virCPUDefPtr def)
void ATTRIBUTE_NONNULL(1)
virCPUDefFreeModel(virCPUDefPtr def)
virCPUDefFreeModel(virCPUDef *def)
{
VIR_FREE(def->model);
VIR_FREE(def->vendor);
@ -115,13 +115,13 @@ virCPUDefFreeModel(virCPUDefPtr def)
}
void
virCPUDefRef(virCPUDefPtr def)
virCPUDefRef(virCPUDef *def)
{
g_atomic_int_inc(&def->refs);
}
void
virCPUDefFree(virCPUDefPtr def)
virCPUDefFree(virCPUDef *def)
{
if (!def)
return;
@ -136,7 +136,7 @@ virCPUDefFree(virCPUDefPtr def)
int ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2)
virCPUDefCopyModel(virCPUDefPtr dst,
virCPUDefCopyModel(virCPUDef *dst,
const virCPUDef *src,
bool resetPolicy)
{
@ -145,7 +145,7 @@ virCPUDefCopyModel(virCPUDefPtr dst,
int
virCPUDefCopyModelFilter(virCPUDefPtr dst,
virCPUDefCopyModelFilter(virCPUDef *dst,
const virCPUDef *src,
bool resetPolicy,
virCPUDefFeatureFilter filter,
@ -193,8 +193,8 @@ virCPUDefCopyModelFilter(virCPUDefPtr dst,
* than overwriting it with the values from @src.
*/
void
virCPUDefStealModel(virCPUDefPtr dst,
virCPUDefPtr src,
virCPUDefStealModel(virCPUDef *dst,
virCPUDef *src,
bool keepVendor)
{
char *vendor = NULL;
@ -225,7 +225,7 @@ virCPUDefStealModel(virCPUDefPtr dst,
}
virCPUDefPtr
virCPUDef *
virCPUDefCopyWithoutModel(const virCPUDef *cpu)
{
g_autoptr(virCPUDef) copy = NULL;
@ -260,7 +260,7 @@ virCPUDefCopyWithoutModel(const virCPUDef *cpu)
}
virCPUDefPtr
virCPUDef *
virCPUDefCopy(const virCPUDef *cpu)
{
g_autoptr(virCPUDef) copy = NULL;
@ -278,7 +278,7 @@ virCPUDefCopy(const virCPUDef *cpu)
int
virCPUDefParseXMLString(const char *xml,
virCPUType type,
virCPUDefPtr *cpu,
virCPUDef **cpu,
bool validateXML)
{
xmlDocPtr doc = NULL;
@ -321,7 +321,7 @@ int
virCPUDefParseXML(xmlXPathContextPtr ctxt,
const char *xpath,
virCPUType type,
virCPUDefPtr *cpu,
virCPUDef **cpu,
bool validateXML)
{
g_autoptr(virCPUDef) def = NULL;
@ -334,7 +334,7 @@ virCPUDefParseXML(xmlXPathContextPtr ctxt,
g_autofree char *vendor_id = NULL;
g_autofree char *tscScaling = NULL;
g_autofree char *migratable = NULL;
g_autofree virHostCPUTscInfoPtr tsc = NULL;
g_autofree virHostCPUTscInfo *tsc = NULL;
*cpu = NULL;
@ -676,8 +676,8 @@ virCPUDefParseXML(xmlXPathContextPtr ctxt,
char *
virCPUDefFormat(virCPUDefPtr def,
virDomainNumaPtr numa)
virCPUDefFormat(virCPUDef *def,
virDomainNuma *numa)
{
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
@ -689,9 +689,9 @@ virCPUDefFormat(virCPUDefPtr def,
int
virCPUDefFormatBufFull(virBufferPtr buf,
virCPUDefPtr def,
virDomainNumaPtr numa)
virCPUDefFormatBufFull(virBuffer *buf,
virCPUDef *def,
virDomainNuma *numa)
{
g_auto(virBuffer) attributeBuf = VIR_BUFFER_INITIALIZER;
g_auto(virBuffer) childrenBuf = VIR_BUFFER_INIT_CHILD(buf);
@ -751,8 +751,8 @@ virCPUDefFormatBufFull(virBufferPtr buf,
}
int
virCPUDefFormatBuf(virBufferPtr buf,
virCPUDefPtr def)
virCPUDefFormatBuf(virBuffer *buf,
virCPUDef *def)
{
size_t i;
bool formatModel;
@ -830,7 +830,7 @@ virCPUDefFormatBuf(virBufferPtr buf,
}
for (i = 0; i < def->nfeatures; i++) {
virCPUFeatureDefPtr feature = def->features + i;
virCPUFeatureDef *feature = def->features + i;
if (!feature->name) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
@ -867,12 +867,12 @@ typedef enum {
} virCPUDefAddFeatureMode;
static int
virCPUDefAddFeatureInternal(virCPUDefPtr def,
virCPUDefAddFeatureInternal(virCPUDef *def,
const char *name,
int policy,
virCPUDefAddFeatureMode mode)
{
virCPUFeatureDefPtr feat;
virCPUFeatureDef *feat;
if (def->type == VIR_CPU_TYPE_HOST)
policy = -1;
@ -904,7 +904,7 @@ virCPUDefAddFeatureInternal(virCPUDefPtr def,
}
int
virCPUDefUpdateFeature(virCPUDefPtr def,
virCPUDefUpdateFeature(virCPUDef *def,
const char *name,
int policy)
{
@ -913,7 +913,7 @@ virCPUDefUpdateFeature(virCPUDefPtr def,
}
int
virCPUDefAddFeature(virCPUDefPtr def,
virCPUDefAddFeature(virCPUDef *def,
const char *name,
int policy)
{
@ -923,7 +923,7 @@ virCPUDefAddFeature(virCPUDefPtr def,
int
virCPUDefAddFeatureIfMissing(virCPUDefPtr def,
virCPUDefAddFeatureIfMissing(virCPUDef *def,
const char *name,
int policy)
{
@ -932,7 +932,7 @@ virCPUDefAddFeatureIfMissing(virCPUDefPtr def,
}
virCPUFeatureDefPtr
virCPUFeatureDef *
virCPUDefFindFeature(const virCPUDef *def,
const char *name)
{
@ -948,7 +948,7 @@ virCPUDefFindFeature(const virCPUDef *def,
int
virCPUDefFilterFeatures(virCPUDefPtr cpu,
virCPUDefFilterFeatures(virCPUDef *cpu,
virCPUDefFeatureFilter filter,
void *opaque)
{
@ -978,7 +978,7 @@ virCPUDefFilterFeatures(virCPUDefPtr cpu,
* Returns the number of features matching @filter or -1 on error.
*/
int
virCPUDefCheckFeatures(virCPUDefPtr cpu,
virCPUDefCheckFeatures(virCPUDef *cpu,
virCPUDefFeatureFilter filter,
void *opaque,
char ***features)
@ -1003,8 +1003,8 @@ virCPUDefCheckFeatures(virCPUDefPtr cpu,
bool
virCPUDefIsEqual(virCPUDefPtr src,
virCPUDefPtr dst,
virCPUDefIsEqual(virCPUDef *src,
virCPUDef *dst,
bool reportError)
{
size_t i;
@ -1130,14 +1130,14 @@ virCPUDefIsEqual(virCPUDefPtr src,
/*
* Parses a list of CPU XMLs into a NULL-terminated list of CPU defs.
*/
virCPUDefPtr *
virCPUDef **
virCPUDefListParse(const char **xmlCPUs,
unsigned int ncpus,
virCPUType cpuType)
{
xmlDocPtr doc = NULL;
xmlXPathContextPtr ctxt = NULL;
virCPUDefPtr *cpus = NULL;
virCPUDef **cpus = NULL;
size_t i;
VIR_DEBUG("xmlCPUs=%p, ncpus=%u", xmlCPUs, ncpus);
@ -1158,7 +1158,7 @@ virCPUDefListParse(const char **xmlCPUs,
goto error;
}
cpus = g_new0(virCPUDefPtr, ncpus + 1);
cpus = g_new0(virCPUDef *, ncpus + 1);
for (i = 0; i < ncpus; i++) {
if (!(doc = virXMLParseStringCtxt(xmlCPUs[i], _("(CPU_definition)"), &ctxt)))
@ -1187,9 +1187,9 @@ virCPUDefListParse(const char **xmlCPUs,
* Frees NULL-terminated list of CPUs created by virCPUDefListParse.
*/
void
virCPUDefListFree(virCPUDefPtr *cpus)
virCPUDefListFree(virCPUDef **cpus)
{
virCPUDefPtr *cpu;
virCPUDef **cpu;
if (!cpus)
return;

View File

@ -94,7 +94,6 @@ typedef enum {
VIR_ENUM_DECL(virCPUFeaturePolicy);
typedef struct _virCPUFeatureDef virCPUFeatureDef;
typedef virCPUFeatureDef *virCPUFeatureDefPtr;
struct _virCPUFeatureDef {
char *name;
int policy; /* enum virCPUFeaturePolicy */
@ -112,7 +111,6 @@ typedef enum {
VIR_ENUM_DECL(virCPUCacheMode);
typedef struct _virCPUCacheDef virCPUCacheDef;
typedef virCPUCacheDef *virCPUCacheDefPtr;
struct _virCPUCacheDef {
int level; /* -1 for unspecified */
virCPUCacheMode mode;
@ -120,7 +118,6 @@ struct _virCPUCacheDef {
typedef struct _virCPUDef virCPUDef;
typedef virCPUDef *virCPUDefPtr;
struct _virCPUDef {
int refs;
int type; /* enum virCPUType */
@ -139,28 +136,28 @@ struct _virCPUDef {
unsigned int threads;
size_t nfeatures;
size_t nfeatures_max;
virCPUFeatureDefPtr features;
virCPUCacheDefPtr cache;
virHostCPUTscInfoPtr tsc;
virCPUFeatureDef *features;
virCPUCacheDef *cache;
virHostCPUTscInfo *tsc;
virTristateSwitch migratable; /* for host-passthrough mode */
};
virCPUDefPtr virCPUDefNew(void);
virCPUDef *virCPUDefNew(void);
void ATTRIBUTE_NONNULL(1)
virCPUDefFreeFeatures(virCPUDefPtr def);
virCPUDefFreeFeatures(virCPUDef *def);
void ATTRIBUTE_NONNULL(1)
virCPUDefFreeModel(virCPUDefPtr def);
virCPUDefFreeModel(virCPUDef *def);
void
virCPUDefRef(virCPUDefPtr def);
virCPUDefRef(virCPUDef *def);
void
virCPUDefFree(virCPUDefPtr def);
virCPUDefFree(virCPUDef *def);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(virCPUDef, virCPUDefFree);
int ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2)
virCPUDefCopyModel(virCPUDefPtr dst,
virCPUDefCopyModel(virCPUDef *dst,
const virCPUDef *src,
bool resetPolicy);
@ -172,7 +169,7 @@ typedef bool (*virCPUDefFeatureFilter)(const char *name,
void *opaque);
int
virCPUDefCopyModelFilter(virCPUDefPtr dst,
virCPUDefCopyModelFilter(virCPUDef *dst,
const virCPUDef *src,
bool resetPolicy,
virCPUDefFeatureFilter filter,
@ -180,79 +177,79 @@ virCPUDefCopyModelFilter(virCPUDefPtr dst,
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
void
virCPUDefStealModel(virCPUDefPtr dst,
virCPUDefPtr src,
virCPUDefStealModel(virCPUDef *dst,
virCPUDef *src,
bool keepVendor);
virCPUDefPtr
virCPUDef *
virCPUDefCopy(const virCPUDef *cpu);
virCPUDefPtr
virCPUDef *
virCPUDefCopyWithoutModel(const virCPUDef *cpu);
int
virCPUDefParseXMLString(const char *xml,
virCPUType type,
virCPUDefPtr *cpu,
virCPUDef **cpu,
bool validateXML);
int
virCPUDefParseXML(xmlXPathContextPtr ctxt,
const char *xpath,
virCPUType mode,
virCPUDefPtr *cpu,
virCPUDef **cpu,
bool validateXML);
bool
virCPUDefIsEqual(virCPUDefPtr src,
virCPUDefPtr dst,
virCPUDefIsEqual(virCPUDef *src,
virCPUDef *dst,
bool reportError);
char *
virCPUDefFormat(virCPUDefPtr def,
virDomainNumaPtr numa);
virCPUDefFormat(virCPUDef *def,
virDomainNuma *numa);
int
virCPUDefFormatBuf(virBufferPtr buf,
virCPUDefPtr def);
virCPUDefFormatBuf(virBuffer *buf,
virCPUDef *def);
int
virCPUDefFormatBufFull(virBufferPtr buf,
virCPUDefPtr def,
virDomainNumaPtr numa);
virCPUDefFormatBufFull(virBuffer *buf,
virCPUDef *def,
virDomainNuma *numa);
int
virCPUDefAddFeature(virCPUDefPtr cpu,
virCPUDefAddFeature(virCPUDef *cpu,
const char *name,
int policy);
int
virCPUDefUpdateFeature(virCPUDefPtr cpu,
virCPUDefUpdateFeature(virCPUDef *cpu,
const char *name,
int policy);
int
virCPUDefAddFeatureIfMissing(virCPUDefPtr def,
virCPUDefAddFeatureIfMissing(virCPUDef *def,
const char *name,
int policy);
virCPUFeatureDefPtr
virCPUFeatureDef *
virCPUDefFindFeature(const virCPUDef *def,
const char *name);
int
virCPUDefFilterFeatures(virCPUDefPtr cpu,
virCPUDefFilterFeatures(virCPUDef *cpu,
virCPUDefFeatureFilter filter,
void *opaque);
int
virCPUDefCheckFeatures(virCPUDefPtr cpu,
virCPUDefCheckFeatures(virCPUDef *cpu,
virCPUDefFeatureFilter filter,
void *opaque,
char ***features);
virCPUDefPtr *
virCPUDef **
virCPUDefListParse(const char **xmlCPUs,
unsigned int ncpus,
virCPUType cpuType);
void
virCPUDefListFree(virCPUDefPtr *cpus);
virCPUDefListFree(virCPUDef **cpus);

View File

@ -50,7 +50,7 @@ VIR_ENUM_IMPL(virDomainDeviceAddress,
static int
virZPCIDeviceAddressParseXML(xmlNodePtr node,
virPCIDeviceAddressPtr addr)
virPCIDeviceAddress *addr)
{
virZPCIDeviceAddress def = { .uid = { 0 }, .fid = { 0 } };
g_autofree char *uid = NULL;
@ -83,7 +83,7 @@ virZPCIDeviceAddressParseXML(xmlNodePtr node,
}
void
virDomainDeviceInfoClear(virDomainDeviceInfoPtr info)
virDomainDeviceInfoClear(virDomainDeviceInfo *info)
{
VIR_FREE(info->alias);
memset(&info->addr, 0, sizeof(info->addr));
@ -95,7 +95,7 @@ virDomainDeviceInfoClear(virDomainDeviceInfoPtr info)
}
void
virDomainDeviceInfoFree(virDomainDeviceInfoPtr info)
virDomainDeviceInfoFree(virDomainDeviceInfo *info)
{
if (info) {
virDomainDeviceInfoClear(info);
@ -206,7 +206,7 @@ virDeviceInfoPCIAddressExtensionIsPresent(const virDomainDeviceInfo *info)
int
virPCIDeviceAddressParseXML(xmlNodePtr node,
virPCIDeviceAddressPtr addr)
virPCIDeviceAddress *addr)
{
xmlNodePtr cur;
xmlNodePtr zpci = NULL;
@ -273,7 +273,7 @@ virPCIDeviceAddressParseXML(xmlNodePtr node,
}
void
virPCIDeviceAddressFormat(virBufferPtr buf,
virPCIDeviceAddressFormat(virBuffer *buf,
virPCIDeviceAddress addr,
bool includeTypeInAddr)
{
@ -287,7 +287,7 @@ virPCIDeviceAddressFormat(virBufferPtr buf,
}
bool
virDomainDeviceCCWAddressIsValid(virDomainDeviceCCWAddressPtr addr)
virDomainDeviceCCWAddressIsValid(virDomainDeviceCCWAddress *addr)
{
return addr->cssid <= VIR_DOMAIN_DEVICE_CCW_MAX_CSSID &&
addr->ssid <= VIR_DOMAIN_DEVICE_CCW_MAX_SSID &&
@ -296,7 +296,7 @@ virDomainDeviceCCWAddressIsValid(virDomainDeviceCCWAddressPtr addr)
int
virDomainDeviceCCWAddressParseXML(xmlNodePtr node,
virDomainDeviceCCWAddressPtr addr)
virDomainDeviceCCWAddress *addr)
{
g_autofree char *cssid = virXMLPropString(node, "cssid");
g_autofree char *ssid = virXMLPropString(node, "ssid");
@ -342,8 +342,8 @@ virDomainDeviceCCWAddressParseXML(xmlNodePtr node,
}
bool
virDomainDeviceCCWAddressEqual(virDomainDeviceCCWAddressPtr addr1,
virDomainDeviceCCWAddressPtr addr2)
virDomainDeviceCCWAddressEqual(virDomainDeviceCCWAddress *addr1,
virDomainDeviceCCWAddress *addr2)
{
if (addr1->cssid == addr2->cssid &&
addr1->ssid == addr2->ssid &&
@ -355,7 +355,7 @@ virDomainDeviceCCWAddressEqual(virDomainDeviceCCWAddressPtr addr1,
int
virDomainDeviceDriveAddressParseXML(xmlNodePtr node,
virDomainDeviceDriveAddressPtr addr)
virDomainDeviceDriveAddress *addr)
{
g_autofree char *controller = virXMLPropString(node, "controller");
g_autofree char *bus = virXMLPropString(node, "bus");
@ -397,7 +397,7 @@ virDomainDeviceDriveAddressParseXML(xmlNodePtr node,
int
virDomainDeviceVirtioSerialAddressParseXML(xmlNodePtr node,
virDomainDeviceVirtioSerialAddressPtr addr)
virDomainDeviceVirtioSerialAddress *addr)
{
g_autofree char *controller = virXMLPropString(node, "controller");
g_autofree char *bus = virXMLPropString(node, "bus");
@ -431,7 +431,7 @@ virDomainDeviceVirtioSerialAddressParseXML(xmlNodePtr node,
int
virDomainDeviceCcidAddressParseXML(xmlNodePtr node,
virDomainDeviceCcidAddressPtr addr)
virDomainDeviceCcidAddress *addr)
{
g_autofree char *controller = virXMLPropString(node, "controller");
g_autofree char *slot = virXMLPropString(node, "slot");
@ -456,7 +456,7 @@ virDomainDeviceCcidAddressParseXML(xmlNodePtr node,
}
static int
virDomainDeviceUSBAddressParsePort(virDomainDeviceUSBAddressPtr addr,
virDomainDeviceUSBAddressParsePort(virDomainDeviceUSBAddress *addr,
char *port)
{
char *tmp = port;
@ -480,7 +480,7 @@ virDomainDeviceUSBAddressParsePort(virDomainDeviceUSBAddressPtr addr,
int
virDomainDeviceUSBAddressParseXML(xmlNodePtr node,
virDomainDeviceUSBAddressPtr addr)
virDomainDeviceUSBAddress *addr)
{
g_autofree char *port = virXMLPropString(node, "port");
g_autofree char *bus = virXMLPropString(node, "bus");
@ -501,7 +501,7 @@ virDomainDeviceUSBAddressParseXML(xmlNodePtr node,
int
virDomainDeviceSpaprVioAddressParseXML(xmlNodePtr node,
virDomainDeviceSpaprVioAddressPtr addr)
virDomainDeviceSpaprVioAddress *addr)
{
g_autofree char *reg = virXMLPropString(node, "reg");
@ -520,7 +520,7 @@ virDomainDeviceSpaprVioAddressParseXML(xmlNodePtr node,
}
bool
virDomainDeviceAddressIsValid(virDomainDeviceInfoPtr info,
virDomainDeviceAddressIsValid(virDomainDeviceInfo *info,
int type)
{
if (info->type != type)
@ -549,7 +549,7 @@ virDomainDeviceAddressIsValid(virDomainDeviceInfoPtr info,
int
virInterfaceLinkParseXML(xmlNodePtr node,
virNetDevIfLinkPtr lnk)
virNetDevIfLink *lnk)
{
int state;
@ -577,7 +577,7 @@ virInterfaceLinkParseXML(xmlNodePtr node,
}
int
virInterfaceLinkFormat(virBufferPtr buf,
virInterfaceLinkFormat(virBuffer *buf,
const virNetDevIfLink *lnk)
{
if (!lnk->speed && !lnk->state) {

View File

@ -52,7 +52,6 @@ typedef enum {
VIR_ENUM_DECL(virDomainDeviceAddress);
typedef struct _virDomainDeviceDriveAddress virDomainDeviceDriveAddress;
typedef virDomainDeviceDriveAddress *virDomainDeviceDriveAddressPtr;
struct _virDomainDeviceDriveAddress {
unsigned int controller;
unsigned int bus;
@ -61,7 +60,6 @@ struct _virDomainDeviceDriveAddress {
};
typedef struct _virDomainDeviceVirtioSerialAddress virDomainDeviceVirtioSerialAddress;
typedef virDomainDeviceVirtioSerialAddress *virDomainDeviceVirtioSerialAddressPtr;
struct _virDomainDeviceVirtioSerialAddress {
unsigned int controller;
unsigned int bus;
@ -73,7 +71,6 @@ struct _virDomainDeviceVirtioSerialAddress {
#define VIR_DOMAIN_DEVICE_CCW_MAX_DEVNO 65535
typedef struct _virDomainDeviceCCWAddress virDomainDeviceCCWAddress;
typedef virDomainDeviceCCWAddress *virDomainDeviceCCWAddressPtr;
struct _virDomainDeviceCCWAddress {
unsigned int cssid;
unsigned int ssid;
@ -82,7 +79,6 @@ struct _virDomainDeviceCCWAddress {
};
typedef struct _virDomainDeviceCcidAddress virDomainDeviceCcidAddress;
typedef virDomainDeviceCcidAddress *virDomainDeviceCcidAddressPtr;
struct _virDomainDeviceCcidAddress {
unsigned int controller;
unsigned int slot;
@ -91,14 +87,12 @@ struct _virDomainDeviceCcidAddress {
#define VIR_DOMAIN_DEVICE_USB_MAX_PORT_DEPTH 4
typedef struct _virDomainDeviceUSBAddress virDomainDeviceUSBAddress;
typedef virDomainDeviceUSBAddress *virDomainDeviceUSBAddressPtr;
struct _virDomainDeviceUSBAddress {
unsigned int bus;
unsigned int port[VIR_DOMAIN_DEVICE_USB_MAX_PORT_DEPTH];
};
typedef struct _virDomainDeviceSpaprVioAddress virDomainDeviceSpaprVioAddress;
typedef virDomainDeviceSpaprVioAddress *virDomainDeviceSpaprVioAddressPtr;
struct _virDomainDeviceSpaprVioAddress {
unsigned long long reg;
bool has_reg;
@ -112,27 +106,23 @@ typedef enum {
} virDomainControllerMaster;
typedef struct _virDomainDeviceUSBMaster virDomainDeviceUSBMaster;
typedef virDomainDeviceUSBMaster *virDomainDeviceUSBMasterPtr;
struct _virDomainDeviceUSBMaster {
unsigned int startport;
};
typedef struct _virDomainDeviceISAAddress virDomainDeviceISAAddress;
typedef virDomainDeviceISAAddress *virDomainDeviceISAAddressPtr;
struct _virDomainDeviceISAAddress {
unsigned int iobase;
unsigned int irq;
};
typedef struct _virDomainDeviceDimmAddress virDomainDeviceDimmAddress;
typedef virDomainDeviceDimmAddress *virDomainDeviceDimmAddressPtr;
struct _virDomainDeviceDimmAddress {
unsigned int slot;
unsigned long long base;
};
typedef struct _virDomainDeviceInfo virDomainDeviceInfo;
typedef virDomainDeviceInfo *virDomainDeviceInfoPtr;
struct _virDomainDeviceInfo {
char *alias;
int type; /* virDomainDeviceAddressType */
@ -184,14 +174,14 @@ struct _virDomainDeviceInfo {
bool isolationGroupLocked;
};
void virDomainDeviceInfoClear(virDomainDeviceInfoPtr info);
void virDomainDeviceInfoFree(virDomainDeviceInfoPtr info);
void virDomainDeviceInfoClear(virDomainDeviceInfo *info);
void virDomainDeviceInfoFree(virDomainDeviceInfo *info);
bool virDomainDeviceInfoAddressIsEqual(const virDomainDeviceInfo *a,
const virDomainDeviceInfo *b)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) G_GNUC_WARN_UNUSED_RESULT;
bool virDomainDeviceAddressIsValid(virDomainDeviceInfoPtr info,
bool virDomainDeviceAddressIsValid(virDomainDeviceInfo *info,
int type);
bool virDeviceInfoPCIAddressIsWanted(const virDomainDeviceInfo *info);
@ -201,36 +191,36 @@ bool virDeviceInfoPCIAddressExtensionIsWanted(const virDomainDeviceInfo *info);
bool virDeviceInfoPCIAddressExtensionIsPresent(const virDomainDeviceInfo *info);
int virPCIDeviceAddressParseXML(xmlNodePtr node,
virPCIDeviceAddressPtr addr);
virPCIDeviceAddress *addr);
void virPCIDeviceAddressFormat(virBufferPtr buf,
void virPCIDeviceAddressFormat(virBuffer *buf,
virPCIDeviceAddress addr,
bool includeTypeInAddr);
bool virDomainDeviceCCWAddressIsValid(virDomainDeviceCCWAddressPtr addr);
bool virDomainDeviceCCWAddressIsValid(virDomainDeviceCCWAddress *addr);
int virDomainDeviceCCWAddressParseXML(xmlNodePtr node,
virDomainDeviceCCWAddressPtr addr);
bool virDomainDeviceCCWAddressEqual(virDomainDeviceCCWAddressPtr addr1,
virDomainDeviceCCWAddressPtr addr2);
virDomainDeviceCCWAddress *addr);
bool virDomainDeviceCCWAddressEqual(virDomainDeviceCCWAddress *addr1,
virDomainDeviceCCWAddress *addr2);
#define VIR_CCW_DEVICE_ADDRESS_FMT "%x.%x.%04x"
int virDomainDeviceDriveAddressParseXML(xmlNodePtr node,
virDomainDeviceDriveAddressPtr addr);
virDomainDeviceDriveAddress *addr);
int virDomainDeviceVirtioSerialAddressParseXML(xmlNodePtr node,
virDomainDeviceVirtioSerialAddressPtr addr);
virDomainDeviceVirtioSerialAddress *addr);
int virDomainDeviceCcidAddressParseXML(xmlNodePtr node,
virDomainDeviceCcidAddressPtr addr);
virDomainDeviceCcidAddress *addr);
int virDomainDeviceUSBAddressParseXML(xmlNodePtr node,
virDomainDeviceUSBAddressPtr addr);
virDomainDeviceUSBAddress *addr);
int virDomainDeviceSpaprVioAddressParseXML(xmlNodePtr node,
virDomainDeviceSpaprVioAddressPtr addr);
virDomainDeviceSpaprVioAddress *addr);
int virInterfaceLinkParseXML(xmlNodePtr node,
virNetDevIfLinkPtr lnk);
virNetDevIfLink *lnk);
int virInterfaceLinkFormat(virBufferPtr buf,
int virInterfaceLinkFormat(virBuffer *buf,
const virNetDevIfLink *lnk);

View File

@ -62,7 +62,7 @@ virDomainZPCIAddressReserveId(GHashTable *set,
static int
virDomainZPCIAddressReserveUid(GHashTable *set,
virZPCIDeviceAddressPtr addr)
virZPCIDeviceAddress *addr)
{
return virDomainZPCIAddressReserveId(set, &addr->uid, "uid");
}
@ -70,7 +70,7 @@ virDomainZPCIAddressReserveUid(GHashTable *set,
static int
virDomainZPCIAddressReserveFid(GHashTable *set,
virZPCIDeviceAddressPtr addr)
virZPCIDeviceAddress *addr)
{
return virDomainZPCIAddressReserveId(set, &addr->fid, "fid");
}
@ -105,7 +105,7 @@ virDomainZPCIAddressAssignId(GHashTable *set,
static int
virDomainZPCIAddressAssignUid(GHashTable *set,
virZPCIDeviceAddressPtr addr)
virZPCIDeviceAddress *addr)
{
return virDomainZPCIAddressAssignId(set, &addr->uid, 1,
VIR_DOMAIN_DEVICE_ZPCI_MAX_UID, "uid");
@ -114,7 +114,7 @@ virDomainZPCIAddressAssignUid(GHashTable *set,
static int
virDomainZPCIAddressAssignFid(GHashTable *set,
virZPCIDeviceAddressPtr addr)
virZPCIDeviceAddress *addr)
{
return virDomainZPCIAddressAssignId(set, &addr->fid, 0,
VIR_DOMAIN_DEVICE_ZPCI_MAX_FID, "fid");
@ -136,8 +136,8 @@ virDomainZPCIAddressReleaseId(GHashTable *set,
static void
virDomainZPCIAddressReleaseIds(virDomainZPCIAddressIdsPtr zpciIds,
virZPCIDeviceAddressPtr addr)
virDomainZPCIAddressReleaseIds(virDomainZPCIAddressIds *zpciIds,
virZPCIDeviceAddress *addr)
{
if (!zpciIds)
return;
@ -148,8 +148,8 @@ virDomainZPCIAddressReleaseIds(virDomainZPCIAddressIdsPtr zpciIds,
static int
virDomainZPCIAddressEnsureAddr(virDomainZPCIAddressIdsPtr zpciIds,
virZPCIDeviceAddressPtr addr)
virDomainZPCIAddressEnsureAddr(virDomainZPCIAddressIds *zpciIds,
virZPCIDeviceAddress *addr)
{
if (virDomainZPCIAddressAssignUid(zpciIds->uids, addr) < 0)
return -1;
@ -170,8 +170,8 @@ virDomainZPCIAddressEnsureAddr(virDomainZPCIAddressIdsPtr zpciIds,
int
virDomainPCIAddressExtensionReserveAddr(virDomainPCIAddressSetPtr addrs,
virPCIDeviceAddressPtr addr)
virDomainPCIAddressExtensionReserveAddr(virDomainPCIAddressSet *addrs,
virPCIDeviceAddress *addr)
{
if (addr->extFlags & VIR_PCI_ADDRESS_EXTENSION_ZPCI) {
/* Reserve uid/fid to ZPCI device which has defined uid/fid
@ -185,8 +185,8 @@ virDomainPCIAddressExtensionReserveAddr(virDomainPCIAddressSetPtr addrs,
int
virDomainPCIAddressExtensionReserveNextAddr(virDomainPCIAddressSetPtr addrs,
virPCIDeviceAddressPtr addr)
virDomainPCIAddressExtensionReserveNextAddr(virDomainPCIAddressSet *addrs,
virPCIDeviceAddress *addr)
{
if (addr->extFlags & VIR_PCI_ADDRESS_EXTENSION_ZPCI) {
virZPCIDeviceAddress zpci = addr->zpci;
@ -203,11 +203,11 @@ virDomainPCIAddressExtensionReserveNextAddr(virDomainPCIAddressSetPtr addrs,
static int
virDomainPCIAddressExtensionEnsureAddr(virDomainPCIAddressSetPtr addrs,
virPCIDeviceAddressPtr addr)
virDomainPCIAddressExtensionEnsureAddr(virDomainPCIAddressSet *addrs,
virPCIDeviceAddress *addr)
{
if (addr->extFlags & VIR_PCI_ADDRESS_EXTENSION_ZPCI) {
virZPCIDeviceAddressPtr zpci = &addr->zpci;
virZPCIDeviceAddress *zpci = &addr->zpci;
if (virDomainZPCIAddressEnsureAddr(addrs->zpciIds, zpci) < 0)
return -1;
@ -293,7 +293,7 @@ virDomainPCIControllerConnectTypeToModel(virDomainPCIConnectFlags flags)
static bool
virDomainPCIAddressFlagsCompatible(virPCIDeviceAddressPtr addr,
virDomainPCIAddressFlagsCompatible(virPCIDeviceAddress *addr,
const char *addrStr,
virDomainPCIConnectFlags busFlags,
virDomainPCIConnectFlags devFlags,
@ -398,13 +398,13 @@ virDomainPCIAddressFlagsCompatible(virPCIDeviceAddressPtr addr,
* comparing the flags).
*/
bool
virDomainPCIAddressValidate(virDomainPCIAddressSetPtr addrs,
virPCIDeviceAddressPtr addr,
virDomainPCIAddressValidate(virDomainPCIAddressSet *addrs,
virPCIDeviceAddress *addr,
const char *addrStr,
virDomainPCIConnectFlags flags,
bool fromConfig)
{
virDomainPCIAddressBusPtr bus;
virDomainPCIAddressBus *bus;
virErrorNumber errType = (fromConfig
? VIR_ERR_XML_ERROR : VIR_ERR_INTERNAL_ERROR);
@ -460,7 +460,7 @@ virDomainPCIAddressValidate(virDomainPCIAddressSetPtr addrs,
int
virDomainPCIAddressBusSetModel(virDomainPCIAddressBusPtr bus,
virDomainPCIAddressBusSetModel(virDomainPCIAddressBus *bus,
virDomainControllerModelPCI model,
bool allowHotplug)
{
@ -574,7 +574,7 @@ virDomainPCIAddressBusSetModel(virDomainPCIAddressBusPtr bus,
bool
virDomainPCIAddressBusIsFullyReserved(virDomainPCIAddressBusPtr bus)
virDomainPCIAddressBusIsFullyReserved(virDomainPCIAddressBus *bus)
{
size_t i;
@ -588,7 +588,7 @@ virDomainPCIAddressBusIsFullyReserved(virDomainPCIAddressBusPtr bus)
static bool ATTRIBUTE_NONNULL(1)
virDomainPCIAddressBusIsEmpty(virDomainPCIAddressBusPtr bus)
virDomainPCIAddressBusIsEmpty(virDomainPCIAddressBus *bus)
{
size_t i;
@ -609,8 +609,8 @@ virDomainPCIAddressBusIsEmpty(virDomainPCIAddressBusPtr bus)
* >0 = number of buses added
*/
static int
virDomainPCIAddressSetGrow(virDomainPCIAddressSetPtr addrs,
virPCIDeviceAddressPtr addr,
virDomainPCIAddressSetGrow(virDomainPCIAddressSet *addrs,
virPCIDeviceAddress *addr,
virDomainPCIConnectFlags flags)
{
int add;
@ -777,8 +777,8 @@ virDomainPCIAddressSetGrow(virDomainPCIAddressSetPtr addrs,
* Check if the PCI slot is used by another device.
*/
bool
virDomainPCIAddressSlotInUse(virDomainPCIAddressSetPtr addrs,
virPCIDeviceAddressPtr addr)
virDomainPCIAddressSlotInUse(virDomainPCIAddressSet *addrs,
virPCIDeviceAddress *addr)
{
return !!addrs->buses[addr->bus].slot[addr->slot].functions;
}
@ -792,14 +792,14 @@ virDomainPCIAddressSlotInUse(virDomainPCIAddressSetPtr addrs,
* XML).
*/
static int ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2)
virDomainPCIAddressReserveAddrInternal(virDomainPCIAddressSetPtr addrs,
virPCIDeviceAddressPtr addr,
virDomainPCIAddressReserveAddrInternal(virDomainPCIAddressSet *addrs,
virPCIDeviceAddress *addr,
virDomainPCIConnectFlags flags,
unsigned int isolationGroup,
bool fromConfig)
{
g_autofree char *addrStr = NULL;
virDomainPCIAddressBusPtr bus;
virDomainPCIAddressBus *bus;
virErrorNumber errType = (fromConfig
? VIR_ERR_XML_ERROR : VIR_ERR_INTERNAL_ERROR);
@ -862,8 +862,8 @@ virDomainPCIAddressReserveAddrInternal(virDomainPCIAddressSetPtr addrs,
int
virDomainPCIAddressReserveAddr(virDomainPCIAddressSetPtr addrs,
virPCIDeviceAddressPtr addr,
virDomainPCIAddressReserveAddr(virDomainPCIAddressSet *addrs,
virPCIDeviceAddress *addr,
virDomainPCIConnectFlags flags,
unsigned int isolationGroup)
{
@ -872,8 +872,8 @@ virDomainPCIAddressReserveAddr(virDomainPCIAddressSetPtr addrs,
}
int
virDomainPCIAddressEnsureAddr(virDomainPCIAddressSetPtr addrs,
virDomainDeviceInfoPtr dev,
virDomainPCIAddressEnsureAddr(virDomainPCIAddressSet *addrs,
virDomainDeviceInfo *dev,
virDomainPCIConnectFlags flags)
{
g_autofree char *addrStr = NULL;
@ -926,8 +926,8 @@ virDomainPCIAddressEnsureAddr(virDomainPCIAddressSetPtr addrs,
void
virDomainPCIAddressExtensionReleaseAddr(virDomainPCIAddressSetPtr addrs,
virPCIDeviceAddressPtr addr)
virDomainPCIAddressExtensionReleaseAddr(virDomainPCIAddressSet *addrs,
virPCIDeviceAddress *addr)
{
if (addr->extFlags & VIR_PCI_ADDRESS_EXTENSION_ZPCI)
virDomainZPCIAddressReleaseIds(addrs->zpciIds, &addr->zpci);
@ -935,15 +935,15 @@ virDomainPCIAddressExtensionReleaseAddr(virDomainPCIAddressSetPtr addrs,
void
virDomainPCIAddressReleaseAddr(virDomainPCIAddressSetPtr addrs,
virPCIDeviceAddressPtr addr)
virDomainPCIAddressReleaseAddr(virDomainPCIAddressSet *addrs,
virPCIDeviceAddress *addr)
{
addrs->buses[addr->bus].slot[addr->slot].functions &= ~(1 << addr->function);
}
static void
virDomainPCIAddressSetExtensionFree(virDomainZPCIAddressIdsPtr zpciIds)
virDomainPCIAddressSetExtensionFree(virDomainZPCIAddressIds *zpciIds)
{
if (!zpciIds)
return;
@ -956,7 +956,7 @@ virDomainPCIAddressSetExtensionFree(virDomainZPCIAddressIdsPtr zpciIds)
static int
virDomainPCIAddressSetExtensionAlloc(virDomainPCIAddressSetPtr addrs,
virDomainPCIAddressSetExtensionAlloc(virDomainPCIAddressSet *addrs,
virPCIDeviceAddressExtensionFlags extFlags)
{
if (extFlags & VIR_PCI_ADDRESS_EXTENSION_ZPCI) {
@ -973,11 +973,11 @@ virDomainPCIAddressSetExtensionAlloc(virDomainPCIAddressSetPtr addrs,
}
virDomainPCIAddressSetPtr
virDomainPCIAddressSet *
virDomainPCIAddressSetAlloc(unsigned int nbuses,
virPCIDeviceAddressExtensionFlags extFlags)
{
virDomainPCIAddressSetPtr addrs;
virDomainPCIAddressSet *addrs;
addrs = g_new0(virDomainPCIAddressSet, 1);
addrs->buses = g_new0(virDomainPCIAddressBus, nbuses);
@ -995,7 +995,7 @@ virDomainPCIAddressSetAlloc(unsigned int nbuses,
void
virDomainPCIAddressSetFree(virDomainPCIAddressSetPtr addrs)
virDomainPCIAddressSetFree(virDomainPCIAddressSet *addrs)
{
if (!addrs)
return;
@ -1007,8 +1007,8 @@ virDomainPCIAddressSetFree(virDomainPCIAddressSetPtr addrs)
static int
virDomainPCIAddressFindUnusedFunctionOnBus(virDomainPCIAddressBusPtr bus,
virPCIDeviceAddressPtr searchAddr,
virDomainPCIAddressFindUnusedFunctionOnBus(virDomainPCIAddressBus *bus,
virPCIDeviceAddress *searchAddr,
int function,
virDomainPCIConnectFlags flags,
bool *found)
@ -1069,8 +1069,8 @@ virDomainPCIAddressFindUnusedFunctionOnBus(virDomainPCIAddressBusPtr bus,
static int ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2)
virDomainPCIAddressGetNextAddr(virDomainPCIAddressSetPtr addrs,
virPCIDeviceAddressPtr next_addr,
virDomainPCIAddressGetNextAddr(virDomainPCIAddressSet *addrs,
virPCIDeviceAddress *next_addr,
virDomainPCIConnectFlags flags,
unsigned int isolationGroup,
int function)
@ -1093,7 +1093,7 @@ virDomainPCIAddressGetNextAddr(virDomainPCIAddressSetPtr addrs,
* don't match. This ensures all devices sharing the same isolation
* group will end up on the same bus */
for (a.bus = 0; a.bus < addrs->nbuses; a.bus++) {
virDomainPCIAddressBusPtr bus = &addrs->buses[a.bus];
virDomainPCIAddressBus *bus = &addrs->buses[a.bus];
bool found = false;
if (bus->isolationGroup != isolationGroup)
@ -1114,7 +1114,7 @@ virDomainPCIAddressGetNextAddr(virDomainPCIAddressSetPtr addrs,
* might still be able to make this work by altering the isolation
* group for a bus that's currently empty. So let's try that */
for (a.bus = 0; a.bus < addrs->nbuses; a.bus++) {
virDomainPCIAddressBusPtr bus = &addrs->buses[a.bus];
virDomainPCIAddressBus *bus = &addrs->buses[a.bus];
bool found = false;
/* We can only change the isolation group for a bus when
@ -1176,8 +1176,8 @@ virDomainPCIAddressGetNextAddr(virDomainPCIAddressSetPtr addrs,
* returns 0 on success, or -1 on failure.
*/
int
virDomainPCIAddressReserveNextAddr(virDomainPCIAddressSetPtr addrs,
virDomainDeviceInfoPtr dev,
virDomainPCIAddressReserveNextAddr(virDomainPCIAddressSet *addrs,
virDomainDeviceInfo *dev,
virDomainPCIConnectFlags flags,
int function)
{
@ -1204,13 +1204,13 @@ virDomainPCIAddressReserveNextAddr(virDomainPCIAddressSetPtr addrs,
static int
virDomainPCIAddressSetMultiIter(virDomainDefPtr def G_GNUC_UNUSED,
virDomainDeviceDefPtr dev G_GNUC_UNUSED,
virDomainDeviceInfoPtr info,
virDomainPCIAddressSetMultiIter(virDomainDef *def G_GNUC_UNUSED,
virDomainDeviceDef *dev G_GNUC_UNUSED,
virDomainDeviceInfo *info,
void *data)
{
virPCIDeviceAddressPtr testAddr = data;
virPCIDeviceAddressPtr thisAddr;
virPCIDeviceAddress *testAddr = data;
virPCIDeviceAddress *thisAddr;
if (!info || info->type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI)
return 0;
@ -1237,12 +1237,12 @@ virDomainPCIAddressSetMultiIter(virDomainDefPtr def G_GNUC_UNUSED,
static int
virDomainPCIAddressSetAllMultiIter(virDomainDefPtr def,
virDomainDeviceDefPtr dev G_GNUC_UNUSED,
virDomainDeviceInfoPtr info,
virDomainPCIAddressSetAllMultiIter(virDomainDef *def,
virDomainDeviceDef *dev G_GNUC_UNUSED,
virDomainDeviceInfo *info,
void *data G_GNUC_UNUSED)
{
virPCIDeviceAddressPtr testAddr;
virPCIDeviceAddress *testAddr;
if (!info || info->type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI)
return 0;
@ -1272,7 +1272,7 @@ virDomainPCIAddressSetAllMultiIter(virDomainDefPtr def,
* No return code, since there is no possibility of failure.
*/
void
virDomainPCIAddressSetAllMulti(virDomainDefPtr def)
virDomainPCIAddressSetAllMulti(virDomainDef *def)
{
/* Use nested iterators over all the devices - the outer iterator
* scans through all the devices looking for those whose address
@ -1287,13 +1287,13 @@ virDomainPCIAddressSetAllMulti(virDomainDefPtr def)
char*
virDomainCCWAddressAsString(virDomainDeviceCCWAddressPtr addr)
virDomainCCWAddressAsString(virDomainDeviceCCWAddress *addr)
{
return g_strdup_printf("%x.%x.%04x", addr->cssid, addr->ssid, addr->devno);
}
static int
virDomainCCWAddressIncrement(virDomainDeviceCCWAddressPtr addr)
virDomainCCWAddressIncrement(virDomainDeviceCCWAddress *addr)
{
virDomainDeviceCCWAddress ccwaddr = *addr;
@ -1307,8 +1307,8 @@ virDomainCCWAddressIncrement(virDomainDeviceCCWAddressPtr addr)
int
virDomainCCWAddressAssign(virDomainDeviceInfoPtr dev,
virDomainCCWAddressSetPtr addrs,
virDomainCCWAddressAssign(virDomainDeviceInfo *dev,
virDomainCCWAddressSet *addrs,
bool autoassign)
{
g_autofree char *addr = NULL;
@ -1355,24 +1355,24 @@ virDomainCCWAddressAssign(virDomainDeviceInfoPtr dev,
}
static int ATTRIBUTE_NONNULL(3) ATTRIBUTE_NONNULL(4)
virDomainCCWAddressAllocate(virDomainDefPtr def G_GNUC_UNUSED,
virDomainDeviceDefPtr dev G_GNUC_UNUSED,
virDomainDeviceInfoPtr info,
virDomainCCWAddressAllocate(virDomainDef *def G_GNUC_UNUSED,
virDomainDeviceDef *dev G_GNUC_UNUSED,
virDomainDeviceInfo *info,
void *data)
{
return virDomainCCWAddressAssign(info, data, true);
}
static int ATTRIBUTE_NONNULL(3) ATTRIBUTE_NONNULL(4)
virDomainCCWAddressValidate(virDomainDefPtr def G_GNUC_UNUSED,
virDomainDeviceDefPtr dev G_GNUC_UNUSED,
virDomainDeviceInfoPtr info,
virDomainCCWAddressValidate(virDomainDef *def G_GNUC_UNUSED,
virDomainDeviceDef *dev G_GNUC_UNUSED,
virDomainDeviceInfo *info,
void *data)
{
return virDomainCCWAddressAssign(info, data, false);
}
void virDomainCCWAddressSetFree(virDomainCCWAddressSetPtr addrs)
void virDomainCCWAddressSetFree(virDomainCCWAddressSet *addrs)
{
if (!addrs)
return;
@ -1381,10 +1381,10 @@ void virDomainCCWAddressSetFree(virDomainCCWAddressSetPtr addrs)
g_free(addrs);
}
static virDomainCCWAddressSetPtr
static virDomainCCWAddressSet *
virDomainCCWAddressSetCreate(void)
{
virDomainCCWAddressSetPtr addrs = NULL;
virDomainCCWAddressSet *addrs = NULL;
addrs = g_new0(virDomainCCWAddressSet, 1);
@ -1404,10 +1404,10 @@ virDomainCCWAddressSetCreate(void)
}
virDomainCCWAddressSetPtr
virDomainCCWAddressSetCreateFromDomain(virDomainDefPtr def)
virDomainCCWAddressSet *
virDomainCCWAddressSetCreateFromDomain(virDomainDef *def)
{
virDomainCCWAddressSetPtr addrs = NULL;
virDomainCCWAddressSet *addrs = NULL;
if (!(addrs = virDomainCCWAddressSetCreate()))
goto error;
@ -1435,10 +1435,10 @@ virDomainCCWAddressSetCreateFromDomain(virDomainDefPtr def)
*
* Allocates an address set for virtio serial addresses
*/
static virDomainVirtioSerialAddrSetPtr
static virDomainVirtioSerialAddrSet *
virDomainVirtioSerialAddrSetCreate(void)
{
virDomainVirtioSerialAddrSetPtr ret = NULL;
virDomainVirtioSerialAddrSet *ret = NULL;
ret = g_new0(virDomainVirtioSerialAddrSet, 1);
@ -1446,7 +1446,7 @@ virDomainVirtioSerialAddrSetCreate(void)
}
static void
virDomainVirtioSerialControllerFree(virDomainVirtioSerialControllerPtr cont)
virDomainVirtioSerialControllerFree(virDomainVirtioSerialController *cont)
{
if (cont) {
virBitmapFree(cont->ports);
@ -1455,8 +1455,8 @@ virDomainVirtioSerialControllerFree(virDomainVirtioSerialControllerPtr cont)
}
static ssize_t
virDomainVirtioSerialAddrPlaceController(virDomainVirtioSerialAddrSetPtr addrs,
virDomainVirtioSerialControllerPtr cont)
virDomainVirtioSerialAddrPlaceController(virDomainVirtioSerialAddrSet *addrs,
virDomainVirtioSerialController *cont)
{
size_t i;
@ -1475,7 +1475,7 @@ virDomainVirtioSerialAddrPlaceController(virDomainVirtioSerialAddrSetPtr addrs,
}
static ssize_t
virDomainVirtioSerialAddrFindController(virDomainVirtioSerialAddrSetPtr addrs,
virDomainVirtioSerialAddrFindController(virDomainVirtioSerialAddrSet *addrs,
unsigned int idx)
{
size_t i;
@ -1493,12 +1493,12 @@ virDomainVirtioSerialAddrFindController(virDomainVirtioSerialAddrSetPtr addrs,
* to the address set.
*/
static int
virDomainVirtioSerialAddrSetAddController(virDomainVirtioSerialAddrSetPtr addrs,
virDomainControllerDefPtr cont)
virDomainVirtioSerialAddrSetAddController(virDomainVirtioSerialAddrSet *addrs,
virDomainControllerDef *cont)
{
int ret = -1;
int ports;
virDomainVirtioSerialControllerPtr cnt = NULL;
virDomainVirtioSerialController *cnt = NULL;
ssize_t insertAt;
if (cont->type != VIR_DOMAIN_CONTROLLER_TYPE_VIRTIO_SERIAL)
@ -1535,8 +1535,8 @@ virDomainVirtioSerialAddrSetAddController(virDomainVirtioSerialAddrSetPtr addrs,
* to the address set.
*/
static int ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2)
virDomainVirtioSerialAddrSetAddControllers(virDomainVirtioSerialAddrSetPtr addrs,
virDomainDefPtr def)
virDomainVirtioSerialAddrSetAddControllers(virDomainVirtioSerialAddrSet *addrs,
virDomainDef *def)
{
size_t i;
@ -1551,7 +1551,7 @@ virDomainVirtioSerialAddrSetAddControllers(virDomainVirtioSerialAddrSetPtr addrs
void
virDomainVirtioSerialAddrSetFree(virDomainVirtioSerialAddrSetPtr addrs)
virDomainVirtioSerialAddrSetFree(virDomainVirtioSerialAddrSet *addrs)
{
size_t i;
if (addrs) {
@ -1570,13 +1570,13 @@ virDomainVirtioSerialAddrSetFree(virDomainVirtioSerialAddrSetPtr addrs)
* opaque should be the address set
*/
static int ATTRIBUTE_NONNULL(3) ATTRIBUTE_NONNULL(4)
virDomainVirtioSerialAddrReserve(virDomainDefPtr def G_GNUC_UNUSED,
virDomainDeviceDefPtr dev G_GNUC_UNUSED,
virDomainDeviceInfoPtr info,
virDomainVirtioSerialAddrReserve(virDomainDef *def G_GNUC_UNUSED,
virDomainDeviceDef *dev G_GNUC_UNUSED,
virDomainDeviceInfo *info,
void *data)
{
virDomainVirtioSerialAddrSetPtr addrs = data;
virBitmapPtr map = NULL;
virDomainVirtioSerialAddrSet *addrs = data;
virBitmap *map = NULL;
bool b;
ssize_t i;
@ -1623,11 +1623,11 @@ virDomainVirtioSerialAddrReserve(virDomainDefPtr def G_GNUC_UNUSED,
* Inspect the domain definition and return an address set containing
* every virtio serial address we find
*/
virDomainVirtioSerialAddrSetPtr
virDomainVirtioSerialAddrSetCreateFromDomain(virDomainDefPtr def)
virDomainVirtioSerialAddrSet *
virDomainVirtioSerialAddrSetCreateFromDomain(virDomainDef *def)
{
virDomainVirtioSerialAddrSetPtr addrs = NULL;
virDomainVirtioSerialAddrSetPtr ret = NULL;
virDomainVirtioSerialAddrSet *addrs = NULL;
virDomainVirtioSerialAddrSet *ret = NULL;
if (!(addrs = virDomainVirtioSerialAddrSetCreate()))
goto cleanup;
@ -1646,8 +1646,8 @@ virDomainVirtioSerialAddrSetCreateFromDomain(virDomainDefPtr def)
}
static int
virDomainVirtioSerialAddrSetAutoaddController(virDomainDefPtr def,
virDomainVirtioSerialAddrSetPtr addrs,
virDomainVirtioSerialAddrSetAutoaddController(virDomainDef *def,
virDomainVirtioSerialAddrSet *addrs,
unsigned int idx)
{
int contidx;
@ -1666,8 +1666,8 @@ virDomainVirtioSerialAddrSetAutoaddController(virDomainDefPtr def,
}
static int
virDomainVirtioSerialAddrNext(virDomainDefPtr def,
virDomainVirtioSerialAddrSetPtr addrs,
virDomainVirtioSerialAddrNext(virDomainDef *def,
virDomainVirtioSerialAddrSet *addrs,
virDomainDeviceVirtioSerialAddress *addr,
bool allowZero)
{
@ -1686,7 +1686,7 @@ virDomainVirtioSerialAddrNext(virDomainDefPtr def,
}
for (i = 0; i < addrs->ncontrollers; i++) {
virBitmapPtr map = addrs->controllers[i]->ports;
virBitmap *map = addrs->controllers[i]->ports;
if ((port = virBitmapNextClearBit(map, startPort)) >= 0) {
controller = addrs->controllers[i]->idx;
goto success;
@ -1722,12 +1722,12 @@ virDomainVirtioSerialAddrNext(virDomainDefPtr def,
}
static int
virDomainVirtioSerialAddrNextFromController(virDomainVirtioSerialAddrSetPtr addrs,
virDomainVirtioSerialAddrNextFromController(virDomainVirtioSerialAddrSet *addrs,
virDomainDeviceVirtioSerialAddress *addr)
{
ssize_t port;
ssize_t i;
virBitmapPtr map;
virBitmap *map;
i = virDomainVirtioSerialAddrFindController(addrs, addr->controller);
if (i < 0) {
@ -1753,14 +1753,14 @@ virDomainVirtioSerialAddrNextFromController(virDomainVirtioSerialAddrSetPtr addr
}
static int ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3)
virDomainVirtioSerialAddrAssign(virDomainDefPtr def,
virDomainVirtioSerialAddrSetPtr addrs,
virDomainDeviceInfoPtr info,
virDomainVirtioSerialAddrAssign(virDomainDef *def,
virDomainVirtioSerialAddrSet *addrs,
virDomainDeviceInfo *info,
bool allowZero,
bool portOnly)
{
virDomainDeviceInfo nfo = { 0 };
virDomainDeviceInfoPtr ptr = allowZero ? &nfo : info;
virDomainDeviceInfo *ptr = allowZero ? &nfo : info;
ptr->type = VIR_DOMAIN_DEVICE_ADDRESS_TYPE_VIRTIO_SERIAL;
@ -1786,9 +1786,9 @@ virDomainVirtioSerialAddrAssign(virDomainDefPtr def,
* or assign a virtio serial address to the device
*/
int
virDomainVirtioSerialAddrAutoAssignFromCache(virDomainDefPtr def,
virDomainVirtioSerialAddrSetPtr addrs,
virDomainDeviceInfoPtr info,
virDomainVirtioSerialAddrAutoAssignFromCache(virDomainDef *def,
virDomainVirtioSerialAddrSet *addrs,
virDomainDeviceInfo *info,
bool allowZero)
{
bool portOnly = info->type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_VIRTIO_SERIAL;
@ -1800,11 +1800,11 @@ virDomainVirtioSerialAddrAutoAssignFromCache(virDomainDefPtr def,
}
int
virDomainVirtioSerialAddrAutoAssign(virDomainDefPtr def,
virDomainDeviceInfoPtr info,
virDomainVirtioSerialAddrAutoAssign(virDomainDef *def,
virDomainDeviceInfo *info,
bool allowZero)
{
virDomainVirtioSerialAddrSetPtr addrs = NULL;
virDomainVirtioSerialAddrSet *addrs = NULL;
int ret = -1;
if (!(addrs = virDomainVirtioSerialAddrSetCreateFromDomain(def)))
@ -1826,7 +1826,7 @@ virDomainVirtioSerialAddrAutoAssign(virDomainDefPtr def,
* Check if the address is complete, or it needs auto-assignment
*/
bool
virDomainVirtioSerialAddrIsComplete(virDomainDeviceInfoPtr info)
virDomainVirtioSerialAddrIsComplete(virDomainDeviceInfo *info)
{
return info->type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_VIRTIO_SERIAL &&
info->addr.vioserial.port != 0;
@ -1841,7 +1841,7 @@ virDomainUSBAddressPortIsValid(unsigned int *port)
void
virDomainUSBAddressPortFormatBuf(virBufferPtr buf,
virDomainUSBAddressPortFormatBuf(virBuffer *buf,
unsigned int *port)
{
size_t i;
@ -1864,10 +1864,10 @@ virDomainUSBAddressPortFormat(unsigned int *port)
}
virDomainUSBAddressSetPtr
virDomainUSBAddressSet *
virDomainUSBAddressSetCreate(void)
{
virDomainUSBAddressSetPtr addrs;
virDomainUSBAddressSet *addrs;
addrs = g_new0(virDomainUSBAddressSet, 1);
@ -1876,7 +1876,7 @@ virDomainUSBAddressSetCreate(void)
static void
virDomainUSBAddressHubFree(virDomainUSBAddressHubPtr hub)
virDomainUSBAddressHubFree(virDomainUSBAddressHub *hub)
{
size_t i;
@ -1892,7 +1892,7 @@ virDomainUSBAddressHubFree(virDomainUSBAddressHubPtr hub)
void
virDomainUSBAddressSetFree(virDomainUSBAddressSetPtr addrs)
virDomainUSBAddressSetFree(virDomainUSBAddressSet *addrs)
{
size_t i;
@ -1907,7 +1907,7 @@ virDomainUSBAddressSetFree(virDomainUSBAddressSetPtr addrs)
static size_t
virDomainUSBAddressControllerModelToPorts(virDomainControllerDefPtr cont)
virDomainUSBAddressControllerModelToPorts(virDomainControllerDef *cont)
{
switch ((virDomainControllerModelUSB) cont->model) {
case VIR_DOMAIN_CONTROLLER_MODEL_USB_DEFAULT:
@ -1951,16 +1951,16 @@ virDomainUSBAddressControllerModelToPorts(virDomainControllerDefPtr cont)
}
static virDomainUSBAddressHubPtr
static virDomainUSBAddressHub *
virDomainUSBAddressHubNew(size_t nports)
{
virDomainUSBAddressHubPtr hub;
virDomainUSBAddressHub *hub;
hub = g_new0(virDomainUSBAddressHub, 1);
hub->portmap = virBitmapNew(nports);
hub->ports = g_new0(virDomainUSBAddressHubPtr, nports);
hub->ports = g_new0(virDomainUSBAddressHub *, nports);
hub->nports = nports;
return hub;
@ -1968,11 +1968,11 @@ virDomainUSBAddressHubNew(size_t nports)
static int
virDomainUSBAddressSetAddController(virDomainUSBAddressSetPtr addrs,
virDomainControllerDefPtr cont)
virDomainUSBAddressSetAddController(virDomainUSBAddressSet *addrs,
virDomainControllerDef *cont)
{
size_t nports = virDomainUSBAddressControllerModelToPorts(cont);
virDomainUSBAddressHubPtr hub = NULL;
virDomainUSBAddressHub *hub = NULL;
int ret = -1;
VIR_DEBUG("Adding a USB controller model=%s with %zu ports",
@ -2005,7 +2005,7 @@ virDomainUSBAddressSetAddController(virDomainUSBAddressSetPtr addrs,
static ssize_t
virDomainUSBAddressGetLastIdx(virDomainDeviceInfoPtr info)
virDomainUSBAddressGetLastIdx(virDomainDeviceInfo *info)
{
ssize_t i;
for (i = VIR_DOMAIN_DEVICE_USB_MAX_PORT_DEPTH - 1; i > 0; i--) {
@ -2020,13 +2020,13 @@ virDomainUSBAddressGetLastIdx(virDomainDeviceInfoPtr info)
* that corresponds to the bus/port path specified by info.
* Returns the index of the requested port in targetIdx.
*/
static virDomainUSBAddressHubPtr
virDomainUSBAddressFindPort(virDomainUSBAddressSetPtr addrs,
virDomainDeviceInfoPtr info,
static virDomainUSBAddressHub *
virDomainUSBAddressFindPort(virDomainUSBAddressSet *addrs,
virDomainDeviceInfo *info,
int *targetIdx,
const char *portStr)
{
virDomainUSBAddressHubPtr hub = NULL;
virDomainUSBAddressHub *hub = NULL;
ssize_t i, lastIdx, targetPort;
if (info->addr.usb.bus >= addrs->nbuses ||
@ -2076,11 +2076,11 @@ virDomainUSBAddressFindPort(virDomainUSBAddressSetPtr addrs,
int
virDomainUSBAddressSetAddHub(virDomainUSBAddressSetPtr addrs,
virDomainHubDefPtr hub)
virDomainUSBAddressSetAddHub(virDomainUSBAddressSet *addrs,
virDomainHubDef *hub)
{
virDomainUSBAddressHubPtr targetHub = NULL;
virDomainUSBAddressHubPtr newHub = NULL;
virDomainUSBAddressHub *targetHub = NULL;
virDomainUSBAddressHub *newHub = NULL;
int ret = -1;
int targetPort;
g_autofree char *portStr = NULL;
@ -2121,13 +2121,13 @@ virDomainUSBAddressSetAddHub(virDomainUSBAddressSetPtr addrs,
int
virDomainUSBAddressSetAddControllers(virDomainUSBAddressSetPtr addrs,
virDomainDefPtr def)
virDomainUSBAddressSetAddControllers(virDomainUSBAddressSet *addrs,
virDomainDef *def)
{
size_t i;
for (i = 0; i < def->ncontrollers; i++) {
virDomainControllerDefPtr cont = def->controllers[i];
virDomainControllerDef *cont = def->controllers[i];
if (cont->type == VIR_DOMAIN_CONTROLLER_TYPE_USB) {
if (virDomainUSBAddressSetAddController(addrs, cont) < 0)
return -1;
@ -2135,7 +2135,7 @@ virDomainUSBAddressSetAddControllers(virDomainUSBAddressSetPtr addrs,
}
for (i = 0; i < def->nhubs; i++) {
virDomainHubDefPtr hub = def->hubs[i];
virDomainHubDef *hub = def->hubs[i];
if (hub->type == VIR_DOMAIN_HUB_TYPE_USB &&
hub->info.type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_USB &&
virDomainUSBAddressPortIsValid(hub->info.addr.usb.port)) {
@ -2150,7 +2150,7 @@ virDomainUSBAddressSetAddControllers(virDomainUSBAddressSetPtr addrs,
static int
virDomainUSBAddressFindFreePort(virDomainUSBAddressHubPtr hub,
virDomainUSBAddressFindFreePort(virDomainUSBAddressHub *hub,
unsigned int *portpath,
unsigned int level)
{
@ -2190,18 +2190,18 @@ virDomainUSBAddressFindFreePort(virDomainUSBAddressHubPtr hub,
size_t
virDomainUSBAddressCountAllPorts(virDomainDefPtr def)
virDomainUSBAddressCountAllPorts(virDomainDef *def)
{
size_t i, ret = 0;
for (i = 0; i < def->ncontrollers; i++) {
virDomainControllerDefPtr cont = def->controllers[i];
virDomainControllerDef *cont = def->controllers[i];
if (cont->type == VIR_DOMAIN_CONTROLLER_TYPE_USB)
ret += virDomainUSBAddressControllerModelToPorts(cont);
}
for (i = 0; i < def->nhubs; i++) {
virDomainHubDefPtr hub = def->hubs[i];
virDomainHubDef *hub = def->hubs[i];
if (hub->type == VIR_DOMAIN_HUB_TYPE_USB)
ret += VIR_DOMAIN_USB_HUB_PORTS;
}
@ -2216,12 +2216,12 @@ virDomainUSBAddressCountAllPorts(virDomainDefPtr def)
* -2 if there is no bus at @bus or no free port on this bus
*/
static int
virDomainUSBAddressAssignFromBus(virDomainUSBAddressSetPtr addrs,
virDomainDeviceInfoPtr info,
virDomainUSBAddressAssignFromBus(virDomainUSBAddressSet *addrs,
virDomainDeviceInfo *info,
size_t bus)
{
unsigned int portpath[VIR_DOMAIN_DEVICE_USB_MAX_PORT_DEPTH] = { 0 };
virDomainUSBAddressHubPtr hub = addrs->buses[bus];
virDomainUSBAddressHub *hub = addrs->buses[bus];
g_autofree char *portStr = NULL;
if (!hub)
@ -2247,8 +2247,8 @@ virDomainUSBAddressAssignFromBus(virDomainUSBAddressSetPtr addrs,
int
virDomainUSBAddressAssign(virDomainUSBAddressSetPtr addrs,
virDomainDeviceInfoPtr info)
virDomainUSBAddressAssign(virDomainUSBAddressSet *addrs,
virDomainDeviceInfo *info)
{
size_t i;
int rc;
@ -2280,7 +2280,7 @@ virDomainUSBAddressAssign(virDomainUSBAddressSetPtr addrs,
int
virDomainUSBAddressPresent(virDomainDeviceInfoPtr info,
virDomainUSBAddressPresent(virDomainDeviceInfo *info,
void *data G_GNUC_UNUSED)
{
if (info->type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_USB &&
@ -2292,11 +2292,11 @@ virDomainUSBAddressPresent(virDomainDeviceInfoPtr info,
int
virDomainUSBAddressReserve(virDomainDeviceInfoPtr info,
virDomainUSBAddressReserve(virDomainDeviceInfo *info,
void *data)
{
virDomainUSBAddressSetPtr addrs = data;
virDomainUSBAddressHubPtr targetHub = NULL;
virDomainUSBAddressSet *addrs = data;
virDomainUSBAddressHub *targetHub = NULL;
g_autofree char *portStr = NULL;
int targetPort;
@ -2329,8 +2329,8 @@ virDomainUSBAddressReserve(virDomainDeviceInfoPtr info,
int
virDomainUSBAddressEnsure(virDomainUSBAddressSetPtr addrs,
virDomainDeviceInfoPtr info)
virDomainUSBAddressEnsure(virDomainUSBAddressSet *addrs,
virDomainDeviceInfo *info)
{
if (!addrs)
return 0;
@ -2350,10 +2350,10 @@ virDomainUSBAddressEnsure(virDomainUSBAddressSetPtr addrs,
int
virDomainUSBAddressRelease(virDomainUSBAddressSetPtr addrs,
virDomainDeviceInfoPtr info)
virDomainUSBAddressRelease(virDomainUSBAddressSet *addrs,
virDomainDeviceInfo *info)
{
virDomainUSBAddressHubPtr targetHub = NULL;
virDomainUSBAddressHub *targetHub = NULL;
g_autofree char *portStr = NULL;
int targetPort;

View File

@ -112,13 +112,11 @@ typedef struct {
/* See virDomainDeviceInfo::isolationGroupLocked */
bool isolationGroupLocked;
} virDomainPCIAddressBus;
typedef virDomainPCIAddressBus *virDomainPCIAddressBusPtr;
typedef struct {
GHashTable *uids;
GHashTable *fids;
} virDomainZPCIAddressIds;
typedef virDomainZPCIAddressIds *virDomainZPCIAddressIdsPtr;
struct _virDomainPCIAddressSet {
virDomainPCIAddressBus *buses;
@ -129,70 +127,70 @@ struct _virDomainPCIAddressSet {
bool areMultipleRootsSupported;
/* If true, the guest can use the pcie-to-pci-bridge controller */
bool isPCIeToPCIBridgeSupported;
virDomainZPCIAddressIdsPtr zpciIds;
virDomainZPCIAddressIds *zpciIds;
};
typedef struct _virDomainPCIAddressSet virDomainPCIAddressSet;
typedef virDomainPCIAddressSet *virDomainPCIAddressSetPtr;
virDomainPCIAddressSetPtr virDomainPCIAddressSetAlloc(unsigned int nbuses,
virPCIDeviceAddressExtensionFlags extFlags);
virDomainPCIAddressSet *
virDomainPCIAddressSetAlloc(unsigned int nbuses,
virPCIDeviceAddressExtensionFlags extFlags);
void virDomainPCIAddressSetFree(virDomainPCIAddressSetPtr addrs);
void virDomainPCIAddressSetFree(virDomainPCIAddressSet *addrs);
bool virDomainPCIAddressValidate(virDomainPCIAddressSetPtr addrs,
virPCIDeviceAddressPtr addr,
bool virDomainPCIAddressValidate(virDomainPCIAddressSet *addrs,
virPCIDeviceAddress *addr,
const char *addrStr,
virDomainPCIConnectFlags flags,
bool fromConfig)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3);
int virDomainPCIAddressBusSetModel(virDomainPCIAddressBusPtr bus,
int virDomainPCIAddressBusSetModel(virDomainPCIAddressBus *bus,
virDomainControllerModelPCI model,
bool allowHotplug)
ATTRIBUTE_NONNULL(1);
bool virDomainPCIAddressBusIsFullyReserved(virDomainPCIAddressBusPtr bus)
bool virDomainPCIAddressBusIsFullyReserved(virDomainPCIAddressBus *bus)
ATTRIBUTE_NONNULL(1);
bool virDomainPCIAddressSlotInUse(virDomainPCIAddressSetPtr addrs,
virPCIDeviceAddressPtr addr)
bool virDomainPCIAddressSlotInUse(virDomainPCIAddressSet *addrs,
virPCIDeviceAddress *addr)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
int virDomainPCIAddressExtensionReserveAddr(virDomainPCIAddressSetPtr addrs,
virPCIDeviceAddressPtr addr)
int virDomainPCIAddressExtensionReserveAddr(virDomainPCIAddressSet *addrs,
virPCIDeviceAddress *addr)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
int virDomainPCIAddressExtensionReserveNextAddr(virDomainPCIAddressSetPtr addrs,
virPCIDeviceAddressPtr addr)
int virDomainPCIAddressExtensionReserveNextAddr(virDomainPCIAddressSet *addrs,
virPCIDeviceAddress *addr)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
int virDomainPCIAddressReserveAddr(virDomainPCIAddressSetPtr addrs,
virPCIDeviceAddressPtr addr,
int virDomainPCIAddressReserveAddr(virDomainPCIAddressSet *addrs,
virPCIDeviceAddress *addr,
virDomainPCIConnectFlags flags,
unsigned int isolationGroup)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
int virDomainPCIAddressReserveNextAddr(virDomainPCIAddressSetPtr addrs,
virDomainDeviceInfoPtr dev,
int virDomainPCIAddressReserveNextAddr(virDomainPCIAddressSet *addrs,
virDomainDeviceInfo *dev,
virDomainPCIConnectFlags flags,
int function)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
int virDomainPCIAddressEnsureAddr(virDomainPCIAddressSetPtr addrs,
virDomainDeviceInfoPtr dev,
int virDomainPCIAddressEnsureAddr(virDomainPCIAddressSet *addrs,
virDomainDeviceInfo *dev,
virDomainPCIConnectFlags flags)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
void virDomainPCIAddressReleaseAddr(virDomainPCIAddressSetPtr addrs,
virPCIDeviceAddressPtr addr)
void virDomainPCIAddressReleaseAddr(virDomainPCIAddressSet *addrs,
virPCIDeviceAddress *addr)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
void virDomainPCIAddressExtensionReleaseAddr(virDomainPCIAddressSetPtr addrs,
virPCIDeviceAddressPtr addr)
void virDomainPCIAddressExtensionReleaseAddr(virDomainPCIAddressSet *addrs,
virPCIDeviceAddress *addr)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
void virDomainPCIAddressSetAllMulti(virDomainDefPtr def)
void virDomainPCIAddressSetAllMulti(virDomainDef *def)
ATTRIBUTE_NONNULL(1);
struct _virDomainCCWAddressSet {
@ -200,53 +198,50 @@ struct _virDomainCCWAddressSet {
virDomainDeviceCCWAddress next;
};
typedef struct _virDomainCCWAddressSet virDomainCCWAddressSet;
typedef virDomainCCWAddressSet *virDomainCCWAddressSetPtr;
int virDomainCCWAddressAssign(virDomainDeviceInfoPtr dev,
virDomainCCWAddressSetPtr addrs,
int virDomainCCWAddressAssign(virDomainDeviceInfo *dev,
virDomainCCWAddressSet *addrs,
bool autoassign)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
void virDomainCCWAddressSetFree(virDomainCCWAddressSetPtr addrs);
void virDomainCCWAddressSetFree(virDomainCCWAddressSet *addrs);
char* virDomainCCWAddressAsString(virDomainDeviceCCWAddressPtr addr)
char* virDomainCCWAddressAsString(virDomainDeviceCCWAddress *addr)
ATTRIBUTE_NONNULL(1);
virDomainCCWAddressSetPtr
virDomainCCWAddressSetCreateFromDomain(virDomainDefPtr def)
virDomainCCWAddressSet *
virDomainCCWAddressSetCreateFromDomain(virDomainDef *def)
ATTRIBUTE_NONNULL(1);
struct _virDomainVirtioSerialController {
unsigned int idx;
virBitmapPtr ports;
virBitmap *ports;
};
typedef struct _virDomainVirtioSerialController virDomainVirtioSerialController;
typedef virDomainVirtioSerialController *virDomainVirtioSerialControllerPtr;
struct _virDomainVirtioSerialAddrSet {
virDomainVirtioSerialControllerPtr *controllers;
virDomainVirtioSerialController **controllers;
size_t ncontrollers;
};
typedef struct _virDomainVirtioSerialAddrSet virDomainVirtioSerialAddrSet;
typedef virDomainVirtioSerialAddrSet *virDomainVirtioSerialAddrSetPtr;
void
virDomainVirtioSerialAddrSetFree(virDomainVirtioSerialAddrSetPtr addrs);
virDomainVirtioSerialAddrSetPtr
virDomainVirtioSerialAddrSetCreateFromDomain(virDomainDefPtr def)
virDomainVirtioSerialAddrSetFree(virDomainVirtioSerialAddrSet *addrs);
virDomainVirtioSerialAddrSet *
virDomainVirtioSerialAddrSetCreateFromDomain(virDomainDef *def)
ATTRIBUTE_NONNULL(1);
bool
virDomainVirtioSerialAddrIsComplete(virDomainDeviceInfoPtr info);
virDomainVirtioSerialAddrIsComplete(virDomainDeviceInfo *info);
int
virDomainVirtioSerialAddrAutoAssignFromCache(virDomainDefPtr def,
virDomainVirtioSerialAddrSetPtr addrs,
virDomainDeviceInfoPtr info,
virDomainVirtioSerialAddrAutoAssignFromCache(virDomainDef *def,
virDomainVirtioSerialAddrSet *addrs,
virDomainDeviceInfo *info,
bool allowZero)
ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3);
int
virDomainVirtioSerialAddrAutoAssign(virDomainDefPtr def,
virDomainDeviceInfoPtr info,
virDomainVirtioSerialAddrAutoAssign(virDomainDef *def,
virDomainDeviceInfo *info,
bool allowZero)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
@ -255,64 +250,62 @@ virDomainUSBAddressPortIsValid(unsigned int *port)
ATTRIBUTE_NONNULL(1);
void
virDomainUSBAddressPortFormatBuf(virBufferPtr buf,
virDomainUSBAddressPortFormatBuf(virBuffer *buf,
unsigned int *port)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
#define VIR_DOMAIN_USB_HUB_PORTS 8
typedef struct _virDomainUSBAddressHub virDomainUSBAddressHub;
typedef virDomainUSBAddressHub *virDomainUSBAddressHubPtr;
struct _virDomainUSBAddressHub {
/* indexes are shifted by one:
* ports[0] represents port 1, because ports are numbered from 1 */
virBitmapPtr portmap;
virBitmap *portmap;
size_t nports;
virDomainUSBAddressHubPtr *ports;
virDomainUSBAddressHub **ports;
};
struct _virDomainUSBAddressSet {
/* every <controller type='usb' index='i'> is represented
* as a hub at buses[i] */
virDomainUSBAddressHubPtr *buses;
virDomainUSBAddressHub **buses;
size_t nbuses;
};
typedef struct _virDomainUSBAddressSet virDomainUSBAddressSet;
typedef virDomainUSBAddressSet *virDomainUSBAddressSetPtr;
virDomainUSBAddressSetPtr virDomainUSBAddressSetCreate(void);
virDomainUSBAddressSet *virDomainUSBAddressSetCreate(void);
int virDomainUSBAddressSetAddControllers(virDomainUSBAddressSetPtr addrs,
virDomainDefPtr def)
int virDomainUSBAddressSetAddControllers(virDomainUSBAddressSet *addrs,
virDomainDef *def)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
int
virDomainUSBAddressSetAddHub(virDomainUSBAddressSetPtr addrs,
virDomainHubDefPtr hub)
virDomainUSBAddressSetAddHub(virDomainUSBAddressSet *addrs,
virDomainHubDef *hub)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
size_t
virDomainUSBAddressCountAllPorts(virDomainDefPtr def);
void virDomainUSBAddressSetFree(virDomainUSBAddressSetPtr addrs);
virDomainUSBAddressCountAllPorts(virDomainDef *def);
void virDomainUSBAddressSetFree(virDomainUSBAddressSet *addrs);
int
virDomainUSBAddressPresent(virDomainDeviceInfoPtr info,
virDomainUSBAddressPresent(virDomainDeviceInfo *info,
void *data)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
int
virDomainUSBAddressReserve(virDomainDeviceInfoPtr info,
virDomainUSBAddressReserve(virDomainDeviceInfo *info,
void *data)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
int
virDomainUSBAddressAssign(virDomainUSBAddressSetPtr addrs,
virDomainDeviceInfoPtr info)
virDomainUSBAddressAssign(virDomainUSBAddressSet *addrs,
virDomainDeviceInfo *info)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
int
virDomainUSBAddressEnsure(virDomainUSBAddressSetPtr addrs,
virDomainDeviceInfoPtr info)
virDomainUSBAddressEnsure(virDomainUSBAddressSet *addrs,
virDomainDeviceInfo *info)
ATTRIBUTE_NONNULL(2);
int
virDomainUSBAddressRelease(virDomainUSBAddressSetPtr addrs,
virDomainDeviceInfoPtr info)
virDomainUSBAddressRelease(virDomainUSBAddressSet *addrs,
virDomainDeviceInfo *info)
ATTRIBUTE_NONNULL(2);

View File

@ -65,7 +65,7 @@ virDomainAuditGetRdev(const char *path G_GNUC_UNUSED)
static const char *
virDomainAuditGetVirtType(virDomainDefPtr def)
virDomainAuditGetVirtType(virDomainDef *def)
{
const char *virt;
@ -80,7 +80,7 @@ virDomainAuditGetVirtType(virDomainDefPtr def)
static void
virDomainAuditGenericDev(virDomainObjPtr vm,
virDomainAuditGenericDev(virDomainObj *vm,
const char *type,
const char *oldsrcpath,
const char *newsrcpath,
@ -120,14 +120,14 @@ virDomainAuditGenericDev(virDomainObjPtr vm,
void
virDomainAuditChardev(virDomainObjPtr vm,
virDomainChrDefPtr oldDef,
virDomainChrDefPtr newDef,
virDomainAuditChardev(virDomainObj *vm,
virDomainChrDef *oldDef,
virDomainChrDef *newDef,
const char *reason,
bool success)
{
virDomainChrSourceDefPtr oldsrc = NULL;
virDomainChrSourceDefPtr newsrc = NULL;
virDomainChrSourceDef *oldsrc = NULL;
virDomainChrSourceDef *newsrc = NULL;
if (oldDef)
oldsrc = oldDef->source;
@ -143,8 +143,8 @@ virDomainAuditChardev(virDomainObjPtr vm,
static void
virDomainAuditSmartcard(virDomainObjPtr vm,
virDomainSmartcardDefPtr def,
virDomainAuditSmartcard(virDomainObj *vm,
virDomainSmartcardDef *def,
const char *reason,
bool success)
{
@ -188,9 +188,9 @@ virDomainAuditSmartcard(virDomainObjPtr vm,
void
virDomainAuditDisk(virDomainObjPtr vm,
virStorageSourcePtr oldDef,
virStorageSourcePtr newDef,
virDomainAuditDisk(virDomainObj *vm,
virStorageSource *oldDef,
virStorageSource *newDef,
const char *reason,
bool success)
{
@ -208,8 +208,8 @@ virDomainAuditDisk(virDomainObjPtr vm,
void
virDomainAuditRNG(virDomainObjPtr vm,
virDomainRNGDefPtr oldDef, virDomainRNGDefPtr newDef,
virDomainAuditRNG(virDomainObj *vm,
virDomainRNGDef *oldDef, virDomainRNGDef *newDef,
const char *reason, bool success)
{
const char *newsrcpath = NULL;
@ -252,8 +252,8 @@ virDomainAuditRNG(virDomainObjPtr vm,
void
virDomainAuditFS(virDomainObjPtr vm,
virDomainFSDefPtr oldDef, virDomainFSDefPtr newDef,
virDomainAuditFS(virDomainObj *vm,
virDomainFSDef *oldDef, virDomainFSDef *newDef,
const char *reason, bool success)
{
virDomainAuditGenericDev(vm, "fs",
@ -264,8 +264,8 @@ virDomainAuditFS(virDomainObjPtr vm,
void
virDomainAuditNet(virDomainObjPtr vm,
virDomainNetDefPtr oldDef, virDomainNetDefPtr newDef,
virDomainAuditNet(virDomainObj *vm,
virDomainNetDef *oldDef, virDomainNetDef *newDef,
const char *reason, bool success)
{
char newMacstr[VIR_MAC_STRING_BUFLEN];
@ -296,7 +296,7 @@ virDomainAuditNet(virDomainObjPtr vm,
* Log an audit message about an attempted network device open.
*/
void
virDomainAuditNetDevice(virDomainDefPtr vmDef, virDomainNetDefPtr netDef,
virDomainAuditNetDevice(virDomainDef *vmDef, virDomainNetDef *netDef,
const char *device, bool success)
{
char uuidstr[VIR_UUID_STRING_BUFLEN];
@ -336,7 +336,7 @@ virDomainAuditNetDevice(virDomainDefPtr vmDef, virDomainNetDefPtr netDef,
* Log an audit message about an attempted device passthrough change.
*/
void
virDomainAuditHostdev(virDomainObjPtr vm, virDomainHostdevDefPtr hostdev,
virDomainAuditHostdev(virDomainObj *vm, virDomainHostdevDef *hostdev,
const char *reason, bool success)
{
char uuidstr[VIR_UUID_STRING_BUFLEN];
@ -345,11 +345,11 @@ virDomainAuditHostdev(virDomainObjPtr vm, virDomainHostdevDefPtr hostdev,
char *device = NULL;
const char *virt = virDomainAuditGetVirtType(vm->def);
virDomainHostdevSubsysUSBPtr usbsrc = &hostdev->source.subsys.u.usb;
virDomainHostdevSubsysPCIPtr pcisrc = &hostdev->source.subsys.u.pci;
virDomainHostdevSubsysSCSIPtr scsisrc = &hostdev->source.subsys.u.scsi;
virDomainHostdevSubsysSCSIVHostPtr hostsrc = &hostdev->source.subsys.u.scsi_host;
virDomainHostdevSubsysMediatedDevPtr mdevsrc = &hostdev->source.subsys.u.mdev;
virDomainHostdevSubsysUSB *usbsrc = &hostdev->source.subsys.u.usb;
virDomainHostdevSubsysPCI *pcisrc = &hostdev->source.subsys.u.pci;
virDomainHostdevSubsysSCSI *scsisrc = &hostdev->source.subsys.u.scsi;
virDomainHostdevSubsysSCSIVHost *hostsrc = &hostdev->source.subsys.u.scsi_host;
virDomainHostdevSubsysMediatedDev *mdevsrc = &hostdev->source.subsys.u.mdev;
virUUIDFormat(vm->def->uuid, uuidstr);
if (!(vmname = virAuditEncode("vm", vm->def->name))) {
@ -374,8 +374,8 @@ virDomainAuditHostdev(virDomainObjPtr vm, virDomainHostdevDefPtr hostdev,
*/
goto cleanup;
} else {
virDomainHostdevSubsysSCSIHostPtr scsihostsrc =
&scsisrc->u.host;
virDomainHostdevSubsysSCSIHost *scsihostsrc = &scsisrc->u.host;
address = g_strdup_printf("%s:%u:%u:%llu",
scsihostsrc->adapter, scsihostsrc->bus,
scsihostsrc->target,
@ -465,7 +465,7 @@ virDomainAuditHostdev(virDomainObjPtr vm, virDomainHostdevDefPtr hostdev,
* Log an audit message about an attempted device passthrough change.
*/
void
virDomainAuditRedirdev(virDomainObjPtr vm, virDomainRedirdevDefPtr redirdev,
virDomainAuditRedirdev(virDomainObj *vm, virDomainRedirdevDef *redirdev,
const char *reason, bool success)
{
char uuidstr[VIR_UUID_STRING_BUFLEN];
@ -519,7 +519,7 @@ virDomainAuditRedirdev(virDomainObjPtr vm, virDomainRedirdevDefPtr redirdev,
* change.
*/
static void
virDomainAuditTPM(virDomainObjPtr vm, virDomainTPMDefPtr tpm,
virDomainAuditTPM(virDomainObj *vm, virDomainTPMDef *tpm,
const char *reason, bool success)
{
char uuidstr[VIR_UUID_STRING_BUFLEN];
@ -582,7 +582,7 @@ virDomainAuditTPM(virDomainObjPtr vm, virDomainTPMDefPtr tpm,
* Log an audit message about an attempted cgroup device ACL change.
*/
void
virDomainAuditCgroup(virDomainObjPtr vm, virCgroupPtr cgroup,
virDomainAuditCgroup(virDomainObj *vm, virCgroup *cgroup,
const char *reason, const char *extra, bool success)
{
char uuidstr[VIR_UUID_STRING_BUFLEN];
@ -625,7 +625,7 @@ virDomainAuditCgroup(virDomainObjPtr vm, virCgroupPtr cgroup,
* Log an audit message about an attempted cgroup device ACL change.
*/
void
virDomainAuditCgroupMajor(virDomainObjPtr vm, virCgroupPtr cgroup,
virDomainAuditCgroupMajor(virDomainObj *vm, virCgroup *cgroup,
const char *reason, int maj, const char *name,
const char *perms, bool success)
{
@ -652,7 +652,7 @@ virDomainAuditCgroupMajor(virDomainObjPtr vm, virCgroupPtr cgroup,
* a specific device.
*/
void
virDomainAuditCgroupPath(virDomainObjPtr vm, virCgroupPtr cgroup,
virDomainAuditCgroupPath(virDomainObj *vm, virCgroup *cgroup,
const char *reason, const char *path, const char *perms,
int rc)
{
@ -694,7 +694,7 @@ virDomainAuditCgroupPath(virDomainObjPtr vm, virCgroupPtr cgroup,
* Log an audit message about an attempted resource change.
*/
static void
virDomainAuditResource(virDomainObjPtr vm, const char *resource,
virDomainAuditResource(virDomainObj *vm, const char *resource,
unsigned long long oldval, unsigned long long newval,
const char *reason, bool success)
{
@ -717,7 +717,7 @@ virDomainAuditResource(virDomainObjPtr vm, const char *resource,
}
void
virDomainAuditMemory(virDomainObjPtr vm,
virDomainAuditMemory(virDomainObj *vm,
unsigned long long oldmem, unsigned long long newmem,
const char *reason, bool success)
{
@ -725,7 +725,7 @@ virDomainAuditMemory(virDomainObjPtr vm,
}
void
virDomainAuditVcpu(virDomainObjPtr vm,
virDomainAuditVcpu(virDomainObj *vm,
unsigned int oldvcpu, unsigned int newvcpu,
const char *reason, bool success)
{
@ -733,7 +733,7 @@ virDomainAuditVcpu(virDomainObjPtr vm,
}
void
virDomainAuditIOThread(virDomainObjPtr vm,
virDomainAuditIOThread(virDomainObj *vm,
unsigned int oldiothread, unsigned int newiothread,
const char *reason, bool success)
{
@ -742,7 +742,7 @@ virDomainAuditIOThread(virDomainObjPtr vm,
}
static void
virDomainAuditLifecycle(virDomainObjPtr vm, const char *op,
virDomainAuditLifecycle(virDomainObj *vm, const char *op,
const char *reason, bool success)
{
char uuidstr[VIR_UUID_STRING_BUFLEN];
@ -765,7 +765,7 @@ virDomainAuditLifecycle(virDomainObjPtr vm, const char *op,
void
virDomainAuditStart(virDomainObjPtr vm, const char *reason, bool success)
virDomainAuditStart(virDomainObj *vm, const char *reason, bool success)
{
size_t i;
@ -773,22 +773,22 @@ virDomainAuditStart(virDomainObjPtr vm, const char *reason, bool success)
virDomainAuditDisk(vm, NULL, vm->def->disks[i]->src, "start", true);
for (i = 0; i < vm->def->nfss; i++) {
virDomainFSDefPtr fs = vm->def->fss[i];
virDomainFSDef *fs = vm->def->fss[i];
virDomainAuditFS(vm, NULL, fs, "start", true);
}
for (i = 0; i < vm->def->nnets; i++) {
virDomainNetDefPtr net = vm->def->nets[i];
virDomainNetDef *net = vm->def->nets[i];
virDomainAuditNet(vm, NULL, net, "start", true);
}
for (i = 0; i < vm->def->nhostdevs; i++) {
virDomainHostdevDefPtr hostdev = vm->def->hostdevs[i];
virDomainHostdevDef *hostdev = vm->def->hostdevs[i];
virDomainAuditHostdev(vm, hostdev, "start", true);
}
for (i = 0; i < vm->def->nredirdevs; i++) {
virDomainRedirdevDefPtr redirdev = vm->def->redirdevs[i];
virDomainRedirdevDef *redirdev = vm->def->redirdevs[i];
virDomainAuditRedirdev(vm, redirdev, "start", true);
}
@ -836,7 +836,7 @@ virDomainAuditStart(virDomainObjPtr vm, const char *reason, bool success)
}
void
virDomainAuditInit(virDomainObjPtr vm,
virDomainAuditInit(virDomainObj *vm,
pid_t initpid,
ino_t pidns)
{
@ -860,13 +860,13 @@ virDomainAuditInit(virDomainObjPtr vm,
}
void
virDomainAuditStop(virDomainObjPtr vm, const char *reason)
virDomainAuditStop(virDomainObj *vm, const char *reason)
{
virDomainAuditLifecycle(vm, "stop", reason, true);
}
void
virDomainAuditSecurityLabel(virDomainObjPtr vm, bool success)
virDomainAuditSecurityLabel(virDomainObj *vm, bool success)
{
char uuidstr[VIR_UUID_STRING_BUFLEN];
char *vmname;
@ -892,8 +892,8 @@ virDomainAuditSecurityLabel(virDomainObjPtr vm, bool success)
}
void
virDomainAuditShmem(virDomainObjPtr vm,
virDomainShmemDefPtr def,
virDomainAuditShmem(virDomainObj *vm,
virDomainShmemDef *def,
const char *reason, bool success)
{
char uuidstr[VIR_UUID_STRING_BUFLEN];
@ -935,8 +935,8 @@ virDomainAuditShmem(virDomainObjPtr vm,
void
virDomainAuditInput(virDomainObjPtr vm,
virDomainInputDefPtr input,
virDomainAuditInput(virDomainObj *vm,
virDomainInputDef *input,
const char *reason,
bool success)
{

View File

@ -24,54 +24,54 @@
#include "domain_conf.h"
#include "vircgroup.h"
void virDomainAuditStart(virDomainObjPtr vm,
void virDomainAuditStart(virDomainObj *vm,
const char *reason,
bool success)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
void virDomainAuditInit(virDomainObjPtr vm,
void virDomainAuditInit(virDomainObj *vm,
pid_t pid,
ino_t pidns)
ATTRIBUTE_NONNULL(1);
void virDomainAuditStop(virDomainObjPtr vm,
void virDomainAuditStop(virDomainObj *vm,
const char *reason)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
void virDomainAuditDisk(virDomainObjPtr vm,
virStorageSourcePtr oldDef,
virStorageSourcePtr newDef,
void virDomainAuditDisk(virDomainObj *vm,
virStorageSource *oldDef,
virStorageSource *newDef,
const char *reason,
bool success)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(4);
void virDomainAuditFS(virDomainObjPtr vm,
virDomainFSDefPtr oldDef,
virDomainFSDefPtr newDef,
void virDomainAuditFS(virDomainObj *vm,
virDomainFSDef *oldDef,
virDomainFSDef *newDef,
const char *reason,
bool success)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(4);
void virDomainAuditNet(virDomainObjPtr vm,
virDomainNetDefPtr oldDef,
virDomainNetDefPtr newDef,
void virDomainAuditNet(virDomainObj *vm,
virDomainNetDef *oldDef,
virDomainNetDef *newDef,
const char *reason,
bool success)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(4);
void virDomainAuditNetDevice(virDomainDefPtr vmDef,
virDomainNetDefPtr netDef,
void virDomainAuditNetDevice(virDomainDef *vmDef,
virDomainNetDef *netDef,
const char *device,
bool success)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3);
void virDomainAuditHostdev(virDomainObjPtr vm,
virDomainHostdevDefPtr def,
void virDomainAuditHostdev(virDomainObj *vm,
virDomainHostdevDef *def,
const char *reason,
bool success)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3);
void virDomainAuditCgroup(virDomainObjPtr vm,
virCgroupPtr group,
void virDomainAuditCgroup(virDomainObj *vm,
virCgroup *group,
const char *reason,
const char *extra,
bool success)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3)
ATTRIBUTE_NONNULL(4);
void virDomainAuditCgroupMajor(virDomainObjPtr vm,
virCgroupPtr group,
void virDomainAuditCgroupMajor(virDomainObj *vm,
virCgroup *group,
const char *reason,
int maj,
const char *name,
@ -79,59 +79,59 @@ void virDomainAuditCgroupMajor(virDomainObjPtr vm,
bool success)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3)
ATTRIBUTE_NONNULL(5) ATTRIBUTE_NONNULL(6);
void virDomainAuditCgroupPath(virDomainObjPtr vm,
virCgroupPtr group,
void virDomainAuditCgroupPath(virDomainObj *vm,
virCgroup *group,
const char *reason,
const char *path,
const char *perms,
int rc)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3)
ATTRIBUTE_NONNULL(4) ATTRIBUTE_NONNULL(5);
void virDomainAuditMemory(virDomainObjPtr vm,
void virDomainAuditMemory(virDomainObj *vm,
unsigned long long oldmem,
unsigned long long newmem,
const char *reason,
bool success)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(4);
void virDomainAuditVcpu(virDomainObjPtr vm,
void virDomainAuditVcpu(virDomainObj *vm,
unsigned int oldvcpu,
unsigned int newvcpu,
const char *reason,
bool success)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(4);
void virDomainAuditIOThread(virDomainObjPtr vm,
void virDomainAuditIOThread(virDomainObj *vm,
unsigned int oldiothread,
unsigned int newiothread,
const char *reason,
bool success)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(4);
void virDomainAuditSecurityLabel(virDomainObjPtr vm,
void virDomainAuditSecurityLabel(virDomainObj *vm,
bool success)
ATTRIBUTE_NONNULL(1);
void virDomainAuditRedirdev(virDomainObjPtr vm,
virDomainRedirdevDefPtr def,
void virDomainAuditRedirdev(virDomainObj *vm,
virDomainRedirdevDef *def,
const char *reason,
bool success)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3);
void virDomainAuditChardev(virDomainObjPtr vm,
virDomainChrDefPtr oldDef,
virDomainChrDefPtr newDef,
void virDomainAuditChardev(virDomainObj *vm,
virDomainChrDef *oldDef,
virDomainChrDef *newDef,
const char *reason,
bool success)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(4);
void virDomainAuditRNG(virDomainObjPtr vm,
virDomainRNGDefPtr oldDef,
virDomainRNGDefPtr newDef,
void virDomainAuditRNG(virDomainObj *vm,
virDomainRNGDef *oldDef,
virDomainRNGDef *newDef,
const char *reason,
bool success)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(4);
void virDomainAuditShmem(virDomainObjPtr vm,
virDomainShmemDefPtr def,
void virDomainAuditShmem(virDomainObj *vm,
virDomainShmemDef *def,
const char *reason, bool success)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3);
void virDomainAuditInput(virDomainObjPtr vm,
virDomainInputDefPtr input,
void virDomainAuditInput(virDomainObj *vm,
virDomainInputDef *input,
const char *reason,
bool success)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3);

View File

@ -44,8 +44,8 @@ VIR_ENUM_IMPL(virDomainCapsFeature,
"backup",
);
static virClassPtr virDomainCapsClass;
static virClassPtr virDomainCapsCPUModelsClass;
static virClass *virDomainCapsClass;
static virClass *virDomainCapsCPUModelsClass;
static void virDomainCapsDispose(void *obj);
static void virDomainCapsCPUModelsDispose(void *obj);
@ -80,8 +80,8 @@ virSEVCapabilitiesFree(virSEVCapability *cap)
static void
virDomainCapsDispose(void *obj)
{
virDomainCapsPtr caps = obj;
virDomainCapsStringValuesPtr values;
virDomainCaps *caps = obj;
virDomainCapsStringValues *values;
size_t i;
g_free(caps->path);
@ -100,7 +100,7 @@ virDomainCapsDispose(void *obj)
static void
virDomainCapsCPUModelsDispose(void *obj)
{
virDomainCapsCPUModelsPtr cpuModels = obj;
virDomainCapsCPUModels *cpuModels = obj;
size_t i;
for (i = 0; i < cpuModels->nmodels; i++) {
@ -112,13 +112,13 @@ virDomainCapsCPUModelsDispose(void *obj)
}
virDomainCapsPtr
virDomainCaps *
virDomainCapsNew(const char *path,
const char *machine,
virArch arch,
virDomainVirtType virttype)
{
virDomainCapsPtr caps = NULL;
virDomainCaps *caps = NULL;
if (virDomainCapsInitialize() < 0)
return NULL;
@ -135,10 +135,10 @@ virDomainCapsNew(const char *path,
}
virDomainCapsCPUModelsPtr
virDomainCapsCPUModels *
virDomainCapsCPUModelsNew(size_t nmodels)
{
virDomainCapsCPUModelsPtr cpuModels = NULL;
virDomainCapsCPUModels *cpuModels = NULL;
if (virDomainCapsInitialize() < 0)
return NULL;
@ -153,10 +153,10 @@ virDomainCapsCPUModelsNew(size_t nmodels)
}
virDomainCapsCPUModelsPtr
virDomainCapsCPUModelsCopy(virDomainCapsCPUModelsPtr old)
virDomainCapsCPUModels *
virDomainCapsCPUModelsCopy(virDomainCapsCPUModels *old)
{
virDomainCapsCPUModelsPtr cpuModels;
virDomainCapsCPUModels *cpuModels;
size_t i;
if (!(cpuModels = virDomainCapsCPUModelsNew(old->nmodels)))
@ -180,14 +180,14 @@ virDomainCapsCPUModelsCopy(virDomainCapsCPUModelsPtr old)
int
virDomainCapsCPUModelsAdd(virDomainCapsCPUModelsPtr cpuModels,
virDomainCapsCPUModelsAdd(virDomainCapsCPUModels *cpuModels,
const char *name,
virDomainCapsCPUUsable usable,
char **blockers,
bool deprecated)
{
g_autofree char * nameCopy = NULL;
virDomainCapsCPUModelPtr cpu;
virDomainCapsCPUModel *cpu;
nameCopy = g_strdup(name);
@ -206,8 +206,8 @@ virDomainCapsCPUModelsAdd(virDomainCapsCPUModelsPtr cpuModels,
}
virDomainCapsCPUModelPtr
virDomainCapsCPUModelsGet(virDomainCapsCPUModelsPtr cpuModels,
virDomainCapsCPUModel *
virDomainCapsCPUModelsGet(virDomainCapsCPUModels *cpuModels,
const char *name)
{
size_t i;
@ -225,7 +225,7 @@ virDomainCapsCPUModelsGet(virDomainCapsCPUModelsPtr cpuModels,
int
virDomainCapsEnumSet(virDomainCapsEnumPtr capsEnum,
virDomainCapsEnumSet(virDomainCapsEnum *capsEnum,
const char *capsEnumName,
size_t nvalues,
unsigned int *values)
@ -252,14 +252,14 @@ virDomainCapsEnumSet(virDomainCapsEnumPtr capsEnum,
void
virDomainCapsEnumClear(virDomainCapsEnumPtr capsEnum)
virDomainCapsEnumClear(virDomainCapsEnum *capsEnum)
{
capsEnum->values = 0;
}
static int
virDomainCapsEnumFormat(virBufferPtr buf,
virDomainCapsEnumFormat(virBuffer *buf,
const virDomainCapsEnum *capsEnum,
const char *capsEnumName,
virDomainCapsValToStr valToStr)
@ -294,7 +294,7 @@ virDomainCapsEnumFormat(virBufferPtr buf,
static void
virDomainCapsStringValuesFormat(virBufferPtr buf,
virDomainCapsStringValuesFormat(virBuffer *buf,
const virDomainCapsStringValues *values)
{
size_t i;
@ -330,7 +330,7 @@ virDomainCapsStringValuesFormat(virBufferPtr buf,
static void
qemuDomainCapsFeatureFormatSimple(virBufferPtr buf,
qemuDomainCapsFeatureFormatSimple(virBuffer *buf,
const char *featurename,
virTristateBool supported)
{
@ -343,7 +343,7 @@ qemuDomainCapsFeatureFormatSimple(virBufferPtr buf,
static void
virDomainCapsLoaderFormat(virBufferPtr buf,
virDomainCapsLoaderFormat(virBuffer *buf,
const virDomainCapsLoader *loader)
{
FORMAT_PROLOGUE(loader);
@ -357,7 +357,7 @@ virDomainCapsLoaderFormat(virBufferPtr buf,
}
static void
virDomainCapsOSFormat(virBufferPtr buf,
virDomainCapsOSFormat(virBuffer *buf,
const virDomainCapsOS *os)
{
const virDomainCapsLoader *loader = &os->loader;
@ -372,15 +372,15 @@ virDomainCapsOSFormat(virBufferPtr buf,
}
static void
virDomainCapsCPUCustomFormat(virBufferPtr buf,
virDomainCapsCPUModelsPtr custom)
virDomainCapsCPUCustomFormat(virBuffer *buf,
virDomainCapsCPUModels *custom)
{
size_t i;
virBufferAdjustIndent(buf, 2);
for (i = 0; i < custom->nmodels; i++) {
virDomainCapsCPUModelPtr model = custom->models + i;
virDomainCapsCPUModel *model = custom->models + i;
virBufferAsprintf(buf, "<model usable='%s'",
virDomainCapsCPUUsableTypeToString(model->usable));
if (model->deprecated)
@ -393,7 +393,7 @@ virDomainCapsCPUCustomFormat(virBufferPtr buf,
}
static void
virDomainCapsCPUFormat(virBufferPtr buf,
virDomainCapsCPUFormat(virBuffer *buf,
const virDomainCapsCPU *cpu)
{
virBufferAddLit(buf, "<cpu>\n");
@ -458,7 +458,7 @@ virDomainCapsCPUFormat(virBufferPtr buf,
}
static void
virDomainCapsDeviceDiskFormat(virBufferPtr buf,
virDomainCapsDeviceDiskFormat(virBuffer *buf,
const virDomainCapsDeviceDisk *disk)
{
FORMAT_PROLOGUE(disk);
@ -472,7 +472,7 @@ virDomainCapsDeviceDiskFormat(virBufferPtr buf,
static void
virDomainCapsDeviceGraphicsFormat(virBufferPtr buf,
virDomainCapsDeviceGraphicsFormat(virBuffer *buf,
const virDomainCapsDeviceGraphics *graphics)
{
FORMAT_PROLOGUE(graphics);
@ -484,7 +484,7 @@ virDomainCapsDeviceGraphicsFormat(virBufferPtr buf,
static void
virDomainCapsDeviceVideoFormat(virBufferPtr buf,
virDomainCapsDeviceVideoFormat(virBuffer *buf,
const virDomainCapsDeviceVideo *video)
{
FORMAT_PROLOGUE(video);
@ -496,7 +496,7 @@ virDomainCapsDeviceVideoFormat(virBufferPtr buf,
static void
virDomainCapsDeviceHostdevFormat(virBufferPtr buf,
virDomainCapsDeviceHostdevFormat(virBuffer *buf,
const virDomainCapsDeviceHostdev *hostdev)
{
FORMAT_PROLOGUE(hostdev);
@ -512,7 +512,7 @@ virDomainCapsDeviceHostdevFormat(virBufferPtr buf,
static void
virDomainCapsDeviceRNGFormat(virBufferPtr buf,
virDomainCapsDeviceRNGFormat(virBuffer *buf,
const virDomainCapsDeviceRNG *rng)
{
FORMAT_PROLOGUE(rng);
@ -541,7 +541,7 @@ virDomainCapsDeviceRNGFormat(virBufferPtr buf,
* </gic>
*/
static void
virDomainCapsFeatureGICFormat(virBufferPtr buf,
virDomainCapsFeatureGICFormat(virBuffer *buf,
const virDomainCapsFeatureGIC *gic)
{
FORMAT_PROLOGUE(gic);
@ -552,7 +552,7 @@ virDomainCapsFeatureGICFormat(virBufferPtr buf,
}
static void
virDomainCapsFeatureSEVFormat(virBufferPtr buf,
virDomainCapsFeatureSEVFormat(virBuffer *buf,
const virSEVCapability *sev)
{
if (!sev) {
@ -573,7 +573,7 @@ virDomainCapsFeatureSEVFormat(virBufferPtr buf,
static void
virDomainCapsFormatFeatures(const virDomainCaps *caps,
virBufferPtr buf)
virBuffer *buf)
{
g_auto(virBuffer) childBuf = VIR_BUFFER_INIT_CHILD(buf);
size_t i;

View File

@ -27,10 +27,8 @@
typedef const char * (*virDomainCapsValToStr)(int value);
typedef struct _virDomainCaps virDomainCaps;
typedef virDomainCaps *virDomainCapsPtr;
typedef struct _virDomainCapsEnum virDomainCapsEnum;
typedef virDomainCapsEnum *virDomainCapsEnumPtr;
struct _virDomainCapsEnum {
bool report; /* Whether the format the enum at all */
unsigned int values; /* Bitmask of values supported in the corresponding enum */
@ -40,7 +38,6 @@ struct _virDomainCapsEnum {
G_STATIC_ASSERT(last <= sizeof(unsigned int) * CHAR_BIT)
typedef struct _virDomainCapsStringValues virDomainCapsStringValues;
typedef virDomainCapsStringValues *virDomainCapsStringValuesPtr;
struct _virDomainCapsStringValues {
char **values; /* raw string values */
size_t nvalues; /* number of strings */
@ -49,7 +46,6 @@ struct _virDomainCapsStringValues {
STATIC_ASSERT_ENUM(VIR_DOMAIN_LOADER_TYPE_LAST);
STATIC_ASSERT_ENUM(VIR_TRISTATE_BOOL_LAST);
typedef struct _virDomainCapsLoader virDomainCapsLoader;
typedef virDomainCapsLoader *virDomainCapsLoaderPtr;
struct _virDomainCapsLoader {
virTristateBool supported;
virDomainCapsStringValues values; /* Info about values for the element */
@ -60,7 +56,6 @@ struct _virDomainCapsLoader {
STATIC_ASSERT_ENUM(VIR_DOMAIN_OS_DEF_FIRMWARE_LAST);
typedef struct _virDomainCapsOS virDomainCapsOS;
typedef virDomainCapsOS *virDomainCapsOSPtr;
struct _virDomainCapsOS {
virTristateBool supported;
virDomainCapsEnum firmware; /* Info about virDomainOsDefFirmware */
@ -71,7 +66,6 @@ STATIC_ASSERT_ENUM(VIR_DOMAIN_DISK_DEVICE_LAST);
STATIC_ASSERT_ENUM(VIR_DOMAIN_DISK_BUS_LAST);
STATIC_ASSERT_ENUM(VIR_DOMAIN_DISK_MODEL_LAST);
typedef struct _virDomainCapsDeviceDisk virDomainCapsDeviceDisk;
typedef virDomainCapsDeviceDisk *virDomainCapsDeviceDiskPtr;
struct _virDomainCapsDeviceDisk {
virTristateBool supported;
virDomainCapsEnum diskDevice; /* Info about virDomainDiskDevice enum values */
@ -82,7 +76,6 @@ struct _virDomainCapsDeviceDisk {
STATIC_ASSERT_ENUM(VIR_DOMAIN_GRAPHICS_TYPE_LAST);
typedef struct _virDomainCapsDeviceGraphics virDomainCapsDeviceGraphics;
typedef virDomainCapsDeviceGraphics *virDomainCapsDeviceGraphicsPtr;
struct _virDomainCapsDeviceGraphics {
virTristateBool supported;
virDomainCapsEnum type; /* virDomainGraphicsType */
@ -90,7 +83,6 @@ struct _virDomainCapsDeviceGraphics {
STATIC_ASSERT_ENUM(VIR_DOMAIN_VIDEO_TYPE_LAST);
typedef struct _virDomainCapsDeviceVideo virDomainCapsDeviceVideo;
typedef virDomainCapsDeviceVideo *virDomainCapsDeviceVideoPtr;
struct _virDomainCapsDeviceVideo {
virTristateBool supported;
virDomainCapsEnum modelType; /* virDomainVideoType */
@ -102,7 +94,6 @@ STATIC_ASSERT_ENUM(VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_LAST);
STATIC_ASSERT_ENUM(VIR_DOMAIN_HOSTDEV_CAPS_TYPE_LAST);
STATIC_ASSERT_ENUM(VIR_DOMAIN_HOSTDEV_PCI_BACKEND_TYPE_LAST);
typedef struct _virDomainCapsDeviceHostdev virDomainCapsDeviceHostdev;
typedef virDomainCapsDeviceHostdev *virDomainCapsDeviceHostdevPtr;
struct _virDomainCapsDeviceHostdev {
virTristateBool supported;
virDomainCapsEnum mode; /* Info about virDomainHostdevMode */
@ -116,7 +107,6 @@ struct _virDomainCapsDeviceHostdev {
STATIC_ASSERT_ENUM(VIR_DOMAIN_RNG_MODEL_LAST);
STATIC_ASSERT_ENUM(VIR_DOMAIN_RNG_BACKEND_LAST);
typedef struct _virDomainCapsDeviceRNG virDomainCapsDeviceRNG;
typedef virDomainCapsDeviceRNG *virDomainCapsDeviceRNGPtr;
struct _virDomainCapsDeviceRNG {
virTristateBool supported;
virDomainCapsEnum model; /* virDomainRNGModel */
@ -125,7 +115,6 @@ struct _virDomainCapsDeviceRNG {
STATIC_ASSERT_ENUM(VIR_GIC_VERSION_LAST);
typedef struct _virDomainCapsFeatureGIC virDomainCapsFeatureGIC;
typedef virDomainCapsFeatureGIC *virDomainCapsFeatureGICPtr;
struct _virDomainCapsFeatureGIC {
virTristateBool supported;
virDomainCapsEnum version; /* Info about virGICVersion */
@ -141,7 +130,6 @@ typedef enum {
VIR_ENUM_DECL(virDomainCapsCPUUsable);
typedef struct _virDomainCapsCPUModel virDomainCapsCPUModel;
typedef virDomainCapsCPUModel *virDomainCapsCPUModelPtr;
struct _virDomainCapsCPUModel {
char *name;
virDomainCapsCPUUsable usable;
@ -150,30 +138,27 @@ struct _virDomainCapsCPUModel {
};
typedef struct _virDomainCapsCPUModels virDomainCapsCPUModels;
typedef virDomainCapsCPUModels *virDomainCapsCPUModelsPtr;
struct _virDomainCapsCPUModels {
virObject parent;
size_t nmodels_max;
size_t nmodels;
virDomainCapsCPUModelPtr models;
virDomainCapsCPUModel *models;
};
G_DEFINE_AUTOPTR_CLEANUP_FUNC(virDomainCapsCPUModels, virObjectUnref);
typedef struct _virDomainCapsCPU virDomainCapsCPU;
typedef virDomainCapsCPU *virDomainCapsCPUPtr;
struct _virDomainCapsCPU {
bool hostPassthrough;
virDomainCapsEnum hostPassthroughMigratable;
bool maximum;
virDomainCapsEnum maximumMigratable;
virCPUDefPtr hostModel;
virDomainCapsCPUModelsPtr custom;
virCPUDef *hostModel;
virDomainCapsCPUModels *custom;
};
typedef struct _virSEVCapability virSEVCapability;
typedef virSEVCapability *virSEVCapabilityPtr;
struct _virSEVCapability {
char *pdh;
char *cert_chain;
@ -212,7 +197,7 @@ struct _virDomainCaps {
/* add new domain devices here */
virDomainCapsFeatureGIC gic;
virSEVCapabilityPtr sev;
virSEVCapability *sev;
/* add new domain features here */
virTristateBool features[VIR_DOMAIN_CAPS_FEATURE_LAST];
@ -221,20 +206,20 @@ struct _virDomainCaps {
G_DEFINE_AUTOPTR_CLEANUP_FUNC(virDomainCaps, virObjectUnref);
virDomainCapsPtr virDomainCapsNew(const char *path,
virDomainCaps *virDomainCapsNew(const char *path,
const char *machine,
virArch arch,
virDomainVirtType virttype);
virDomainCapsCPUModelsPtr virDomainCapsCPUModelsNew(size_t nmodels);
virDomainCapsCPUModelsPtr virDomainCapsCPUModelsCopy(virDomainCapsCPUModelsPtr old);
int virDomainCapsCPUModelsAdd(virDomainCapsCPUModelsPtr cpuModels,
virDomainCapsCPUModels *virDomainCapsCPUModelsNew(size_t nmodels);
virDomainCapsCPUModels *virDomainCapsCPUModelsCopy(virDomainCapsCPUModels *old);
int virDomainCapsCPUModelsAdd(virDomainCapsCPUModels *cpuModels,
const char *name,
virDomainCapsCPUUsable usable,
char **blockers,
bool deprecated);
virDomainCapsCPUModelPtr
virDomainCapsCPUModelsGet(virDomainCapsCPUModelsPtr cpuModels,
virDomainCapsCPUModel *
virDomainCapsCPUModelsGet(virDomainCapsCPUModels *cpuModels,
const char *name);
#define VIR_DOMAIN_CAPS_ENUM_IS_SET(capsEnum, value) \
@ -249,11 +234,11 @@ virDomainCapsCPUModelsGet(virDomainCapsCPUModelsPtr cpuModels,
} while (0)
int virDomainCapsEnumSet(virDomainCapsEnumPtr capsEnum,
int virDomainCapsEnumSet(virDomainCapsEnum *capsEnum,
const char *capsEnumName,
size_t nvalues,
unsigned int *values);
void virDomainCapsEnumClear(virDomainCapsEnumPtr capsEnum);
void virDomainCapsEnumClear(virDomainCapsEnum *capsEnum);
char * virDomainCapsFormat(const virDomainCaps *caps);

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -27,241 +27,241 @@
#include "domain_conf.h"
virObjectEventPtr
virObjectEvent *
virDomainEventLifecycleNew(int id,
const char *name,
const unsigned char *uuid,
int type,
int detail);
virObjectEventPtr
virObjectEvent *
virDomainEventLifecycleNewFromDom(virDomainPtr dom,
int type,
int detail);
virObjectEventPtr
virDomainEventLifecycleNewFromObj(virDomainObjPtr obj,
virObjectEvent *
virDomainEventLifecycleNewFromObj(virDomainObj *obj,
int type,
int detail);
virObjectEventPtr
virDomainEventLifecycleNewFromDef(virDomainDefPtr def,
virObjectEvent *
virDomainEventLifecycleNewFromDef(virDomainDef *def,
int type,
int detail);
virObjectEventPtr
virObjectEvent *
virDomainEventRebootNew(int id,
const char *name,
const unsigned char *uuid);
virObjectEventPtr
virObjectEvent *
virDomainEventRebootNewFromDom(virDomainPtr dom);
virObjectEventPtr
virDomainEventRebootNewFromObj(virDomainObjPtr obj);
virObjectEvent *
virDomainEventRebootNewFromObj(virDomainObj *obj);
virObjectEventPtr
virObjectEvent *
virDomainEventRTCChangeNewFromDom(virDomainPtr dom,
long long offset);
virObjectEventPtr
virDomainEventRTCChangeNewFromObj(virDomainObjPtr obj,
virObjectEvent *
virDomainEventRTCChangeNewFromObj(virDomainObj *obj,
long long offset);
virObjectEventPtr
virObjectEvent *
virDomainEventWatchdogNewFromDom(virDomainPtr dom,
int action);
virObjectEventPtr
virDomainEventWatchdogNewFromObj(virDomainObjPtr obj,
virObjectEvent *
virDomainEventWatchdogNewFromObj(virDomainObj *obj,
int action);
virObjectEventPtr
virObjectEvent *
virDomainEventIOErrorNewFromDom(virDomainPtr dom,
const char *srcPath,
const char *devAlias,
int action);
virObjectEventPtr
virDomainEventIOErrorNewFromObj(virDomainObjPtr obj,
virObjectEvent *
virDomainEventIOErrorNewFromObj(virDomainObj *obj,
const char *srcPath,
const char *devAlias,
int action);
virObjectEventPtr
virObjectEvent *
virDomainEventIOErrorReasonNewFromDom(virDomainPtr dom,
const char *srcPath,
const char *devAlias,
int action,
const char *reason);
virObjectEventPtr
virDomainEventIOErrorReasonNewFromObj(virDomainObjPtr obj,
virObjectEvent *
virDomainEventIOErrorReasonNewFromObj(virDomainObj *obj,
const char *srcPath,
const char *devAlias,
int action,
const char *reason);
virObjectEventPtr
virObjectEvent *
virDomainEventGraphicsNewFromDom(virDomainPtr dom,
int phase,
virDomainEventGraphicsAddressPtr local,
virDomainEventGraphicsAddressPtr remote,
const char *authScheme,
virDomainEventGraphicsSubjectPtr subject);
virObjectEventPtr
virDomainEventGraphicsNewFromObj(virDomainObjPtr obj,
virObjectEvent *
virDomainEventGraphicsNewFromObj(virDomainObj *obj,
int phase,
virDomainEventGraphicsAddressPtr local,
virDomainEventGraphicsAddressPtr remote,
const char *authScheme,
virDomainEventGraphicsSubjectPtr subject);
virObjectEventPtr
virObjectEvent *
virDomainEventControlErrorNewFromDom(virDomainPtr dom);
virObjectEventPtr
virDomainEventControlErrorNewFromObj(virDomainObjPtr obj);
virObjectEvent *
virDomainEventControlErrorNewFromObj(virDomainObj *obj);
virObjectEventPtr
virDomainEventBlockJobNewFromObj(virDomainObjPtr obj,
virObjectEvent *
virDomainEventBlockJobNewFromObj(virDomainObj *obj,
const char *path,
int type,
int status);
virObjectEventPtr
virObjectEvent *
virDomainEventBlockJobNewFromDom(virDomainPtr dom,
const char *path,
int type,
int status);
virObjectEventPtr
virDomainEventBlockJob2NewFromObj(virDomainObjPtr obj,
virObjectEvent *
virDomainEventBlockJob2NewFromObj(virDomainObj *obj,
const char *dst,
int type,
int status);
virObjectEventPtr
virObjectEvent *
virDomainEventBlockJob2NewFromDom(virDomainPtr dom,
const char *dst,
int type,
int status);
virObjectEventPtr
virDomainEventDiskChangeNewFromObj(virDomainObjPtr obj,
virObjectEvent *
virDomainEventDiskChangeNewFromObj(virDomainObj *obj,
const char *oldSrcPath,
const char *newSrcPath,
const char *devAlias,
int reason);
virObjectEventPtr
virObjectEvent *
virDomainEventDiskChangeNewFromDom(virDomainPtr dom,
const char *oldSrcPath,
const char *newSrcPath,
const char *devAlias,
int reason);
virObjectEventPtr
virDomainEventTrayChangeNewFromObj(virDomainObjPtr obj,
virObjectEvent *
virDomainEventTrayChangeNewFromObj(virDomainObj *obj,
const char *devAlias,
int reason);
virObjectEventPtr
virObjectEvent *
virDomainEventTrayChangeNewFromDom(virDomainPtr dom,
const char *devAlias,
int reason);
virObjectEventPtr
virDomainEventPMWakeupNewFromObj(virDomainObjPtr obj);
virObjectEventPtr
virObjectEvent *
virDomainEventPMWakeupNewFromObj(virDomainObj *obj);
virObjectEvent *
virDomainEventPMWakeupNewFromDom(virDomainPtr dom, int reason);
virObjectEventPtr
virDomainEventPMSuspendNewFromObj(virDomainObjPtr obj);
virObjectEventPtr
virObjectEvent *
virDomainEventPMSuspendNewFromObj(virDomainObj *obj);
virObjectEvent *
virDomainEventPMSuspendNewFromDom(virDomainPtr dom, int reason);
virObjectEventPtr
virObjectEvent *
virDomainEventBalloonChangeNewFromDom(virDomainPtr dom,
unsigned long long actual);
virObjectEventPtr
virDomainEventBalloonChangeNewFromObj(virDomainObjPtr obj,
virObjectEvent *
virDomainEventBalloonChangeNewFromObj(virDomainObj *obj,
unsigned long long actual);
virObjectEventPtr
virDomainEventPMSuspendDiskNewFromObj(virDomainObjPtr obj);
virObjectEventPtr
virObjectEvent *
virDomainEventPMSuspendDiskNewFromObj(virDomainObj *obj);
virObjectEvent *
virDomainEventPMSuspendDiskNewFromDom(virDomainPtr dom, int reason);
virObjectEventPtr
virDomainEventDeviceRemovedNewFromObj(virDomainObjPtr obj,
virObjectEvent *
virDomainEventDeviceRemovedNewFromObj(virDomainObj *obj,
const char *devAlias);
virObjectEventPtr
virObjectEvent *
virDomainEventDeviceRemovedNewFromDom(virDomainPtr dom,
const char *devAlias);
virObjectEventPtr
virDomainEventDeviceAddedNewFromObj(virDomainObjPtr obj,
virObjectEvent *
virDomainEventDeviceAddedNewFromObj(virDomainObj *obj,
const char *devAlias);
virObjectEventPtr
virObjectEvent *
virDomainEventDeviceAddedNewFromDom(virDomainPtr dom,
const char *devAlias);
virObjectEventPtr
virDomainEventDeviceRemovalFailedNewFromObj(virDomainObjPtr obj,
virObjectEvent *
virDomainEventDeviceRemovalFailedNewFromObj(virDomainObj *obj,
const char *devAlias);
virObjectEventPtr
virObjectEvent *
virDomainEventDeviceRemovalFailedNewFromDom(virDomainPtr dom,
const char *devAlias);
virObjectEventPtr
virDomainEventTunableNewFromObj(virDomainObjPtr obj,
virObjectEvent *
virDomainEventTunableNewFromObj(virDomainObj *obj,
virTypedParameterPtr params,
int nparams);
virObjectEventPtr
virObjectEvent *
virDomainEventTunableNewFromDom(virDomainPtr dom,
virTypedParameterPtr params,
int nparams);
virObjectEventPtr
virDomainEventAgentLifecycleNewFromObj(virDomainObjPtr obj,
virObjectEvent *
virDomainEventAgentLifecycleNewFromObj(virDomainObj *obj,
int state,
int reason);
virObjectEventPtr
virObjectEvent *
virDomainEventAgentLifecycleNewFromDom(virDomainPtr dom,
int state,
int reason);
virObjectEventPtr
virDomainEventMigrationIterationNewFromObj(virDomainObjPtr obj,
virObjectEvent *
virDomainEventMigrationIterationNewFromObj(virDomainObj *obj,
int iteration);
virObjectEventPtr
virObjectEvent *
virDomainEventMigrationIterationNewFromDom(virDomainPtr dom,
int iteration);
virObjectEventPtr
virDomainEventJobCompletedNewFromObj(virDomainObjPtr obj,
virObjectEvent *
virDomainEventJobCompletedNewFromObj(virDomainObj *obj,
virTypedParameterPtr params,
int nparams);
virObjectEventPtr
virObjectEvent *
virDomainEventJobCompletedNewFromDom(virDomainPtr dom,
virTypedParameterPtr params,
int nparams);
virObjectEventPtr
virDomainEventMetadataChangeNewFromObj(virDomainObjPtr obj,
virObjectEvent *
virDomainEventMetadataChangeNewFromObj(virDomainObj *obj,
int type,
const char *nsuri);
virObjectEventPtr
virObjectEvent *
virDomainEventMetadataChangeNewFromDom(virDomainPtr dom,
int type,
const char *nsuri);
virObjectEventPtr
virDomainEventBlockThresholdNewFromObj(virDomainObjPtr obj,
virObjectEvent *
virDomainEventBlockThresholdNewFromObj(virDomainObj *obj,
const char *dev,
const char *path,
unsigned long long threshold,
unsigned long long excess);
virObjectEventPtr
virObjectEvent *
virDomainEventBlockThresholdNewFromDom(virDomainPtr dom,
const char *dev,
const char *path,
unsigned long long threshold,
unsigned long long excess);
virObjectEventPtr
virDomainEventMemoryFailureNewFromObj(virDomainObjPtr obj,
virObjectEvent *
virDomainEventMemoryFailureNewFromObj(virDomainObj *obj,
int recipient,
int action,
unsigned int flags);
virObjectEventPtr
virObjectEvent *
virDomainEventMemoryFailureNewFromDom(virDomainPtr dom,
int recipient,
int action,
@ -269,14 +269,14 @@ virDomainEventMemoryFailureNewFromDom(virDomainPtr dom,
int
virDomainEventStateRegister(virConnectPtr conn,
virObjectEventStatePtr state,
virObjectEventState *state,
virConnectDomainEventCallback callback,
void *opaque,
virFreeCallback freecb)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3);
int
virDomainEventStateRegisterID(virConnectPtr conn,
virObjectEventStatePtr state,
virObjectEventState *state,
virDomainPtr dom,
int eventID,
virConnectDomainEventGenericCallback cb,
@ -286,7 +286,7 @@ virDomainEventStateRegisterID(virConnectPtr conn,
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(5);
int
virDomainEventStateRegisterClient(virConnectPtr conn,
virObjectEventStatePtr state,
virObjectEventState *state,
virDomainPtr dom,
int eventID,
virConnectDomainEventGenericCallback cb,
@ -300,7 +300,7 @@ virDomainEventStateRegisterClient(virConnectPtr conn,
int
virDomainEventStateCallbackID(virConnectPtr conn,
virObjectEventStatePtr state,
virObjectEventState *state,
virConnectDomainEventCallback callback,
int *remoteID)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3)
@ -308,13 +308,13 @@ virDomainEventStateCallbackID(virConnectPtr conn,
int
virDomainEventStateDeregister(virConnectPtr conn,
virObjectEventStatePtr state,
virObjectEventState *state,
virConnectDomainEventCallback callback)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3);
int
virDomainQemuMonitorEventStateRegisterID(virConnectPtr conn,
virObjectEventStatePtr state,
virObjectEventState *state,
virDomainPtr dom,
const char *event,
virConnectDomainQemuMonitorEventCallback cb,
@ -325,7 +325,7 @@ virDomainQemuMonitorEventStateRegisterID(virConnectPtr conn,
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(5)
ATTRIBUTE_NONNULL(9);
virObjectEventPtr
virObjectEvent *
virDomainQemuMonitorEventNew(int id,
const char *name,
const unsigned char *uuid,

View File

@ -37,12 +37,12 @@ VIR_LOG_INIT("conf.domain_nwfilter");
#define VIR_FROM_THIS VIR_FROM_NWFILTER
static virNWFilterBindingDefPtr
static virNWFilterBindingDef *
virNWFilterBindingDefForNet(const char *vmname,
const unsigned char *vmuuid,
virDomainNetDefPtr net)
virDomainNetDef *net)
{
virNWFilterBindingDefPtr ret;
virNWFilterBindingDef *ret;
ret = g_new0(virNWFilterBindingDef, 1);
@ -77,11 +77,11 @@ virNWFilterBindingDefForNet(const char *vmname,
int
virDomainConfNWFilterInstantiate(const char *vmname,
const unsigned char *vmuuid,
virDomainNetDefPtr net,
virDomainNetDef *net,
bool ignoreExists)
{
virConnectPtr conn = virGetConnectNWFilter();
virNWFilterBindingDefPtr def = NULL;
virNWFilterBindingDef *def = NULL;
virNWFilterBindingPtr binding = NULL;
char *xml = NULL;
int ret = -1;
@ -122,7 +122,7 @@ virDomainConfNWFilterInstantiate(const char *vmname,
static void
virDomainConfNWFilterTeardownImpl(virConnectPtr conn,
virDomainNetDefPtr net)
virDomainNetDef *net)
{
virNWFilterBindingPtr binding;
@ -140,7 +140,7 @@ virDomainConfNWFilterTeardownImpl(virConnectPtr conn,
void
virDomainConfNWFilterTeardown(virDomainNetDefPtr net)
virDomainConfNWFilterTeardown(virDomainNetDef *net)
{
virConnectPtr conn;
@ -156,13 +156,13 @@ virDomainConfNWFilterTeardown(virDomainNetDefPtr net)
}
void
virDomainConfVMNWFilterTeardown(virDomainObjPtr vm)
virDomainConfVMNWFilterTeardown(virDomainObj *vm)
{
size_t i;
virConnectPtr conn = NULL;
for (i = 0; i < vm->def->nnets; i++) {
virDomainNetDefPtr net = vm->def->nets[i];
virDomainNetDef *net = vm->def->nets[i];
if (!net->filter)
continue;

View File

@ -23,7 +23,7 @@
int virDomainConfNWFilterInstantiate(const char *vmname,
const unsigned char *vmuuid,
virDomainNetDefPtr net,
virDomainNetDef *net,
bool ignoreExists);
void virDomainConfNWFilterTeardown(virDomainNetDefPtr net);
void virDomainConfVMNWFilterTeardown(virDomainObjPtr vm);
void virDomainConfNWFilterTeardown(virDomainNetDef *net);
void virDomainConfVMNWFilterTeardown(virDomainObj *vm);

View File

@ -79,7 +79,7 @@ virDomainDefVideoValidate(const virDomainDef *def)
static int
virDomainCheckVirtioOptionsAreAbsent(virDomainVirtioOptionsPtr virtio)
virDomainCheckVirtioOptionsAreAbsent(virDomainVirtioOptions *virtio)
{
if (!virtio)
return 0;
@ -238,12 +238,12 @@ virDomainDiskAddressDiskBusCompatibility(virDomainDiskBus bus,
static int
virSecurityDeviceLabelDefValidate(virSecurityDeviceLabelDefPtr *seclabels,
virSecurityDeviceLabelDefValidate(virSecurityDeviceLabelDef **seclabels,
size_t nseclabels,
virSecurityLabelDefPtr *vmSeclabels,
virSecurityLabelDef **vmSeclabels,
size_t nvmSeclabels)
{
virSecurityDeviceLabelDefPtr seclabel;
virSecurityDeviceLabelDef *seclabel;
size_t i;
size_t j;
@ -437,7 +437,7 @@ static int
virDomainDiskDefValidate(const virDomainDef *def,
const virDomainDiskDef *disk)
{
virStorageSourcePtr next;
virStorageSource *next;
/* Validate LUN configuration */
if (disk->device == VIR_DOMAIN_DISK_DEVICE_LUN) {
@ -884,15 +884,15 @@ virDomainDefDuplicateDriveAddressesValidate(const virDomainDef *def)
size_t j;
for (i = 0; i < def->ndisks; i++) {
virDomainDiskDefPtr disk_i = def->disks[i];
virDomainDeviceInfoPtr disk_info_i = &disk_i->info;
virDomainDiskDef *disk_i = def->disks[i];
virDomainDeviceInfo *disk_info_i = &disk_i->info;
if (disk_info_i->type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_DRIVE)
continue;
for (j = i + 1; j < def->ndisks; j++) {
virDomainDiskDefPtr disk_j = def->disks[j];
virDomainDeviceInfoPtr disk_info_j = &disk_j->info;
virDomainDiskDef *disk_j = def->disks[j];
virDomainDeviceInfo *disk_info_j = &disk_j->info;
if (disk_i->bus != disk_j->bus)
continue;
@ -921,9 +921,9 @@ virDomainDefDuplicateDriveAddressesValidate(const virDomainDef *def)
}
for (i = 0; i < def->nhostdevs; i++) {
virDomainHostdevDefPtr hdev_i = def->hostdevs[i];
virDomainDeviceInfoPtr hdev_info_i = hdev_i->info;
virDomainDeviceDriveAddressPtr hdev_addr_i;
virDomainHostdevDef *hdev_i = def->hostdevs[i];
virDomainDeviceInfo *hdev_info_i = hdev_i->info;
virDomainDeviceDriveAddress *hdev_addr_i;
if (!virHostdevIsSCSIDevice(hdev_i))
continue;
@ -933,8 +933,8 @@ virDomainDefDuplicateDriveAddressesValidate(const virDomainDef *def)
hdev_addr_i = &hdev_info_i->addr.drive;
for (j = i + 1; j < def->nhostdevs; j++) {
virDomainHostdevDefPtr hdev_j = def->hostdevs[j];
virDomainDeviceInfoPtr hdev_info_j = hdev_j->info;
virDomainHostdevDef *hdev_j = def->hostdevs[j];
virDomainDeviceInfo *hdev_info_j = hdev_j->info;
if (!virHostdevIsSCSIDevice(hdev_j))
continue;
@ -980,9 +980,9 @@ struct virDomainDefValidateAliasesData {
static int
virDomainDeviceDefValidateAliasesIterator(virDomainDefPtr def,
virDomainDeviceDefPtr dev,
virDomainDeviceInfoPtr info,
virDomainDeviceDefValidateAliasesIterator(virDomainDef *def,
virDomainDeviceDef *dev,
virDomainDeviceInfo *info,
void *opaque)
{
struct virDomainDefValidateAliasesData *data = opaque;
@ -1043,7 +1043,7 @@ virDomainDefValidateAliases(const virDomainDef *def,
if (!(data.aliases = virHashNew(NULL)))
goto cleanup;
if (virDomainDeviceInfoIterateFlags((virDomainDefPtr) def,
if (virDomainDeviceInfoIterateFlags((virDomainDef *) def,
virDomainDeviceDefValidateAliasesIterator,
DOMAIN_DEVICE_ITERATE_ALL_CONSOLES,
&data) < 0)
@ -1061,10 +1061,10 @@ virDomainDefValidateAliases(const virDomainDef *def,
static int
virDomainDeviceValidateAliasImpl(const virDomainDef *def,
virDomainDeviceDefPtr dev)
virDomainDeviceDef *dev)
{
GHashTable *aliases = NULL;
virDomainDeviceInfoPtr info = virDomainDeviceGetInfo(dev);
virDomainDeviceInfo *info = virDomainDeviceGetInfo(dev);
int ret = -1;
if (!info || !info->alias)
@ -1089,12 +1089,12 @@ virDomainDeviceValidateAliasImpl(const virDomainDef *def,
int
virDomainDeviceValidateAliasForHotplug(virDomainObjPtr vm,
virDomainDeviceDefPtr dev,
virDomainDeviceValidateAliasForHotplug(virDomainObj *vm,
virDomainDeviceDef *dev,
unsigned int flags)
{
virDomainDefPtr persDef = NULL;
virDomainDefPtr liveDef = NULL;
virDomainDef *persDef = NULL;
virDomainDef *liveDef = NULL;
if (virDomainObjGetDefs(vm, flags, &liveDef, &persDef) < 0)
return -1;
@ -1187,7 +1187,7 @@ virDomainDefMemtuneValidate(const virDomainDef *def)
static int
virDomainDefOSValidate(const virDomainDef *def,
virDomainXMLOptionPtr xmlopt)
virDomainXMLOption *xmlopt)
{
if (!def->os.loader)
return 0;
@ -1294,7 +1294,7 @@ virDomainDefIOMMUValidate(const virDomainDef *def)
static int
virDomainDefValidateInternal(const virDomainDef *def,
virDomainXMLOptionPtr xmlopt)
virDomainXMLOption *xmlopt)
{
if (virDomainDefDuplicateDiskInfoValidate(def) < 0)
return -1;
@ -1343,9 +1343,9 @@ virDomainDefValidateInternal(const virDomainDef *def,
static int
virDomainDefValidateDeviceIterator(virDomainDefPtr def,
virDomainDeviceDefPtr dev,
virDomainDeviceInfoPtr info G_GNUC_UNUSED,
virDomainDefValidateDeviceIterator(virDomainDef *def,
virDomainDeviceDef *dev,
virDomainDeviceInfo *info G_GNUC_UNUSED,
void *opaque)
{
struct virDomainDefPostParseDeviceIteratorData *data = opaque;
@ -1372,9 +1372,9 @@ virDomainDefValidateDeviceIterator(virDomainDefPtr def,
* appropriate message.
*/
int
virDomainDefValidate(virDomainDefPtr def,
virDomainDefValidate(virDomainDef *def,
unsigned int parseFlags,
virDomainXMLOptionPtr xmlopt,
virDomainXMLOption *xmlopt,
void *parseOpaque)
{
struct virDomainDefPostParseDeviceIteratorData data = {
@ -1939,7 +1939,7 @@ int
virDomainDeviceDefValidate(const virDomainDeviceDef *dev,
const virDomainDef *def,
unsigned int parseFlags,
virDomainXMLOptionPtr xmlopt,
virDomainXMLOption *xmlopt,
void *parseOpaque)
{
/* validate configuration only in certain places */

View File

@ -25,16 +25,16 @@
#include "domain_conf.h"
#include "virconftypes.h"
int virDomainDeviceValidateAliasForHotplug(virDomainObjPtr vm,
virDomainDeviceDefPtr dev,
int virDomainDeviceValidateAliasForHotplug(virDomainObj *vm,
virDomainDeviceDef *dev,
unsigned int flags);
int virDomainDefValidate(virDomainDefPtr def,
int virDomainDefValidate(virDomainDef *def,
unsigned int parseFlags,
virDomainXMLOptionPtr xmlopt,
virDomainXMLOption *xmlopt,
void *parseOpaque);
int virDomainActualNetDefValidate(const virDomainNetDef *net);
int virDomainDeviceDefValidate(const virDomainDeviceDef *dev,
const virDomainDef *def,
unsigned int parseFlags,
virDomainXMLOptionPtr xmlopt,
virDomainXMLOption *xmlopt,
void *parseOpaque);

View File

@ -37,15 +37,15 @@ VIR_ENUM_IMPL(virInterface,
"ethernet", "bridge", "bond", "vlan",
);
static virInterfaceDefPtr
static virInterfaceDef *
virInterfaceDefParseXML(xmlXPathContextPtr ctxt, int parentIfType);
static int
virInterfaceDefDevFormat(virBufferPtr buf, const virInterfaceDef *def,
virInterfaceDefDevFormat(virBuffer *buf, const virInterfaceDef *def,
virInterfaceType parentIfType);
static void
virInterfaceIPDefFree(virInterfaceIPDefPtr def)
virInterfaceIPDefFree(virInterfaceIPDef *def)
{
if (def == NULL)
return;
@ -55,7 +55,7 @@ virInterfaceIPDefFree(virInterfaceIPDefPtr def)
static void
virInterfaceProtocolDefFree(virInterfaceProtocolDefPtr def)
virInterfaceProtocolDefFree(virInterfaceProtocolDef *def)
{
size_t i;
@ -71,7 +71,7 @@ virInterfaceProtocolDefFree(virInterfaceProtocolDefPtr def)
void
virInterfaceDefFree(virInterfaceDefPtr def)
virInterfaceDefFree(virInterfaceDef *def)
{
size_t i;
int pp;
@ -116,7 +116,7 @@ virInterfaceDefFree(virInterfaceDefPtr def)
static int
virInterfaceDefParseName(virInterfaceDefPtr def,
virInterfaceDefParseName(virInterfaceDef *def,
xmlXPathContextPtr ctxt)
{
char *tmp;
@ -133,7 +133,7 @@ virInterfaceDefParseName(virInterfaceDefPtr def,
static int
virInterfaceDefParseMtu(virInterfaceDefPtr def,
virInterfaceDefParseMtu(virInterfaceDef *def,
xmlXPathContextPtr ctxt)
{
unsigned long mtu;
@ -152,7 +152,7 @@ virInterfaceDefParseMtu(virInterfaceDefPtr def,
static int
virInterfaceDefParseStartMode(virInterfaceDefPtr def,
virInterfaceDefParseStartMode(virInterfaceDef *def,
xmlXPathContextPtr ctxt)
{
char *tmp;
@ -259,7 +259,7 @@ virInterfaceDefParseBondArpValid(xmlXPathContextPtr ctxt)
static int
virInterfaceDefParseDhcp(virInterfaceProtocolDefPtr def,
virInterfaceDefParseDhcp(virInterfaceProtocolDef *def,
xmlNodePtr dhcp, xmlXPathContextPtr ctxt)
{
VIR_XPATH_NODE_AUTORESTORE(ctxt)
@ -288,7 +288,7 @@ virInterfaceDefParseDhcp(virInterfaceProtocolDefPtr def,
static int
virInterfaceDefParseIP(virInterfaceIPDefPtr def,
virInterfaceDefParseIP(virInterfaceIPDef *def,
xmlXPathContextPtr ctxt)
{
int ret = 0;
@ -313,7 +313,7 @@ virInterfaceDefParseIP(virInterfaceIPDefPtr def,
static int
virInterfaceDefParseProtoIPv4(virInterfaceProtocolDefPtr def,
virInterfaceDefParseProtoIPv4(virInterfaceProtocolDef *def,
xmlXPathContextPtr ctxt)
{
xmlNodePtr dhcp;
@ -337,12 +337,12 @@ virInterfaceDefParseProtoIPv4(virInterfaceProtocolDefPtr def,
if (ipNodes == NULL)
return 0;
def->ips = g_new0(virInterfaceIPDefPtr, nipNodes);
def->ips = g_new0(virInterfaceIPDef *, nipNodes);
def->nips = 0;
for (i = 0; i < nipNodes; i++) {
virInterfaceIPDefPtr ip;
virInterfaceIPDef *ip;
ip = g_new0(virInterfaceIPDef, 1);
@ -363,7 +363,7 @@ virInterfaceDefParseProtoIPv4(virInterfaceProtocolDefPtr def,
static int
virInterfaceDefParseProtoIPv6(virInterfaceProtocolDefPtr def,
virInterfaceDefParseProtoIPv6(virInterfaceProtocolDef *def,
xmlXPathContextPtr ctxt)
{
xmlNodePtr dhcp, autoconf;
@ -391,12 +391,12 @@ virInterfaceDefParseProtoIPv6(virInterfaceProtocolDefPtr def,
if (ipNodes == NULL)
return 0;
def->ips = g_new0(virInterfaceIPDefPtr, nipNodes);
def->ips = g_new0(virInterfaceIPDef *, nipNodes);
def->nips = 0;
for (i = 0; i < nipNodes; i++) {
virInterfaceIPDefPtr ip;
virInterfaceIPDef *ip;
ip = g_new0(virInterfaceIPDef, 1);
@ -417,7 +417,7 @@ virInterfaceDefParseProtoIPv6(virInterfaceProtocolDefPtr def,
static int
virInterfaceDefParseIfAdressing(virInterfaceDefPtr def,
virInterfaceDefParseIfAdressing(virInterfaceDef *def,
xmlXPathContextPtr ctxt)
{
VIR_XPATH_NODE_AUTORESTORE(ctxt)
@ -434,12 +434,12 @@ virInterfaceDefParseIfAdressing(virInterfaceDefPtr def,
return 0;
}
def->protos = g_new0(virInterfaceProtocolDefPtr, nProtoNodes);
def->protos = g_new0(virInterfaceProtocolDef *, nProtoNodes);
def->nprotos = 0;
for (pp = 0; pp < nProtoNodes; pp++) {
virInterfaceProtocolDefPtr proto;
virInterfaceProtocolDef *proto;
proto = g_new0(virInterfaceProtocolDef, 1);
@ -483,12 +483,12 @@ virInterfaceDefParseIfAdressing(virInterfaceDefPtr def,
static int
virInterfaceDefParseBridge(virInterfaceDefPtr def,
virInterfaceDefParseBridge(virInterfaceDef *def,
xmlXPathContextPtr ctxt)
{
xmlNodePtr *interfaces = NULL;
xmlNodePtr bridge;
virInterfaceDefPtr itf;
virInterfaceDef *itf;
char *tmp = NULL;
int nbItf;
size_t i;
@ -540,12 +540,12 @@ virInterfaceDefParseBridge(virInterfaceDefPtr def,
static int
virInterfaceDefParseBondItfs(virInterfaceDefPtr def,
virInterfaceDefParseBondItfs(virInterfaceDef *def,
xmlXPathContextPtr ctxt)
{
xmlNodePtr *interfaces = NULL;
VIR_XPATH_NODE_AUTORESTORE(ctxt)
virInterfaceDefPtr itf;
virInterfaceDef *itf;
int nbItf;
size_t i;
int ret = -1;
@ -581,7 +581,7 @@ virInterfaceDefParseBondItfs(virInterfaceDefPtr def,
static int
virInterfaceDefParseBond(virInterfaceDefPtr def,
virInterfaceDefParseBond(virInterfaceDef *def,
xmlXPathContextPtr ctxt)
{
int res;
@ -654,7 +654,7 @@ virInterfaceDefParseBond(virInterfaceDefPtr def,
static int
virInterfaceDefParseVlan(virInterfaceDefPtr def,
virInterfaceDefParseVlan(virInterfaceDef *def,
xmlXPathContextPtr ctxt)
{
def->data.vlan.tag = virXPathString("string(./@tag)", ctxt);
@ -675,11 +675,11 @@ virInterfaceDefParseVlan(virInterfaceDefPtr def,
}
static virInterfaceDefPtr
static virInterfaceDef *
virInterfaceDefParseXML(xmlXPathContextPtr ctxt,
int parentIfType)
{
virInterfaceDefPtr def;
virInterfaceDef *def;
int type;
char *tmp;
VIR_XPATH_NODE_AUTORESTORE(ctxt)
@ -795,7 +795,7 @@ virInterfaceDefParseXML(xmlXPathContextPtr ctxt,
}
virInterfaceDefPtr
virInterfaceDef *
virInterfaceDefParseNode(xmlDocPtr xml,
xmlNodePtr root)
{
@ -817,12 +817,12 @@ virInterfaceDefParseNode(xmlDocPtr xml,
}
static virInterfaceDefPtr
static virInterfaceDef *
virInterfaceDefParse(const char *xmlStr,
const char *filename)
{
xmlDocPtr xml;
virInterfaceDefPtr def = NULL;
virInterfaceDef *def = NULL;
if ((xml = virXMLParse(filename, xmlStr, _("(interface_definition)")))) {
def = virInterfaceDefParseNode(xml, xmlDocGetRootElement(xml));
@ -833,14 +833,14 @@ virInterfaceDefParse(const char *xmlStr,
}
virInterfaceDefPtr
virInterfaceDef *
virInterfaceDefParseString(const char *xmlStr)
{
return virInterfaceDefParse(xmlStr, NULL);
}
virInterfaceDefPtr
virInterfaceDef *
virInterfaceDefParseFile(const char *filename)
{
return virInterfaceDefParse(NULL, filename);
@ -848,7 +848,7 @@ virInterfaceDefParseFile(const char *filename)
static int
virInterfaceBridgeDefFormat(virBufferPtr buf,
virInterfaceBridgeDefFormat(virBuffer *buf,
const virInterfaceDef *def)
{
size_t i;
@ -877,7 +877,7 @@ virInterfaceBridgeDefFormat(virBufferPtr buf,
static int
virInterfaceBondDefFormat(virBufferPtr buf,
virInterfaceBondDefFormat(virBuffer *buf,
const virInterfaceDef *def)
{
size_t i;
@ -942,7 +942,7 @@ virInterfaceBondDefFormat(virBufferPtr buf,
static int
virInterfaceVlanDefFormat(virBufferPtr buf,
virInterfaceVlanDefFormat(virBuffer *buf,
const virInterfaceDef *def)
{
if (def->data.vlan.tag == NULL) {
@ -967,7 +967,7 @@ virInterfaceVlanDefFormat(virBufferPtr buf,
static int
virInterfaceProtocolDefFormat(virBufferPtr buf,
virInterfaceProtocolDefFormat(virBuffer *buf,
const virInterfaceDef *def)
{
size_t i, j;
@ -1014,7 +1014,7 @@ virInterfaceProtocolDefFormat(virBufferPtr buf,
static int
virInterfaceStartmodeDefFormat(virBufferPtr buf,
virInterfaceStartmodeDefFormat(virBuffer *buf,
virInterfaceStartMode startmode)
{
const char *mode;
@ -1041,7 +1041,7 @@ virInterfaceStartmodeDefFormat(virBufferPtr buf,
static int
virInterfaceDefDevFormat(virBufferPtr buf,
virInterfaceDefDevFormat(virBuffer *buf,
const virInterfaceDef *def,
virInterfaceType parentIfType)
{

View File

@ -84,7 +84,6 @@ typedef enum {
struct _virInterfaceDef; /* forward declaration required for bridge/bond */
typedef struct _virInterfaceBridgeDef virInterfaceBridgeDef;
typedef virInterfaceBridgeDef *virInterfaceBridgeDefPtr;
struct _virInterfaceBridgeDef {
int stp; /* 0, 1 or -1 if undefined */
char *delay;
@ -93,7 +92,6 @@ struct _virInterfaceBridgeDef {
};
typedef struct _virInterfaceBondDef virInterfaceBondDef;
typedef virInterfaceBondDef *virInterfaceBondDefPtr;
struct _virInterfaceBondDef {
int mode; /* virInterfaceBondMode */
int monit; /* virInterfaceBondMonit */
@ -109,14 +107,12 @@ struct _virInterfaceBondDef {
};
typedef struct _virInterfaceVlanDef virInterfaceVlanDef;
typedef virInterfaceVlanDef *virInterfaceVlanDefPtr;
struct _virInterfaceVlanDef {
char *tag; /* TAG for vlan */
char *dev_name; /* device name for vlan */
};
typedef struct _virInterfaceIPDef virInterfaceIPDef;
typedef virInterfaceIPDef *virInterfaceIPDefPtr;
struct _virInterfaceIPDef {
char *address; /* ip address */
int prefix; /* ip prefix */
@ -124,20 +120,18 @@ struct _virInterfaceIPDef {
typedef struct _virInterfaceProtocolDef virInterfaceProtocolDef;
typedef virInterfaceProtocolDef *virInterfaceProtocolDefPtr;
struct _virInterfaceProtocolDef {
char *family; /* ipv4 or ipv6 */
int dhcp; /* use dhcp */
int peerdns; /* dhcp peerdns ? */
int autoconf; /* only useful if family is ipv6 */
int nips;
virInterfaceIPDefPtr *ips; /* ptr to array of ips[nips] */
virInterfaceIPDef **ips; /* ptr to array of ips[nips] */
char *gateway; /* route gateway */
};
typedef struct _virInterfaceDef virInterfaceDef;
typedef virInterfaceDef *virInterfaceDefPtr;
struct _virInterfaceDef {
int type; /* interface type */
char *name; /* interface name */
@ -154,19 +148,19 @@ struct _virInterfaceDef {
} data;
int nprotos;
virInterfaceProtocolDefPtr *protos; /* ptr to array of protos[nprotos] */
virInterfaceProtocolDef **protos; /* ptr to array of protos[nprotos] */
};
void
virInterfaceDefFree(virInterfaceDefPtr def);
virInterfaceDefFree(virInterfaceDef *def);
virInterfaceDefPtr
virInterfaceDef *
virInterfaceDefParseString(const char *xmlStr);
virInterfaceDefPtr
virInterfaceDef *
virInterfaceDefParseFile(const char *filename);
virInterfaceDefPtr
virInterfaceDef *
virInterfaceDefParseNode(xmlDocPtr xml,
xmlNodePtr root);

View File

@ -34,7 +34,7 @@
VIR_LOG_INIT("conf.moment_conf");
static virClassPtr virDomainMomentDefClass;
static virClass *virDomainMomentDefClass;
static void virDomainMomentDefDispose(void *obj);
static int
@ -48,7 +48,7 @@ virDomainMomentOnceInit(void)
VIR_ONCE_GLOBAL_INIT(virDomainMoment);
virClassPtr
virClass *
virClassForDomainMomentDef(void)
{
if (virDomainMomentInitialize() < 0)
@ -60,7 +60,7 @@ virClassForDomainMomentDef(void)
static void
virDomainMomentDefDispose(void *obj)
{
virDomainMomentDefPtr def = obj;
virDomainMomentDef *def = obj;
g_free(def->name);
g_free(def->description);
@ -71,7 +71,7 @@ virDomainMomentDefDispose(void *obj)
/* Provide defaults for creation time and moment name after parsing XML */
int
virDomainMomentDefPostParse(virDomainMomentDefPtr def)
virDomainMomentDefPostParse(virDomainMomentDef *def)
{
def->creationTime = g_get_real_time() / (1000*1000);

View File

@ -41,15 +41,15 @@ struct _virDomainMomentDef {
* guest and the inactive domain definition in case of
* offline guest
*/
virDomainDefPtr dom;
virDomainDef *dom;
/*
* Store the inactive domain definition in case of online
* guest and leave NULL in case of offline guest
*/
virDomainDefPtr inactiveDom;
virDomainDef *inactiveDom;
};
virClassPtr virClassForDomainMomentDef(void);
virClass *virClassForDomainMomentDef(void);
int virDomainMomentDefPostParse(virDomainMomentDefPtr def);
int virDomainMomentDefPostParse(virDomainMomentDef *def);

View File

@ -26,7 +26,7 @@
#define VIR_FROM_THIS VIR_FROM_NONE
static int
virNetDevBandwidthParseRate(xmlNodePtr node, virNetDevBandwidthRatePtr rate)
virNetDevBandwidthParseRate(xmlNodePtr node, virNetDevBandwidthRate *rate)
{
g_autofree char *average = NULL;
g_autofree char *peak = NULL;
@ -101,7 +101,7 @@ virNetDevBandwidthParseRate(xmlNodePtr node, virNetDevBandwidthRatePtr rate)
* Returns !NULL on success, NULL on error.
*/
int
virNetDevBandwidthParse(virNetDevBandwidthPtr *bandwidth,
virNetDevBandwidthParse(virNetDevBandwidth **bandwidth,
unsigned int *class_id,
xmlNodePtr node,
bool allowFloor)
@ -199,8 +199,8 @@ virNetDevBandwidthParse(virNetDevBandwidthPtr *bandwidth,
}
static int
virNetDevBandwidthRateFormat(virNetDevBandwidthRatePtr def,
virBufferPtr buf,
virNetDevBandwidthRateFormat(virNetDevBandwidthRate *def,
virBuffer *buf,
const char *elem_name)
{
if (!buf || !elem_name)
@ -242,7 +242,7 @@ virNetDevBandwidthRateFormat(virNetDevBandwidthRatePtr def,
int
virNetDevBandwidthFormat(const virNetDevBandwidth *def,
unsigned int class_id,
virBufferPtr buf)
virBuffer *buf)
{
if (!buf)
return -1;
@ -265,7 +265,7 @@ virNetDevBandwidthFormat(const virNetDevBandwidth *def,
}
void
virDomainClearNetBandwidth(virDomainDefPtr def)
virDomainClearNetBandwidth(virDomainDef *def)
{
size_t i;
virDomainNetType type;

View File

@ -25,16 +25,16 @@
#include "domain_conf.h"
#include "network_conf.h"
int virNetDevBandwidthParse(virNetDevBandwidthPtr *bandwidth,
int virNetDevBandwidthParse(virNetDevBandwidth **bandwidth,
unsigned int *class_id,
xmlNodePtr node,
bool allowFloor)
ATTRIBUTE_NONNULL(1) G_GNUC_WARN_UNUSED_RESULT;
int virNetDevBandwidthFormat(const virNetDevBandwidth *def,
unsigned int class_id,
virBufferPtr buf);
virBuffer *buf);
void virDomainClearNetBandwidth(virDomainDefPtr def)
void virDomainClearNetBandwidth(virDomainDef *def)
ATTRIBUTE_NONNULL(1);
bool virNetDevSupportsBandwidth(virDomainNetType type);

View File

@ -30,7 +30,7 @@ VIR_ENUM_IMPL(virNativeVlanMode,
);
int
virNetDevVlanParse(xmlNodePtr node, xmlXPathContextPtr ctxt, virNetDevVlanPtr def)
virNetDevVlanParse(xmlNodePtr node, xmlXPathContextPtr ctxt, virNetDevVlan *def)
{
int ret = -1;
VIR_XPATH_NODE_AUTORESTORE(ctxt)
@ -135,7 +135,7 @@ virNetDevVlanParse(xmlNodePtr node, xmlXPathContextPtr ctxt, virNetDevVlanPtr de
}
int
virNetDevVlanFormat(const virNetDevVlan *def, virBufferPtr buf)
virNetDevVlanFormat(const virNetDevVlan *def, virBuffer *buf)
{
size_t i;

View File

@ -23,5 +23,5 @@
#include "virbuffer.h"
#include "virxml.h"
int virNetDevVlanParse(xmlNodePtr node, xmlXPathContextPtr ctxt, virNetDevVlanPtr def);
int virNetDevVlanFormat(const virNetDevVlan *def, virBufferPtr buf);
int virNetDevVlanParse(xmlNodePtr node, xmlXPathContextPtr ctxt, virNetDevVlan *def);
int virNetDevVlanFormat(const virNetDevVlan *def, virBuffer *buf);

View File

@ -26,7 +26,7 @@
#define VIR_FROM_THIS VIR_FROM_NONE
virNetDevVPortProfilePtr
virNetDevVPortProfile *
virNetDevVPortProfileParse(xmlNodePtr node, unsigned int flags)
{
char *virtPortType;
@ -36,7 +36,7 @@ virNetDevVPortProfileParse(xmlNodePtr node, unsigned int flags)
char *virtPortInstanceID = NULL;
char *virtPortProfileID = NULL;
char *virtPortInterfaceID = NULL;
virNetDevVPortProfilePtr virtPort = NULL;
virNetDevVPortProfile *virtPort = NULL;
xmlNodePtr cur = node->children;
virtPort = g_new0(virNetDevVPortProfile, 1);
@ -197,7 +197,7 @@ virNetDevVPortProfileParse(xmlNodePtr node, unsigned int flags)
int
virNetDevVPortProfileFormat(const virNetDevVPortProfile *virtPort,
virBufferPtr buf)
virBuffer *buf)
{
enum virNetDevVPortProfile type;
bool noParameters;

View File

@ -36,9 +36,9 @@ typedef enum {
VIR_VPORT_XML_REQUIRE_TYPE = (1<<2),
} virNetDevVPortXMLFlags;
virNetDevVPortProfilePtr
virNetDevVPortProfile *
virNetDevVPortProfileParse(xmlNodePtr node, unsigned int flags);
int
virNetDevVPortProfileFormat(const virNetDevVPortProfile *virtPort,
virBufferPtr buf);
virBuffer *buf);

View File

@ -77,7 +77,7 @@ VIR_ENUM_IMPL(virNetworkDHCPLeaseTimeUnit,
"hours",
);
static virClassPtr virNetworkXMLOptionClass;
static virClass *virNetworkXMLOptionClass;
static void
virNetworkXMLOptionDispose(void *obj G_GNUC_UNUSED)
@ -96,10 +96,10 @@ virNetworkXMLOnceInit(void)
VIR_ONCE_GLOBAL_INIT(virNetworkXML);
virNetworkXMLOptionPtr
virNetworkXMLOptionNew(virXMLNamespacePtr xmlns)
virNetworkXMLOption *
virNetworkXMLOptionNew(virXMLNamespace *xmlns)
{
virNetworkXMLOptionPtr xmlopt;
virNetworkXMLOption *xmlopt;
if (virNetworkXMLInitialize() < 0)
return NULL;
@ -114,7 +114,7 @@ virNetworkXMLOptionNew(virXMLNamespacePtr xmlns)
}
static void
virPortGroupDefClear(virPortGroupDefPtr def)
virPortGroupDefClear(virPortGroupDef *def)
{
VIR_FREE(def->name);
VIR_FREE(def->virtPortProfile);
@ -125,7 +125,7 @@ virPortGroupDefClear(virPortGroupDefPtr def)
static void
virNetworkForwardIfDefClear(virNetworkForwardIfDefPtr def)
virNetworkForwardIfDefClear(virNetworkForwardIfDef *def)
{
if (def->type == VIR_NETWORK_FORWARD_HOSTDEV_DEVICE_NETDEV)
VIR_FREE(def->device.dev);
@ -133,21 +133,21 @@ virNetworkForwardIfDefClear(virNetworkForwardIfDefPtr def)
static void
virNetworkForwardPfDefClear(virNetworkForwardPfDefPtr def)
virNetworkForwardPfDefClear(virNetworkForwardPfDef *def)
{
VIR_FREE(def->dev);
}
static void
virNetworkDHCPLeaseTimeDefClear(virNetworkDHCPLeaseTimeDefPtr lease)
virNetworkDHCPLeaseTimeDefClear(virNetworkDHCPLeaseTimeDef *lease)
{
VIR_FREE(lease);
}
static void
virNetworkDHCPHostDefClear(virNetworkDHCPHostDefPtr def)
virNetworkDHCPHostDefClear(virNetworkDHCPHostDef *def)
{
VIR_FREE(def->mac);
VIR_FREE(def->id);
@ -157,7 +157,7 @@ virNetworkDHCPHostDefClear(virNetworkDHCPHostDefPtr def)
static void
virNetworkIPDefClear(virNetworkIPDefPtr def)
virNetworkIPDefClear(virNetworkIPDef *def)
{
VIR_FREE(def->family);
@ -175,7 +175,7 @@ virNetworkIPDefClear(virNetworkIPDefPtr def)
static void
virNetworkDNSTxtDefClear(virNetworkDNSTxtDefPtr def)
virNetworkDNSTxtDefClear(virNetworkDNSTxtDef *def)
{
VIR_FREE(def->name);
VIR_FREE(def->value);
@ -183,7 +183,7 @@ virNetworkDNSTxtDefClear(virNetworkDNSTxtDefPtr def)
static void
virNetworkDNSHostDefClear(virNetworkDNSHostDefPtr def)
virNetworkDNSHostDefClear(virNetworkDNSHostDef *def)
{
while (def->nnames)
VIR_FREE(def->names[--def->nnames]);
@ -192,7 +192,7 @@ virNetworkDNSHostDefClear(virNetworkDNSHostDefPtr def)
static void
virNetworkDNSSrvDefClear(virNetworkDNSSrvDefPtr def)
virNetworkDNSSrvDefClear(virNetworkDNSSrvDef *def)
{
VIR_FREE(def->domain);
VIR_FREE(def->service);
@ -202,14 +202,14 @@ virNetworkDNSSrvDefClear(virNetworkDNSSrvDefPtr def)
static void
virNetworkDNSForwarderClear(virNetworkDNSForwarderPtr def)
virNetworkDNSForwarderClear(virNetworkDNSForwarder *def)
{
VIR_FREE(def->domain);
}
static void
virNetworkDNSDefClear(virNetworkDNSDefPtr def)
virNetworkDNSDefClear(virNetworkDNSDef *def)
{
if (def->forwarders) {
while (def->nfwds)
@ -235,7 +235,7 @@ virNetworkDNSDefClear(virNetworkDNSDefPtr def)
static void
virNetworkForwardDefClear(virNetworkForwardDefPtr def)
virNetworkForwardDefClear(virNetworkForwardDef *def)
{
size_t i;
@ -251,7 +251,7 @@ virNetworkForwardDefClear(virNetworkForwardDefPtr def)
void
virNetworkDefFree(virNetworkDefPtr def)
virNetworkDefFree(virNetworkDef *def)
{
size_t i;
@ -301,9 +301,9 @@ virNetworkDefFree(virNetworkDefPtr def)
*
* Returns a new NetworkDef on success, or NULL on failure.
*/
virNetworkDefPtr
virNetworkDefCopy(virNetworkDefPtr def,
virNetworkXMLOptionPtr xmlopt,
virNetworkDef *
virNetworkDefCopy(virNetworkDef *def,
virNetworkXMLOption *xmlopt,
unsigned int flags)
{
g_autofree char *xml = NULL;
@ -323,7 +323,7 @@ virNetworkDefCopy(virNetworkDefPtr def,
/* return ips[index], or NULL if there aren't enough ips */
virNetworkIPDefPtr
virNetworkIPDef *
virNetworkDefGetIPByIndex(const virNetworkDef *def,
int family,
size_t n)
@ -349,7 +349,7 @@ virNetworkDefGetIPByIndex(const virNetworkDef *def,
/* return routes[index], or NULL if there aren't enough routes */
virNetDevIPRoutePtr
virNetDevIPRoute *
virNetworkDefGetRouteByIndex(const virNetworkDef *def,
int family,
size_t n)
@ -364,7 +364,7 @@ virNetworkDefGetRouteByIndex(const virNetworkDef *def,
/* find the nth route of type "family" */
for (i = 0; i < def->nroutes; i++) {
virSocketAddrPtr addr = virNetDevIPRouteGetAddress(def->routes[i]);
virSocketAddr *addr = virNetDevIPRouteGetAddress(def->routes[i]);
if (VIR_SOCKET_ADDR_IS_FAMILY(addr, family)
&& (n-- <= 0)) {
return def->routes[i];
@ -393,7 +393,7 @@ virNetworkIPDefPrefix(const virNetworkIPDef *def)
* prefix. Return -1 on error (and set the netmask family to AF_UNSPEC)
*/
int virNetworkIPDefNetmask(const virNetworkIPDef *def,
virSocketAddrPtr netmask)
virSocketAddr *netmask)
{
if (VIR_SOCKET_ADDR_IS_FAMILY(&def->netmask, AF_INET)) {
*netmask = def->netmask;
@ -406,10 +406,10 @@ int virNetworkIPDefNetmask(const virNetworkIPDef *def,
static int
virNetworkDHCPLeaseTimeDefParseXML(virNetworkDHCPLeaseTimeDefPtr *lease,
virNetworkDHCPLeaseTimeDefParseXML(virNetworkDHCPLeaseTimeDef **lease,
xmlNodePtr node)
{
virNetworkDHCPLeaseTimeDefPtr new_lease = NULL;
virNetworkDHCPLeaseTimeDef *new_lease = NULL;
g_autofree char *expirystr = NULL;
g_autofree char *unitstr = NULL;
unsigned long expiry;
@ -457,11 +457,11 @@ virNetworkDHCPLeaseTimeDefParseXML(virNetworkDHCPLeaseTimeDefPtr *lease,
static int
virNetworkDHCPRangeDefParseXML(const char *networkName,
virNetworkIPDefPtr ipdef,
virNetworkIPDef *ipdef,
xmlNodePtr node,
virNetworkDHCPRangeDefPtr range)
virNetworkDHCPRangeDef *range)
{
virSocketAddrRangePtr addr = &range->addr;
virSocketAddrRange *addr = &range->addr;
xmlNodePtr cur = node->children;
g_autofree char *start = NULL;
g_autofree char *end = NULL;
@ -505,9 +505,9 @@ virNetworkDHCPRangeDefParseXML(const char *networkName,
static int
virNetworkDHCPHostDefParseXML(const char *networkName,
virNetworkIPDefPtr def,
virNetworkIPDef *def,
xmlNodePtr node,
virNetworkDHCPHostDefPtr host,
virNetworkDHCPHostDef *host,
bool partialOkay)
{
g_autofree char *mac = NULL;
@ -632,7 +632,7 @@ virNetworkDHCPHostDefParseXML(const char *networkName,
static int
virNetworkDHCPDefParseXML(const char *networkName,
xmlNodePtr node,
virNetworkIPDefPtr def)
virNetworkIPDef *def)
{
int ret = -1;
xmlNodePtr cur;
@ -696,7 +696,7 @@ virNetworkDHCPDefParseXML(const char *networkName,
static int
virNetworkDNSHostDefParseXML(const char *networkName,
xmlNodePtr node,
virNetworkDNSHostDefPtr def,
virNetworkDNSHostDef *def,
bool partialOkay)
{
xmlNodePtr cur;
@ -779,7 +779,7 @@ static int
virNetworkDNSSrvDefParseXML(const char *networkName,
xmlNodePtr node,
xmlXPathContextPtr ctxt,
virNetworkDNSSrvDefPtr def,
virNetworkDNSSrvDef *def,
bool partialOkay)
{
int ret;
@ -889,7 +889,7 @@ virNetworkDNSSrvDefParseXML(const char *networkName,
static int
virNetworkDNSTxtDefParseXML(const char *networkName,
xmlNodePtr node,
virNetworkDNSTxtDefPtr def,
virNetworkDNSTxtDef *def,
bool partialOkay)
{
const char *bad = " ,";
@ -931,7 +931,7 @@ static int
virNetworkDNSDefParseXML(const char *networkName,
xmlNodePtr node,
xmlXPathContextPtr ctxt,
virNetworkDNSDefPtr def)
virNetworkDNSDef *def)
{
g_autofree xmlNodePtr *hostNodes = NULL;
g_autofree xmlNodePtr *srvNodes = NULL;
@ -1074,7 +1074,7 @@ static int
virNetworkIPDefParseXML(const char *networkName,
xmlNodePtr node,
xmlXPathContextPtr ctxt,
virNetworkIPDefPtr def)
virNetworkIPDef *def)
{
/*
* virNetworkIPDef object is already allocated as part of an array.
@ -1243,7 +1243,7 @@ virNetworkPortOptionsParseXML(xmlXPathContextPtr ctxt,
static int
virNetworkPortGroupParseXML(virPortGroupDefPtr def,
virNetworkPortGroupParseXML(virPortGroupDef *def,
xmlNodePtr node,
xmlXPathContextPtr ctxt)
{
@ -1314,7 +1314,7 @@ static int
virNetworkForwardNatDefParseXML(const char *networkName,
xmlNodePtr node,
xmlXPathContextPtr ctxt,
virNetworkForwardDefPtr def)
virNetworkForwardDef *def)
{
int nNatAddrs, nNatPorts;
g_autofree xmlNodePtr *natAddrNodes = NULL;
@ -1448,7 +1448,7 @@ static int
virNetworkForwardDefParseXML(const char *networkName,
xmlNodePtr node,
xmlXPathContextPtr ctxt,
virNetworkForwardDefPtr def)
virNetworkForwardDef *def)
{
size_t i, j;
int nForwardIfs, nForwardAddrs, nForwardPfs, nForwardNats;
@ -1621,7 +1621,7 @@ virNetworkForwardDefParseXML(const char *networkName,
switch (def->ifs[i].type) {
case VIR_NETWORK_FORWARD_HOSTDEV_DEVICE_PCI:
{
virPCIDeviceAddressPtr addr = &def->ifs[i].device.pci;
virPCIDeviceAddress *addr = &def->ifs[i].device.pci;
if (virPCIDeviceAddressParseXML(forwardAddrNodes[i], addr) < 0)
return -1;
@ -1675,9 +1675,9 @@ virNetworkForwardDefParseXML(const char *networkName,
}
virNetworkDefPtr
virNetworkDef *
virNetworkDefParseXML(xmlXPathContextPtr ctxt,
virNetworkXMLOptionPtr xmlopt)
virNetworkXMLOption *xmlopt)
{
g_autoptr(virNetworkDef) def = NULL;
g_autofree char *uuid = NULL;
@ -1895,10 +1895,10 @@ virNetworkDefParseXML(xmlXPathContextPtr ctxt,
size_t i;
/* allocate array to hold all the route definitions */
def->routes = g_new0(virNetDevIPRoutePtr, nRoutes);
def->routes = g_new0(virNetDevIPRoute *, nRoutes);
/* parse each definition */
for (i = 0; i < nRoutes; i++) {
virNetDevIPRoutePtr route = NULL;
virNetDevIPRoute *route = NULL;
if (!(route = virNetDevIPRouteParseXML(def->name,
routeNodes[i],
@ -1920,11 +1920,11 @@ virNetworkDefParseXML(xmlXPathContextPtr ctxt,
size_t j;
virSocketAddr testAddr, testGw;
bool addrMatch;
virNetDevIPRoutePtr gwdef = def->routes[i];
virSocketAddrPtr gateway = virNetDevIPRouteGetGateway(gwdef);
virNetDevIPRoute *gwdef = def->routes[i];
virSocketAddr *gateway = virNetDevIPRouteGetGateway(gwdef);
addrMatch = false;
for (j = 0; j < nips; j++) {
virNetworkIPDefPtr def2 = &def->ips[j];
virNetworkIPDef *def2 = &def->ips[j];
int prefix;
if (VIR_SOCKET_ADDR_FAMILY(gateway)
@ -2101,13 +2101,13 @@ virNetworkDefParseXML(xmlXPathContextPtr ctxt,
}
static virNetworkDefPtr
static virNetworkDef *
virNetworkDefParse(const char *xmlStr,
const char *filename,
virNetworkXMLOptionPtr xmlopt)
virNetworkXMLOption *xmlopt)
{
g_autoptr(xmlDoc) xml = NULL;
virNetworkDefPtr def = NULL;
virNetworkDef *def = NULL;
int keepBlanksDefault = xmlKeepBlanksDefault(0);
if ((xml = virXMLParse(filename, xmlStr, _("(network_definition)"))))
@ -2118,26 +2118,26 @@ virNetworkDefParse(const char *xmlStr,
}
virNetworkDefPtr
virNetworkDef *
virNetworkDefParseString(const char *xmlStr,
virNetworkXMLOptionPtr xmlopt)
virNetworkXMLOption *xmlopt)
{
return virNetworkDefParse(xmlStr, NULL, xmlopt);
}
virNetworkDefPtr
virNetworkDef *
virNetworkDefParseFile(const char *filename,
virNetworkXMLOptionPtr xmlopt)
virNetworkXMLOption *xmlopt)
{
return virNetworkDefParse(NULL, filename, xmlopt);
}
virNetworkDefPtr
virNetworkDef *
virNetworkDefParseNode(xmlDocPtr xml,
xmlNodePtr root,
virNetworkXMLOptionPtr xmlopt)
virNetworkXMLOption *xmlopt)
{
g_autoptr(xmlXPathContext) ctxt = NULL;
@ -2158,7 +2158,7 @@ virNetworkDefParseNode(xmlDocPtr xml,
static int
virNetworkDNSDefFormat(virBufferPtr buf,
virNetworkDNSDefFormat(virBuffer *buf,
const virNetworkDNSDef *def)
{
size_t i, j;
@ -2263,7 +2263,7 @@ virNetworkDNSDefFormat(virBufferPtr buf,
static int
virNetworkIPDefFormat(virBufferPtr buf,
virNetworkIPDefFormat(virBuffer *buf,
const virNetworkIPDef *def)
{
virBufferAddLit(buf, "<ip");
@ -2304,7 +2304,7 @@ virNetworkIPDefFormat(virBufferPtr buf,
for (i = 0; i < def->nranges; i++) {
virSocketAddrRange addr = def->ranges[i].addr;
virNetworkDHCPLeaseTimeDefPtr lease = def->ranges[i].lease;
virNetworkDHCPLeaseTimeDef *lease = def->ranges[i].lease;
g_autofree char *saddr = NULL;
g_autofree char *eaddr = NULL;
@ -2333,7 +2333,7 @@ virNetworkIPDefFormat(virBufferPtr buf,
}
}
for (i = 0; i < def->nhosts; i++) {
virNetworkDHCPLeaseTimeDefPtr lease = def->hosts[i].lease;
virNetworkDHCPLeaseTimeDef *lease = def->hosts[i].lease;
virBufferAddLit(buf, "<host");
if (def->hosts[i].mac)
virBufferAsprintf(buf, " mac='%s'", def->hosts[i].mac);
@ -2389,7 +2389,7 @@ virNetworkIPDefFormat(virBufferPtr buf,
void
virNetworkPortOptionsFormat(virTristateBool isolatedPort,
virBufferPtr buf)
virBuffer *buf)
{
if (isolatedPort != VIR_TRISTATE_BOOL_ABSENT)
virBufferAsprintf(buf, "<port isolated='%s'/>\n",
@ -2397,7 +2397,7 @@ virNetworkPortOptionsFormat(virTristateBool isolatedPort,
}
static int
virPortGroupDefFormat(virBufferPtr buf,
virPortGroupDefFormat(virBuffer *buf,
const virPortGroupDef *def)
{
virBufferAsprintf(buf, "<portgroup name='%s'", def->name);
@ -2420,7 +2420,7 @@ virPortGroupDefFormat(virBufferPtr buf,
static int
virNetworkForwardNatDefFormat(virBufferPtr buf,
virNetworkForwardNatDefFormat(virBuffer *buf,
const virNetworkForwardDef *fwd)
{
g_autofree char *addrStart = NULL;
@ -2473,9 +2473,9 @@ virNetworkForwardNatDefFormat(virBufferPtr buf,
int
virNetworkDefFormatBuf(virBufferPtr buf,
virNetworkDefFormatBuf(virBuffer *buf,
const virNetworkDef *def,
virNetworkXMLOptionPtr xmlopt G_GNUC_UNUSED,
virNetworkXMLOption *xmlopt G_GNUC_UNUSED,
unsigned int flags)
{
const unsigned char *uuid;
@ -2708,7 +2708,7 @@ virNetworkDefFormatBuf(virBufferPtr buf,
char *
virNetworkDefFormat(const virNetworkDef *def,
virNetworkXMLOptionPtr xmlopt,
virNetworkXMLOption *xmlopt,
unsigned int flags)
{
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
@ -2730,8 +2730,8 @@ virNetworkDefForwardIf(const virNetworkDef *def,
}
virPortGroupDefPtr
virPortGroupFindByName(virNetworkDefPtr net,
virPortGroupDef *
virPortGroupFindByName(virNetworkDef *net,
const char *portgroup)
{
size_t i;
@ -2750,7 +2750,7 @@ virPortGroupFindByName(virNetworkDefPtr net,
int
virNetworkSaveXML(const char *configDir,
virNetworkDefPtr def,
virNetworkDef *def,
const char *xml)
{
char uuidstr[VIR_UUID_STRING_BUFLEN];
@ -2775,8 +2775,8 @@ virNetworkSaveXML(const char *configDir,
int
virNetworkSaveConfig(const char *configDir,
virNetworkDefPtr def,
virNetworkXMLOptionPtr xmlopt)
virNetworkDef *def,
virNetworkXMLOption *xmlopt)
{
g_autofree char *xml = NULL;
@ -2799,7 +2799,7 @@ virNetworkConfigFile(const char *dir,
void
virNetworkSetBridgeMacAddr(virNetworkDefPtr def)
virNetworkSetBridgeMacAddr(virNetworkDef *def)
{
if (!def->mac_specified) {
/* if the bridge doesn't have a mac address explicitly defined,
@ -2815,7 +2815,7 @@ virNetworkSetBridgeMacAddr(virNetworkDefPtr def)
/* NetworkObj backend of the virNetworkUpdate API */
static void
virNetworkDefUpdateNoSupport(virNetworkDefPtr def, const char *section)
virNetworkDefUpdateNoSupport(virNetworkDef *def, const char *section)
{
virReportError(VIR_ERR_OPERATION_UNSUPPORTED,
_("can't update '%s' section of network '%s'"),
@ -2832,7 +2832,7 @@ virNetworkDefUpdateUnknownCommand(unsigned int command)
static int
virNetworkDefUpdateCheckElementName(virNetworkDefPtr def,
virNetworkDefUpdateCheckElementName(virNetworkDef *def,
xmlNodePtr node,
const char *section)
{
@ -2848,7 +2848,7 @@ virNetworkDefUpdateCheckElementName(virNetworkDefPtr def,
static int
virNetworkDefUpdateBridge(virNetworkDefPtr def,
virNetworkDefUpdateBridge(virNetworkDef *def,
unsigned int command G_GNUC_UNUSED,
int parentIndex G_GNUC_UNUSED,
xmlXPathContextPtr ctxt G_GNUC_UNUSED,
@ -2861,7 +2861,7 @@ virNetworkDefUpdateBridge(virNetworkDefPtr def,
static int
virNetworkDefUpdateDomain(virNetworkDefPtr def,
virNetworkDefUpdateDomain(virNetworkDef *def,
unsigned int command G_GNUC_UNUSED,
int parentIndex G_GNUC_UNUSED,
xmlXPathContextPtr ctxt G_GNUC_UNUSED,
@ -2874,7 +2874,7 @@ virNetworkDefUpdateDomain(virNetworkDefPtr def,
static int
virNetworkDefUpdateIP(virNetworkDefPtr def,
virNetworkDefUpdateIP(virNetworkDef *def,
unsigned int command G_GNUC_UNUSED,
int parentIndex G_GNUC_UNUSED,
xmlXPathContextPtr ctxt G_GNUC_UNUSED,
@ -2886,10 +2886,10 @@ virNetworkDefUpdateIP(virNetworkDefPtr def,
}
static virNetworkIPDefPtr
virNetworkIPDefByIndex(virNetworkDefPtr def, int parentIndex)
static virNetworkIPDef *
virNetworkIPDefByIndex(virNetworkDef *def, int parentIndex)
{
virNetworkIPDefPtr ipdef = NULL;
virNetworkIPDef *ipdef = NULL;
size_t i;
/* first find which ip element's dhcp host list to work on */
@ -2928,12 +2928,12 @@ virNetworkIPDefByIndex(virNetworkDefPtr def, int parentIndex)
static int
virNetworkDefUpdateCheckMultiDHCP(virNetworkDefPtr def,
virNetworkIPDefPtr ipdef)
virNetworkDefUpdateCheckMultiDHCP(virNetworkDef *def,
virNetworkIPDef *ipdef)
{
int family = VIR_SOCKET_ADDR_FAMILY(&ipdef->address);
size_t i;
virNetworkIPDefPtr ip;
virNetworkIPDef *ip;
for (i = 0; (ip = virNetworkDefGetIPByIndex(def, family, i)); i++) {
if (ip != ipdef) {
@ -2951,7 +2951,7 @@ virNetworkDefUpdateCheckMultiDHCP(virNetworkDefPtr def,
static int
virNetworkDefUpdateIPDHCPHost(virNetworkDefPtr def,
virNetworkDefUpdateIPDHCPHost(virNetworkDef *def,
unsigned int command,
int parentIndex,
xmlXPathContextPtr ctxt,
@ -2960,7 +2960,7 @@ virNetworkDefUpdateIPDHCPHost(virNetworkDefPtr def,
{
size_t i;
int ret = -1;
virNetworkIPDefPtr ipdef = virNetworkIPDefByIndex(def, parentIndex);
virNetworkIPDef *ipdef = virNetworkIPDefByIndex(def, parentIndex);
virNetworkDHCPHostDef host;
bool partialOkay = (command == VIR_NETWORK_UPDATE_COMMAND_DELETE);
@ -3089,7 +3089,7 @@ virNetworkDefUpdateIPDHCPHost(virNetworkDefPtr def,
static int
virNetworkDefUpdateIPDHCPRange(virNetworkDefPtr def,
virNetworkDefUpdateIPDHCPRange(virNetworkDef *def,
unsigned int command,
int parentIndex,
xmlXPathContextPtr ctxt,
@ -3097,7 +3097,7 @@ virNetworkDefUpdateIPDHCPRange(virNetworkDefPtr def,
unsigned int fflags G_GNUC_UNUSED)
{
size_t i;
virNetworkIPDefPtr ipdef = virNetworkIPDefByIndex(def, parentIndex);
virNetworkIPDef *ipdef = virNetworkIPDefByIndex(def, parentIndex);
virNetworkDHCPRangeDef range;
memset(&range, 0, sizeof(range));
@ -3187,7 +3187,7 @@ virNetworkDefUpdateIPDHCPRange(virNetworkDefPtr def,
static int
virNetworkDefUpdateForward(virNetworkDefPtr def,
virNetworkDefUpdateForward(virNetworkDef *def,
unsigned int command G_GNUC_UNUSED,
int parentIndex G_GNUC_UNUSED,
xmlXPathContextPtr ctxt G_GNUC_UNUSED,
@ -3200,7 +3200,7 @@ virNetworkDefUpdateForward(virNetworkDefPtr def,
static int
virNetworkDefUpdateForwardInterface(virNetworkDefPtr def,
virNetworkDefUpdateForwardInterface(virNetworkDef *def,
unsigned int command,
int parentIndex G_GNUC_UNUSED,
xmlXPathContextPtr ctxt,
@ -3295,7 +3295,7 @@ virNetworkDefUpdateForwardInterface(virNetworkDefPtr def,
static int
virNetworkDefUpdateForwardPF(virNetworkDefPtr def,
virNetworkDefUpdateForwardPF(virNetworkDef *def,
unsigned int command G_GNUC_UNUSED,
int parentIndex G_GNUC_UNUSED,
xmlXPathContextPtr ctxt G_GNUC_UNUSED,
@ -3308,7 +3308,7 @@ virNetworkDefUpdateForwardPF(virNetworkDefPtr def,
static int
virNetworkDefUpdatePortGroup(virNetworkDefPtr def,
virNetworkDefUpdatePortGroup(virNetworkDef *def,
unsigned int command,
int parentIndex G_GNUC_UNUSED,
xmlXPathContextPtr ctxt,
@ -3403,7 +3403,7 @@ virNetworkDefUpdatePortGroup(virNetworkDefPtr def,
static int
virNetworkDefUpdateDNSHost(virNetworkDefPtr def,
virNetworkDefUpdateDNSHost(virNetworkDef *def,
unsigned int command G_GNUC_UNUSED,
int parentIndex G_GNUC_UNUSED,
xmlXPathContextPtr ctxt G_GNUC_UNUSED,
@ -3412,7 +3412,7 @@ virNetworkDefUpdateDNSHost(virNetworkDefPtr def,
{
size_t i, j, k;
int foundIdx = -1, ret = -1;
virNetworkDNSDefPtr dns = &def->dns;
virNetworkDNSDef *dns = &def->dns;
virNetworkDNSHostDef host;
bool isAdd = (command == VIR_NETWORK_UPDATE_COMMAND_ADD_FIRST ||
command == VIR_NETWORK_UPDATE_COMMAND_ADD_LAST);
@ -3498,7 +3498,7 @@ virNetworkDefUpdateDNSHost(virNetworkDefPtr def,
static int
virNetworkDefUpdateDNSSrv(virNetworkDefPtr def,
virNetworkDefUpdateDNSSrv(virNetworkDef *def,
unsigned int command G_GNUC_UNUSED,
int parentIndex G_GNUC_UNUSED,
xmlXPathContextPtr ctxt G_GNUC_UNUSED,
@ -3507,7 +3507,7 @@ virNetworkDefUpdateDNSSrv(virNetworkDefPtr def,
{
size_t i;
int foundIdx = -1, ret = -1;
virNetworkDNSDefPtr dns = &def->dns;
virNetworkDNSDef *dns = &def->dns;
virNetworkDNSSrvDef srv;
bool isAdd = (command == VIR_NETWORK_UPDATE_COMMAND_ADD_FIRST ||
command == VIR_NETWORK_UPDATE_COMMAND_ADD_LAST);
@ -3585,7 +3585,7 @@ virNetworkDefUpdateDNSSrv(virNetworkDefPtr def,
static int
virNetworkDefUpdateDNSTxt(virNetworkDefPtr def,
virNetworkDefUpdateDNSTxt(virNetworkDef *def,
unsigned int command G_GNUC_UNUSED,
int parentIndex G_GNUC_UNUSED,
xmlXPathContextPtr ctxt G_GNUC_UNUSED,
@ -3593,7 +3593,7 @@ virNetworkDefUpdateDNSTxt(virNetworkDefPtr def,
unsigned int fflags G_GNUC_UNUSED)
{
int foundIdx, ret = -1;
virNetworkDNSDefPtr dns = &def->dns;
virNetworkDNSDef *dns = &def->dns;
virNetworkDNSTxtDef txt;
bool isAdd = (command == VIR_NETWORK_UPDATE_COMMAND_ADD_FIRST ||
command == VIR_NETWORK_UPDATE_COMMAND_ADD_LAST);
@ -3659,7 +3659,7 @@ virNetworkDefUpdateDNSTxt(virNetworkDefPtr def,
int
virNetworkDefUpdateSection(virNetworkDefPtr def,
virNetworkDefUpdateSection(virNetworkDef *def,
unsigned int command, /* virNetworkUpdateCommand */
unsigned int section, /* virNetworkUpdateSection */
int parentIndex,

View File

@ -44,7 +44,6 @@ struct _virNetworkXMLOption {
virXMLNamespace ns;
};
typedef struct _virNetworkXMLOption virNetworkXMLOption;
typedef virNetworkXMLOption *virNetworkXMLOptionPtr;
typedef enum {
@ -105,38 +104,33 @@ typedef enum {
VIR_ENUM_DECL(virNetworkForwardDriverName);
typedef struct _virNetworkDHCPLeaseTimeDef virNetworkDHCPLeaseTimeDef;
typedef virNetworkDHCPLeaseTimeDef *virNetworkDHCPLeaseTimeDefPtr;
struct _virNetworkDHCPLeaseTimeDef {
unsigned long expiry;
virNetworkDHCPLeaseTimeUnitType unit;
};
typedef struct _virNetworkDHCPRangeDef virNetworkDHCPRangeDef;
typedef virNetworkDHCPRangeDef *virNetworkDHCPRangeDefPtr;
struct _virNetworkDHCPRangeDef {
virSocketAddrRange addr;
virNetworkDHCPLeaseTimeDefPtr lease;
virNetworkDHCPLeaseTimeDef *lease;
};
typedef struct _virNetworkDHCPHostDef virNetworkDHCPHostDef;
typedef virNetworkDHCPHostDef *virNetworkDHCPHostDefPtr;
struct _virNetworkDHCPHostDef {
char *mac;
char *id;
char *name;
virSocketAddr ip;
virNetworkDHCPLeaseTimeDefPtr lease;
virNetworkDHCPLeaseTimeDef *lease;
};
typedef struct _virNetworkDNSTxtDef virNetworkDNSTxtDef;
typedef virNetworkDNSTxtDef *virNetworkDNSTxtDefPtr;
struct _virNetworkDNSTxtDef {
char *name;
char *value;
};
typedef struct _virNetworkDNSSrvDef virNetworkDNSSrvDef;
typedef virNetworkDNSSrvDef *virNetworkDNSSrvDefPtr;
struct _virNetworkDNSSrvDef {
char *domain;
char *service;
@ -148,7 +142,6 @@ struct _virNetworkDNSSrvDef {
};
typedef struct _virNetworkDNSHostDef virNetworkDNSHostDef;
typedef virNetworkDNSHostDef *virNetworkDNSHostDefPtr;
struct _virNetworkDNSHostDef {
virSocketAddr ip;
size_t nnames;
@ -157,29 +150,26 @@ struct _virNetworkDNSHostDef {
typedef struct _virNetworkDNSForwarder virNetworkDNSForwarder;
typedef virNetworkDNSForwarder *virNetworkDNSForwarderPtr;
struct _virNetworkDNSForwarder {
virSocketAddr addr;
char *domain;
};
typedef struct _virNetworkDNSDef virNetworkDNSDef;
typedef virNetworkDNSDef *virNetworkDNSDefPtr;
struct _virNetworkDNSDef {
int enable; /* enum virTristateBool */
int forwardPlainNames; /* enum virTristateBool */
size_t ntxts;
virNetworkDNSTxtDefPtr txts;
virNetworkDNSTxtDef *txts;
size_t nhosts;
virNetworkDNSHostDefPtr hosts;
virNetworkDNSHostDef *hosts;
size_t nsrvs;
virNetworkDNSSrvDefPtr srvs;
virNetworkDNSSrvDef *srvs;
size_t nfwds;
virNetworkDNSForwarderPtr forwarders;
virNetworkDNSForwarder *forwarders;
};
typedef struct _virNetworkIPDef virNetworkIPDef;
typedef virNetworkIPDef *virNetworkIPDefPtr;
struct _virNetworkIPDef {
char *family; /* ipv4 or ipv6 - default is ipv4 */
virSocketAddr address; /* Bridge IP address */
@ -196,10 +186,10 @@ struct _virNetworkIPDef {
int localPTR; /* virTristateBool */
size_t nranges; /* Zero or more dhcp ranges */
virNetworkDHCPRangeDefPtr ranges;
virNetworkDHCPRangeDef *ranges;
size_t nhosts; /* Zero or more dhcp hosts */
virNetworkDHCPHostDefPtr hosts;
virNetworkDHCPHostDef *hosts;
char *tftproot;
char *bootfile;
@ -207,7 +197,6 @@ struct _virNetworkIPDef {
};
typedef struct _virNetworkForwardIfDef virNetworkForwardIfDef;
typedef virNetworkForwardIfDef *virNetworkForwardIfDefPtr;
struct _virNetworkForwardIfDef {
int type;
union {
@ -219,14 +208,12 @@ struct _virNetworkForwardIfDef {
};
typedef struct _virNetworkForwardPfDef virNetworkForwardPfDef;
typedef virNetworkForwardPfDef *virNetworkForwardPfDefPtr;
struct _virNetworkForwardPfDef {
char *dev; /* name of device */
int connections; /* how many guest interfaces are connected to this device? */
};
typedef struct _virNetworkForwardDef virNetworkForwardDef;
typedef virNetworkForwardDef *virNetworkForwardDefPtr;
struct _virNetworkForwardDef {
int type; /* One of virNetworkForwardType constants */
bool managed; /* managed attribute for hostdev mode */
@ -236,10 +223,10 @@ struct _virNetworkForwardDef {
* interfaces), they will be listed here.
*/
size_t npfs;
virNetworkForwardPfDefPtr pfs;
virNetworkForwardPfDef *pfs;
size_t nifs;
virNetworkForwardIfDefPtr ifs;
virNetworkForwardIfDef *ifs;
/* ranges for NAT */
virSocketAddrRange addr;
@ -249,18 +236,16 @@ struct _virNetworkForwardDef {
};
typedef struct _virPortGroupDef virPortGroupDef;
typedef virPortGroupDef *virPortGroupDefPtr;
struct _virPortGroupDef {
char *name;
bool isDefault;
virNetDevVPortProfilePtr virtPortProfile;
virNetDevBandwidthPtr bandwidth;
virNetDevVPortProfile *virtPortProfile;
virNetDevBandwidth *bandwidth;
virNetDevVlan vlan;
int trustGuestRxFilters; /* enum virTristateBool */
};
typedef struct _virNetworkDef virNetworkDef;
typedef virNetworkDef *virNetworkDefPtr;
struct _virNetworkDef {
unsigned char uuid[VIR_UUID_BUFLEN];
bool uuid_specified;
@ -286,17 +271,17 @@ struct _virNetworkDef {
virNetworkForwardDef forward;
size_t nips;
virNetworkIPDefPtr ips; /* ptr to array of IP addresses on this network */
virNetworkIPDef *ips; /* ptr to array of IP addresses on this network */
size_t nroutes;
virNetDevIPRoutePtr *routes; /* ptr to array of static routes on this interface */
virNetDevIPRoute **routes; /* ptr to array of static routes on this interface */
virNetworkDNSDef dns; /* dns related configuration */
virNetDevVPortProfilePtr virtPortProfile;
virNetDevVPortProfile *virtPortProfile;
size_t nPortGroups;
virPortGroupDefPtr portGroups;
virNetDevBandwidthPtr bandwidth;
virPortGroupDef *portGroups;
virNetDevBandwidth *bandwidth;
virNetDevVlan vlan;
int trustGuestRxFilters; /* enum virTristateBool */
virTristateBool isolatedPort;
@ -320,7 +305,7 @@ typedef enum {
VIR_NETWORK_TAINT_LAST
} virNetworkTaintFlags;
void virNetworkDefFree(virNetworkDefPtr def);
void virNetworkDefFree(virNetworkDef *def);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(virNetworkDef, virNetworkDefFree);
enum {
@ -328,56 +313,56 @@ enum {
VIR_NETWORK_OBJ_LIST_ADD_CHECK_LIVE = (1 << 1),
};
virNetworkXMLOptionPtr
virNetworkXMLOptionNew(virXMLNamespacePtr xmlns);
virNetworkXMLOption *
virNetworkXMLOptionNew(virXMLNamespace *xmlns);
virNetworkDefPtr
virNetworkDefCopy(virNetworkDefPtr def,
virNetworkXMLOptionPtr xmlopt,
virNetworkDef *
virNetworkDefCopy(virNetworkDef *def,
virNetworkXMLOption *xmlopt,
unsigned int flags);
virNetworkDefPtr
virNetworkDef *
virNetworkDefParseXML(xmlXPathContextPtr ctxt,
virNetworkXMLOptionPtr xmlopt);
virNetworkXMLOption *xmlopt);
virNetworkDefPtr
virNetworkDef *
virNetworkDefParseString(const char *xmlStr,
virNetworkXMLOptionPtr xmlopt);
virNetworkXMLOption *xmlopt);
virNetworkDefPtr
virNetworkDef *
virNetworkDefParseFile(const char *filename,
virNetworkXMLOptionPtr xmlopt);
virNetworkXMLOption *xmlopt);
virNetworkDefPtr
virNetworkDef *
virNetworkDefParseNode(xmlDocPtr xml,
xmlNodePtr root,
virNetworkXMLOptionPtr xmlopt);
virNetworkXMLOption *xmlopt);
char *
virNetworkDefFormat(const virNetworkDef *def,
virNetworkXMLOptionPtr xmlopt,
virNetworkXMLOption *xmlopt,
unsigned int flags);
int
virNetworkDefFormatBuf(virBufferPtr buf,
virNetworkDefFormatBuf(virBuffer *buf,
const virNetworkDef *def,
virNetworkXMLOptionPtr xmlopt,
virNetworkXMLOption *xmlopt,
unsigned int flags);
const char *
virNetworkDefForwardIf(const virNetworkDef *def,
size_t n);
virPortGroupDefPtr
virPortGroupFindByName(virNetworkDefPtr net,
virPortGroupDef *
virPortGroupFindByName(virNetworkDef *net,
const char *portgroup);
virNetworkIPDefPtr
virNetworkIPDef *
virNetworkDefGetIPByIndex(const virNetworkDef *def,
int family,
size_t n);
virNetDevIPRoutePtr
virNetDevIPRoute *
virNetworkDefGetRouteByIndex(const virNetworkDef *def,
int family,
size_t n);
@ -387,24 +372,24 @@ virNetworkIPDefPrefix(const virNetworkIPDef *def);
int
virNetworkIPDefNetmask(const virNetworkIPDef *def,
virSocketAddrPtr netmask);
virSocketAddr *netmask);
int
virNetworkSaveXML(const char *configDir,
virNetworkDefPtr def,
virNetworkDef *def,
const char *xml);
int
virNetworkSaveConfig(const char *configDir,
virNetworkDefPtr def,
virNetworkXMLOptionPtr xmlopt);
virNetworkDef *def,
virNetworkXMLOption *xmlopt);
char *
virNetworkConfigFile(const char *dir,
const char *name);
void
virNetworkSetBridgeMacAddr(virNetworkDefPtr def);
virNetworkSetBridgeMacAddr(virNetworkDef *def);
int
virNetworkPortOptionsParseXML(xmlXPathContextPtr ctxt,
@ -412,7 +397,7 @@ virNetworkPortOptionsParseXML(xmlXPathContextPtr ctxt,
void
virNetworkPortOptionsFormat(virTristateBool isolatedPort,
virBufferPtr buf);
virBuffer *buf);
VIR_ENUM_DECL(virNetworkForward);
@ -435,7 +420,7 @@ VIR_ENUM_DECL(virNetworkForward);
/* for testing */
int
virNetworkDefUpdateSection(virNetworkDefPtr def,
virNetworkDefUpdateSection(virNetworkDef *def,
unsigned int command, /* virNetworkUpdateCommand */
unsigned int section, /* virNetworkUpdateSection */
int parentIndex,

View File

@ -36,7 +36,6 @@ struct _virNetworkEvent {
bool dummy;
};
typedef struct _virNetworkEvent virNetworkEvent;
typedef virNetworkEvent *virNetworkEventPtr;
struct _virNetworkEventLifecycle {
virNetworkEvent parent;
@ -45,10 +44,9 @@ struct _virNetworkEventLifecycle {
int detail;
};
typedef struct _virNetworkEventLifecycle virNetworkEventLifecycle;
typedef virNetworkEventLifecycle *virNetworkEventLifecyclePtr;
static virClassPtr virNetworkEventClass;
static virClassPtr virNetworkEventLifecycleClass;
static virClass *virNetworkEventClass;
static virClass *virNetworkEventLifecycleClass;
static void virNetworkEventDispose(void *obj);
static void virNetworkEventLifecycleDispose(void *obj);
@ -69,7 +67,7 @@ VIR_ONCE_GLOBAL_INIT(virNetworkEvents);
static void
virNetworkEventDispose(void *obj)
{
virNetworkEventPtr event = obj;
virNetworkEvent *event = obj;
VIR_DEBUG("obj=%p", event);
}
@ -77,14 +75,14 @@ virNetworkEventDispose(void *obj)
static void
virNetworkEventLifecycleDispose(void *obj)
{
virNetworkEventLifecyclePtr event = obj;
virNetworkEventLifecycle *event = obj;
VIR_DEBUG("obj=%p", event);
}
static void
virNetworkEventDispatchDefaultFunc(virConnectPtr conn,
virObjectEventPtr event,
virObjectEvent *event,
virConnectObjectEventGenericCallback cb,
void *cbopaque)
{
@ -95,9 +93,9 @@ virNetworkEventDispatchDefaultFunc(virConnectPtr conn,
switch ((virNetworkEventID)event->eventID) {
case VIR_NETWORK_EVENT_ID_LIFECYCLE:
{
virNetworkEventLifecyclePtr networkLifecycleEvent;
virNetworkEventLifecycle *networkLifecycleEvent;
networkLifecycleEvent = (virNetworkEventLifecyclePtr)event;
networkLifecycleEvent = (virNetworkEventLifecycle *)event;
((virConnectNetworkEventLifecycleCallback)cb)(conn, net,
networkLifecycleEvent->type,
networkLifecycleEvent->detail,
@ -134,7 +132,7 @@ virNetworkEventDispatchDefaultFunc(virConnectPtr conn,
*/
int
virNetworkEventStateRegisterID(virConnectPtr conn,
virObjectEventStatePtr state,
virObjectEventState *state,
virNetworkPtr net,
int eventID,
virConnectNetworkEventGenericCallback cb,
@ -178,7 +176,7 @@ virNetworkEventStateRegisterID(virConnectPtr conn,
*/
int
virNetworkEventStateRegisterClient(virConnectPtr conn,
virObjectEventStatePtr state,
virObjectEventState *state,
virNetworkPtr net,
int eventID,
virConnectNetworkEventGenericCallback cb,
@ -211,13 +209,13 @@ virNetworkEventStateRegisterClient(virConnectPtr conn,
*
* Create a new network lifecycle event.
*/
virObjectEventPtr
virObjectEvent *
virNetworkEventLifecycleNew(const char *name,
const unsigned char *uuid,
int type,
int detail)
{
virNetworkEventLifecyclePtr event;
virNetworkEventLifecycle *event;
char uuidstr[VIR_UUID_STRING_BUFLEN];
if (virNetworkEventsInitialize() < 0)
@ -233,5 +231,5 @@ virNetworkEventLifecycleNew(const char *name,
event->type = type;
event->detail = detail;
return (virObjectEventPtr)event;
return (virObjectEvent *)event;
}

View File

@ -27,7 +27,7 @@
int
virNetworkEventStateRegisterID(virConnectPtr conn,
virObjectEventStatePtr state,
virObjectEventState *state,
virNetworkPtr net,
int eventID,
virConnectNetworkEventGenericCallback cb,
@ -39,7 +39,7 @@ virNetworkEventStateRegisterID(virConnectPtr conn,
int
virNetworkEventStateRegisterClient(virConnectPtr conn,
virObjectEventStatePtr state,
virObjectEventState *state,
virNetworkPtr net,
int eventID,
virConnectNetworkEventGenericCallback cb,
@ -49,7 +49,7 @@ virNetworkEventStateRegisterClient(virConnectPtr conn,
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(5)
ATTRIBUTE_NONNULL(8);
virObjectEventPtr
virObjectEvent *
virNetworkEventLifecycleNew(const char *name,
const unsigned char *uuid,
int type,

View File

@ -30,7 +30,7 @@
#define VIR_FROM_THIS VIR_FROM_NETWORK
virNetDevIPRoutePtr
virNetDevIPRoute *
virNetDevIPRouteCreate(const char *errorDetail,
const char *family,
const char *address,
@ -212,7 +212,7 @@ virNetDevIPRouteCreate(const char *errorDetail,
return g_steal_pointer(&def);
}
virNetDevIPRoutePtr
virNetDevIPRoute *
virNetDevIPRouteParseXML(const char *errorDetail,
xmlNodePtr node,
xmlXPathContextPtr ctxt)
@ -273,7 +273,7 @@ virNetDevIPRouteParseXML(const char *errorDetail,
}
int
virNetDevIPRouteFormat(virBufferPtr buf,
virNetDevIPRouteFormat(virBuffer *buf,
const virNetDevIPRoute *def)
{
g_autofree char *address = NULL;

View File

@ -30,7 +30,7 @@
#include "virsocketaddr.h"
#include "virnetdevip.h"
virNetDevIPRoutePtr
virNetDevIPRoute *
virNetDevIPRouteCreate(const char *networkName,
const char *family,
const char *address,
@ -41,10 +41,10 @@ virNetDevIPRouteCreate(const char *networkName,
unsigned int metric,
bool hasMetric);
virNetDevIPRoutePtr
virNetDevIPRoute *
virNetDevIPRouteParseXML(const char *networkName,
xmlNodePtr node,
xmlXPathContextPtr ctxt);
int
virNetDevIPRouteFormat(virBufferPtr buf,
virNetDevIPRouteFormat(virBuffer *buf,
const virNetDevIPRoute *def);

View File

@ -101,9 +101,9 @@ virNodeDevCapsDefParseString(const char *xpath,
void
virNodeDeviceDefFree(virNodeDeviceDefPtr def)
virNodeDeviceDefFree(virNodeDeviceDef *def)
{
virNodeDevCapsDefPtr caps;
virNodeDevCapsDef *caps;
if (!def)
return;
@ -121,7 +121,7 @@ virNodeDeviceDefFree(virNodeDeviceDefPtr def)
caps = def->caps;
while (caps) {
virNodeDevCapsDefPtr next = caps->next;
virNodeDevCapsDef *next = caps->next;
virNodeDevCapsDefFree(caps);
caps = next;
}
@ -131,8 +131,8 @@ virNodeDeviceDefFree(virNodeDeviceDefPtr def)
static void
virPCIELinkFormat(virBufferPtr buf,
virPCIELinkPtr lnk,
virPCIELinkFormat(virBuffer *buf,
virPCIELink *lnk,
const char *attrib)
{
if (!lnk)
@ -150,8 +150,8 @@ virPCIELinkFormat(virBufferPtr buf,
static void
virPCIEDeviceInfoFormat(virBufferPtr buf,
virPCIEDeviceInfoPtr info)
virPCIEDeviceInfoFormat(virBuffer *buf,
virPCIEDeviceInfo *info)
{
if (!info->link_cap && !info->link_sta) {
virBufferAddLit(buf, "<pci-express/>\n");
@ -170,7 +170,7 @@ virPCIEDeviceInfoFormat(virBufferPtr buf,
static void
virNodeDeviceCapSystemDefFormat(virBufferPtr buf,
virNodeDeviceCapSystemDefFormat(virBuffer *buf,
const virNodeDevCapData *data)
{
char uuidstr[VIR_UUID_STRING_BUFLEN];
@ -211,8 +211,8 @@ virNodeDeviceCapSystemDefFormat(virBufferPtr buf,
static void
virNodeDeviceCapMdevTypesFormat(virBufferPtr buf,
virMediatedDeviceTypePtr *mdev_types,
virNodeDeviceCapMdevTypesFormat(virBuffer *buf,
virMediatedDeviceType **mdev_types,
const size_t nmdev_types)
{
size_t i;
@ -221,7 +221,7 @@ virNodeDeviceCapMdevTypesFormat(virBufferPtr buf,
virBufferAddLit(buf, "<capability type='mdev_types'>\n");
virBufferAdjustIndent(buf, 2);
for (i = 0; i < nmdev_types; i++) {
virMediatedDeviceTypePtr type = mdev_types[i];
virMediatedDeviceType *type = mdev_types[i];
virBufferEscapeString(buf, "<type id='%s'>\n", type->id);
virBufferAdjustIndent(buf, 2);
if (type->name)
@ -242,7 +242,7 @@ virNodeDeviceCapMdevTypesFormat(virBufferPtr buf,
static void
virNodeDeviceCapPCIDefFormat(virBufferPtr buf,
virNodeDeviceCapPCIDefFormat(virBuffer *buf,
const virNodeDevCapData *data)
{
size_t i;
@ -341,7 +341,7 @@ virNodeDeviceCapPCIDefFormat(virBufferPtr buf,
static void
virNodeDeviceCapUSBDevDefFormat(virBufferPtr buf,
virNodeDeviceCapUSBDevDefFormat(virBuffer *buf,
const virNodeDevCapData *data)
{
virBufferAsprintf(buf, "<bus>%d</bus>\n", data->usb_dev.bus);
@ -365,7 +365,7 @@ virNodeDeviceCapUSBDevDefFormat(virBufferPtr buf,
static void
virNodeDeviceCapUSBInterfaceDefFormat(virBufferPtr buf,
virNodeDeviceCapUSBInterfaceDefFormat(virBuffer *buf,
const virNodeDevCapData *data)
{
virBufferAsprintf(buf, "<number>%d</number>\n",
@ -384,7 +384,7 @@ virNodeDeviceCapUSBInterfaceDefFormat(virBufferPtr buf,
static void
virNodeDeviceCapNetDefFormat(virBufferPtr buf,
virNodeDeviceCapNetDefFormat(virBuffer *buf,
const virNodeDevCapData *data)
{
size_t i;
@ -413,7 +413,7 @@ virNodeDeviceCapNetDefFormat(virBufferPtr buf,
static void
virNodeDeviceCapSCSIHostDefFormat(virBufferPtr buf,
virNodeDeviceCapSCSIHostDefFormat(virBuffer *buf,
const virNodeDevCapData *data)
{
virBufferAsprintf(buf, "<host>%d</host>\n",
@ -447,7 +447,7 @@ virNodeDeviceCapSCSIHostDefFormat(virBufferPtr buf,
static void
virNodeDeviceCapSCSIDefFormat(virBufferPtr buf,
virNodeDeviceCapSCSIDefFormat(virBuffer *buf,
const virNodeDevCapData *data)
{
virBufferAsprintf(buf, "<host>%d</host>\n", data->scsi.host);
@ -462,7 +462,7 @@ virNodeDeviceCapSCSIDefFormat(virBufferPtr buf,
static void
virNodeDeviceCapStorageDefFormat(virBufferPtr buf,
virNodeDeviceCapStorageDefFormat(virBuffer *buf,
const virNodeDevCapData *data)
{
virBufferEscapeString(buf, "<block>%s</block>\n",
@ -521,7 +521,7 @@ virNodeDeviceCapStorageDefFormat(virBufferPtr buf,
}
static void
virNodeDeviceCapMdevDefFormat(virBufferPtr buf,
virNodeDeviceCapMdevDefFormat(virBuffer *buf,
const virNodeDevCapData *data)
{
size_t i;
@ -532,14 +532,14 @@ virNodeDeviceCapMdevDefFormat(virBufferPtr buf,
data->mdev.iommuGroupNumber);
for (i = 0; i < data->mdev.nattributes; i++) {
virMediatedDeviceAttrPtr attr = data->mdev.attributes[i];
virMediatedDeviceAttr *attr = data->mdev.attributes[i];
virBufferAsprintf(buf, "<attr name='%s' value='%s'/>\n",
attr->name, attr->value);
}
}
static void
virNodeDeviceCapVDPADefFormat(virBufferPtr buf,
virNodeDeviceCapVDPADefFormat(virBuffer *buf,
const virNodeDevCapData *data)
{
virBufferEscapeString(buf, "<chardev>%s</chardev>\n", data->vdpa.chardev);
@ -547,7 +547,7 @@ virNodeDeviceCapVDPADefFormat(virBufferPtr buf,
static void
virNodeDeviceCapCCWDefFormat(virBufferPtr buf,
virNodeDeviceCapCCWDefFormat(virBuffer *buf,
const virNodeDevCapData *data)
{
virBufferAsprintf(buf, "<cssid>0x%x</cssid>\n",
@ -567,7 +567,7 @@ char *
virNodeDeviceDefFormat(const virNodeDeviceDef *def)
{
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
virNodeDevCapsDefPtr caps;
virNodeDevCapsDef *caps;
size_t i = 0;
virBufferAddLit(&buf, "<device>\n");
@ -593,7 +593,7 @@ virNodeDeviceDefFormat(const virNodeDeviceDef *def)
}
for (caps = def->caps; caps; caps = caps->next) {
virNodeDevCapDataPtr data = &caps->data;
virNodeDevCapData *data = &caps->data;
virBufferAsprintf(&buf, "<capability type='%s'>\n",
virNodeDevCapTypeToString(caps->data.type));
@ -704,7 +704,7 @@ static int
virNodeDevCapsDefParseIntOptional(const char *xpath,
xmlXPathContextPtr ctxt,
int *value,
virNodeDeviceDefPtr def,
virNodeDeviceDef *def,
const char *invalid_error_fmt)
{
int ret;
@ -728,7 +728,7 @@ static int
virNodeDevCapsDefParseULong(const char *xpath,
xmlXPathContextPtr ctxt,
unsigned *value,
virNodeDeviceDefPtr def,
virNodeDeviceDef *def,
const char *missing_error_fmt,
const char *invalid_error_fmt)
{
@ -752,7 +752,7 @@ static int
virNodeDevCapsDefParseULongLong(const char *xpath,
xmlXPathContextPtr ctxt,
unsigned long long *value,
virNodeDeviceDefPtr def,
virNodeDeviceDef *def,
const char *missing_error_fmt,
const char *invalid_error_fmt)
{
@ -774,9 +774,9 @@ virNodeDevCapsDefParseULongLong(const char *xpath,
static int
virNodeDevCapDRMParseXML(xmlXPathContextPtr ctxt,
virNodeDeviceDefPtr def,
virNodeDeviceDef *def,
xmlNodePtr node,
virNodeDevCapDRMPtr drm)
virNodeDevCapDRM *drm)
{
VIR_XPATH_NODE_AUTORESTORE(ctxt)
int val;
@ -799,14 +799,14 @@ virNodeDevCapDRMParseXML(xmlXPathContextPtr ctxt,
static int
virNodeDevCapMdevTypesParseXML(xmlXPathContextPtr ctxt,
virMediatedDeviceTypePtr **mdev_types,
virMediatedDeviceType ***mdev_types,
size_t *nmdev_types)
{
int ret = -1;
xmlNodePtr orignode = NULL;
g_autofree xmlNodePtr *nodes = NULL;
int ntypes = -1;
virMediatedDeviceTypePtr type = NULL;
virMediatedDeviceType *type = NULL;
size_t i;
if ((ntypes = virXPathNodeSet("./type", ctxt, &nodes)) < 0)
@ -865,7 +865,7 @@ virNodeDevCapMdevTypesParseXML(xmlXPathContextPtr ctxt,
static int
virNodeDevAPMatrixCapabilityParseXML(xmlXPathContextPtr ctxt,
xmlNodePtr node,
virNodeDevCapAPMatrixPtr apm_dev)
virNodeDevCapAPMatrix *apm_dev)
{
g_autofree char *type = virXMLPropString(node, "type");
VIR_XPATH_NODE_AUTORESTORE(ctxt)
@ -892,7 +892,7 @@ virNodeDevAPMatrixCapabilityParseXML(xmlXPathContextPtr ctxt,
static int
virNodeDevCSSCapabilityParseXML(xmlXPathContextPtr ctxt,
xmlNodePtr node,
virNodeDevCapCCWPtr ccw_dev)
virNodeDevCapCCW *ccw_dev)
{
g_autofree char *type = virXMLPropString(node, "type");
VIR_XPATH_NODE_AUTORESTORE(ctxt)
@ -918,9 +918,9 @@ virNodeDevCSSCapabilityParseXML(xmlXPathContextPtr ctxt,
static int
virNodeDevCapCCWParseXML(xmlXPathContextPtr ctxt,
virNodeDeviceDefPtr def,
virNodeDeviceDef *def,
xmlNodePtr node,
virNodeDevCapCCWPtr ccw_dev)
virNodeDevCapCCW *ccw_dev)
{
VIR_XPATH_NODE_AUTORESTORE(ctxt)
g_autofree xmlNodePtr *nodes = NULL;
@ -985,7 +985,7 @@ virNodeDevCapCCWParseXML(xmlXPathContextPtr ctxt,
static int
virNodeDevCapAPAdapterParseXML(xmlXPathContextPtr ctxt,
virNodeDeviceDefPtr def,
virNodeDeviceDef *def,
unsigned int *ap_adapter)
{
g_autofree char *adapter = NULL;
@ -1009,9 +1009,9 @@ virNodeDevCapAPAdapterParseXML(xmlXPathContextPtr ctxt,
static int
virNodeDevCapAPCardParseXML(xmlXPathContextPtr ctxt,
virNodeDeviceDefPtr def,
virNodeDeviceDef *def,
xmlNodePtr node,
virNodeDevCapAPCardPtr ap_card)
virNodeDevCapAPCard *ap_card)
{
VIR_XPATH_NODE_AUTORESTORE(ctxt)
ctxt->node = node;
@ -1022,9 +1022,9 @@ virNodeDevCapAPCardParseXML(xmlXPathContextPtr ctxt,
static int
virNodeDevCapAPQueueParseXML(xmlXPathContextPtr ctxt,
virNodeDeviceDefPtr def,
virNodeDeviceDef *def,
xmlNodePtr node,
virNodeDevCapAPQueuePtr ap_queue)
virNodeDevCapAPQueue *ap_queue)
{
int ret = -1;
VIR_XPATH_NODE_AUTORESTORE(ctxt)
@ -1063,9 +1063,9 @@ virNodeDevCapAPQueueParseXML(xmlXPathContextPtr ctxt,
static int
virNodeDevCapAPMatrixParseXML(xmlXPathContextPtr ctxt,
virNodeDeviceDefPtr def G_GNUC_UNUSED,
virNodeDeviceDef *def G_GNUC_UNUSED,
xmlNodePtr node,
virNodeDevCapAPMatrixPtr ap_matrix)
virNodeDevCapAPMatrix *ap_matrix)
{
VIR_XPATH_NODE_AUTORESTORE(ctxt)
g_autofree xmlNodePtr *nodes = NULL;
@ -1088,9 +1088,9 @@ virNodeDevCapAPMatrixParseXML(xmlXPathContextPtr ctxt,
static int
virNodeDevCapStorageParseXML(xmlXPathContextPtr ctxt,
virNodeDeviceDefPtr def,
virNodeDeviceDef *def,
xmlNodePtr node,
virNodeDevCapStoragePtr storage)
virNodeDevCapStorage *storage)
{
VIR_XPATH_NODE_AUTORESTORE(ctxt)
g_autofree xmlNodePtr *nodes = NULL;
@ -1174,9 +1174,9 @@ virNodeDevCapStorageParseXML(xmlXPathContextPtr ctxt,
static int
virNodeDevCapSCSIParseXML(xmlXPathContextPtr ctxt,
virNodeDeviceDefPtr def,
virNodeDeviceDef *def,
xmlNodePtr node,
virNodeDevCapSCSIPtr scsi)
virNodeDevCapSCSI *scsi)
{
VIR_XPATH_NODE_AUTORESTORE(ctxt)
@ -1214,9 +1214,9 @@ virNodeDevCapSCSIParseXML(xmlXPathContextPtr ctxt,
static int
virNodeDevCapSCSITargetParseXML(xmlXPathContextPtr ctxt,
virNodeDeviceDefPtr def,
virNodeDeviceDef *def,
xmlNodePtr node,
virNodeDevCapSCSITargetPtr scsi_target)
virNodeDevCapSCSITarget *scsi_target)
{
VIR_XPATH_NODE_AUTORESTORE(ctxt)
g_autofree xmlNodePtr *nodes = NULL;
@ -1281,9 +1281,9 @@ virNodeDevCapSCSITargetParseXML(xmlXPathContextPtr ctxt,
static int
virNodeDevCapSCSIHostParseXML(xmlXPathContextPtr ctxt,
virNodeDeviceDefPtr def,
virNodeDeviceDef *def,
xmlNodePtr node,
virNodeDevCapSCSIHostPtr scsi_host,
virNodeDevCapSCSIHost *scsi_host,
int create,
const char *virt_type)
{
@ -1376,9 +1376,9 @@ virNodeDevCapSCSIHostParseXML(xmlXPathContextPtr ctxt,
static int
virNodeDevCapNetParseXML(xmlXPathContextPtr ctxt,
virNodeDeviceDefPtr def,
virNodeDeviceDef *def,
xmlNodePtr node,
virNodeDevCapNetPtr net)
virNodeDevCapNet *net)
{
VIR_XPATH_NODE_AUTORESTORE(ctxt)
xmlNodePtr lnk;
@ -1447,9 +1447,9 @@ virNodeDevCapNetParseXML(xmlXPathContextPtr ctxt,
static int
virNodeDevCapUSBInterfaceParseXML(xmlXPathContextPtr ctxt,
virNodeDeviceDefPtr def,
virNodeDeviceDef *def,
xmlNodePtr node,
virNodeDevCapUSBIfPtr usb_if)
virNodeDevCapUSBIf *usb_if)
{
VIR_XPATH_NODE_AUTORESTORE(ctxt)
@ -1489,7 +1489,7 @@ static int
virNodeDevCapsDefParseHexId(const char *xpath,
xmlXPathContextPtr ctxt,
unsigned *value,
virNodeDeviceDefPtr def,
virNodeDeviceDef *def,
const char *missing_error_fmt,
const char *invalid_error_fmt)
{
@ -1511,9 +1511,9 @@ virNodeDevCapsDefParseHexId(const char *xpath,
static int
virNodeDevCapUSBDevParseXML(xmlXPathContextPtr ctxt,
virNodeDeviceDefPtr def,
virNodeDeviceDef *def,
xmlNodePtr node,
virNodeDevCapUSBDevPtr usb_dev)
virNodeDevCapUSBDev *usb_dev)
{
VIR_XPATH_NODE_AUTORESTORE(ctxt)
@ -1553,7 +1553,7 @@ virNodeDevCapUSBDevParseXML(xmlXPathContextPtr ctxt,
static int
virNodeDevCapPCIDevIommuGroupParseXML(xmlXPathContextPtr ctxt,
xmlNodePtr iommuGroupNode,
virNodeDevCapPCIDevPtr pci_dev)
virNodeDevCapPCIDev *pci_dev)
{
VIR_XPATH_NODE_AUTORESTORE(ctxt)
g_autofree xmlNodePtr *addrNodes = NULL;
@ -1598,7 +1598,7 @@ virNodeDevCapPCIDevIommuGroupParseXML(xmlXPathContextPtr ctxt,
static int
virPCIEDeviceInfoLinkParseXML(xmlXPathContextPtr ctxt,
xmlNodePtr linkNode,
virPCIELinkPtr lnk)
virPCIELink *lnk)
{
VIR_XPATH_NODE_AUTORESTORE(ctxt)
int speed;
@ -1641,7 +1641,7 @@ virPCIEDeviceInfoLinkParseXML(xmlXPathContextPtr ctxt,
static int
virPCIEDeviceInfoParseXML(xmlXPathContextPtr ctxt,
xmlNodePtr pciExpressNode,
virPCIEDeviceInfoPtr pci_express)
virPCIEDeviceInfo *pci_express)
{
VIR_XPATH_NODE_AUTORESTORE(ctxt)
xmlNodePtr lnk;
@ -1670,7 +1670,7 @@ virPCIEDeviceInfoParseXML(xmlXPathContextPtr ctxt,
static int
virNodeDevPCICapSRIOVPhysicalParseXML(xmlXPathContextPtr ctxt,
virNodeDevCapPCIDevPtr pci_dev)
virNodeDevCapPCIDev *pci_dev)
{
xmlNodePtr address = virXPathNode("./address[1]", ctxt);
@ -1694,7 +1694,7 @@ virNodeDevPCICapSRIOVPhysicalParseXML(xmlXPathContextPtr ctxt,
static int
virNodeDevPCICapSRIOVVirtualParseXML(xmlXPathContextPtr ctxt,
virNodeDevCapPCIDevPtr pci_dev)
virNodeDevCapPCIDev *pci_dev)
{
g_autofree xmlNodePtr *addresses = NULL;
int naddresses = virXPathNodeSet("./address", ctxt, &addresses);
@ -1712,7 +1712,7 @@ virNodeDevPCICapSRIOVVirtualParseXML(xmlXPathContextPtr ctxt,
return -1;
}
pci_dev->virtual_functions = g_new0(virPCIDeviceAddressPtr, naddresses);
pci_dev->virtual_functions = g_new0(virPCIDeviceAddress *, naddresses);
for (i = 0; i < naddresses; i++) {
g_autoptr(virPCIDeviceAddress) addr = NULL;
@ -1736,7 +1736,7 @@ virNodeDevPCICapSRIOVVirtualParseXML(xmlXPathContextPtr ctxt,
static int
virNodeDevPCICapabilityParseXML(xmlXPathContextPtr ctxt,
xmlNodePtr node,
virNodeDevCapPCIDevPtr pci_dev)
virNodeDevCapPCIDev *pci_dev)
{
g_autofree char *type = virXMLPropString(node, "type");
VIR_XPATH_NODE_AUTORESTORE(ctxt)
@ -1773,9 +1773,9 @@ virNodeDevPCICapabilityParseXML(xmlXPathContextPtr ctxt,
static int
virNodeDevCapPCIDevParseXML(xmlXPathContextPtr ctxt,
virNodeDeviceDefPtr def,
virNodeDeviceDef *def,
xmlNodePtr node,
virNodeDevCapPCIDevPtr pci_dev)
virNodeDevCapPCIDev *pci_dev)
{
VIR_XPATH_NODE_AUTORESTORE(ctxt)
xmlNodePtr iommuGroupNode;
@ -1783,7 +1783,7 @@ virNodeDevCapPCIDevParseXML(xmlXPathContextPtr ctxt,
g_autofree xmlNodePtr *nodes = NULL;
int n = 0;
int ret = -1;
virPCIEDeviceInfoPtr pci_express = NULL;
virPCIEDeviceInfo *pci_express = NULL;
g_autofree char *tmp = NULL;
size_t i = 0;
@ -1880,12 +1880,12 @@ virNodeDevCapPCIDevParseXML(xmlXPathContextPtr ctxt,
static int
virNodeDevCapSystemParseXML(xmlXPathContextPtr ctxt,
virNodeDeviceDefPtr def,
virNodeDeviceDef *def,
xmlNodePtr node,
virNodeDevCapSystemPtr syscap)
virNodeDevCapSystem *syscap)
{
virNodeDevCapSystemHardwarePtr hardware = &syscap->hardware;
virNodeDevCapSystemFirmwarePtr firmware = &syscap->firmware;
virNodeDevCapSystemHardware *hardware = &syscap->hardware;
virNodeDevCapSystemFirmware *firmware = &syscap->firmware;
VIR_XPATH_NODE_AUTORESTORE(ctxt)
g_autofree char *tmp = NULL;
@ -1920,7 +1920,7 @@ virNodeDevCapSystemParseXML(xmlXPathContextPtr ctxt,
static int
virNodeDevCapMdevAttributeParseXML(xmlXPathContextPtr ctxt,
xmlNodePtr node,
virNodeDevCapMdevPtr mdev)
virNodeDevCapMdev *mdev)
{
VIR_XPATH_NODE_AUTORESTORE(ctxt)
g_autoptr(virMediatedDeviceAttr) attr = virMediatedDeviceAttrNew();
@ -1941,9 +1941,9 @@ virNodeDevCapMdevAttributeParseXML(xmlXPathContextPtr ctxt,
static int
virNodeDevCapMdevParseXML(xmlXPathContextPtr ctxt,
virNodeDeviceDefPtr def,
virNodeDeviceDef *def,
xmlNodePtr node,
virNodeDevCapMdevPtr mdev)
virNodeDevCapMdev *mdev)
{
VIR_XPATH_NODE_AUTORESTORE(ctxt)
int nattrs = 0;
@ -1991,14 +1991,14 @@ virNodeDevCapMdevParseXML(xmlXPathContextPtr ctxt,
}
static virNodeDevCapsDefPtr
static virNodeDevCapsDef *
virNodeDevCapsDefParseXML(xmlXPathContextPtr ctxt,
virNodeDeviceDefPtr def,
virNodeDeviceDef *def,
xmlNodePtr node,
int create,
const char *virt_type)
{
virNodeDevCapsDefPtr caps;
virNodeDevCapsDef *caps;
g_autofree char *tmp = NULL;
int val, ret = -1;
@ -2097,13 +2097,13 @@ virNodeDevCapsDefParseXML(xmlXPathContextPtr ctxt,
}
static virNodeDeviceDefPtr
static virNodeDeviceDef *
virNodeDeviceDefParseXML(xmlXPathContextPtr ctxt,
int create,
const char *virt_type)
{
virNodeDeviceDefPtr def;
virNodeDevCapsDefPtr *next_cap;
virNodeDeviceDef *def;
virNodeDevCapsDef **next_cap;
xmlNodePtr *nodes = NULL;
int n, m;
size_t i;
@ -2219,7 +2219,7 @@ virNodeDeviceDefParseXML(xmlXPathContextPtr ctxt,
}
virNodeDeviceDefPtr
virNodeDeviceDef *
virNodeDeviceDefParseNode(xmlDocPtr xml,
xmlNodePtr root,
int create,
@ -2243,14 +2243,14 @@ virNodeDeviceDefParseNode(xmlDocPtr xml,
}
static virNodeDeviceDefPtr
static virNodeDeviceDef *
virNodeDeviceDefParse(const char *str,
const char *filename,
int create,
const char *virt_type)
{
xmlDocPtr xml;
virNodeDeviceDefPtr def = NULL;
virNodeDeviceDef *def = NULL;
if ((xml = virXMLParse(filename, str, _("(node_device_definition)")))) {
def = virNodeDeviceDefParseNode(xml, xmlDocGetRootElement(xml),
@ -2262,7 +2262,7 @@ virNodeDeviceDefParse(const char *str,
}
virNodeDeviceDefPtr
virNodeDeviceDef *
virNodeDeviceDefParseString(const char *str,
int create,
const char *virt_type)
@ -2271,7 +2271,7 @@ virNodeDeviceDefParseString(const char *str,
}
virNodeDeviceDefPtr
virNodeDeviceDef *
virNodeDeviceDefParseFile(const char *filename,
int create,
const char *virt_type)
@ -2284,11 +2284,11 @@ virNodeDeviceDefParseFile(const char *filename,
* Return fc_host dev's WWNN and WWPN
*/
int
virNodeDeviceGetWWNs(virNodeDeviceDefPtr def,
virNodeDeviceGetWWNs(virNodeDeviceDef *def,
char **wwnn,
char **wwpn)
{
virNodeDevCapsDefPtr cap = NULL;
virNodeDevCapsDef *cap = NULL;
cap = def->caps;
while (cap != NULL) {
@ -2313,10 +2313,10 @@ virNodeDeviceGetWWNs(virNodeDeviceDefPtr def,
void
virNodeDevCapsDefFree(virNodeDevCapsDefPtr caps)
virNodeDevCapsDefFree(virNodeDevCapsDef *caps)
{
size_t i = 0;
virNodeDevCapDataPtr data = &caps->data;
virNodeDevCapData *data = &caps->data;
switch (caps->data.type) {
case VIR_NODE_DEV_CAP_SYSTEM:
@ -2416,9 +2416,9 @@ virNodeDevCapsDefFree(virNodeDevCapsDefPtr caps)
int
virNodeDeviceUpdateCaps(virNodeDeviceDefPtr def)
virNodeDeviceUpdateCaps(virNodeDeviceDef *def)
{
virNodeDevCapsDefPtr cap = def->caps;
virNodeDevCapsDef *cap = def->caps;
while (cap) {
switch (cap->data.type) {
@ -2495,10 +2495,10 @@ virNodeDeviceUpdateCaps(virNodeDeviceDefPtr def)
* Returns the number of capabilities the device supports, -1 on error.
*/
int
virNodeDeviceCapsListExport(virNodeDeviceDefPtr def,
virNodeDeviceCapsListExport(virNodeDeviceDef *def,
virNodeDevCapType **list)
{
virNodeDevCapsDefPtr caps = NULL;
virNodeDevCapsDef *caps = NULL;
g_autofree virNodeDevCapType *tmp = NULL;
bool want_list = !!list;
int ncaps = 0;
@ -2576,7 +2576,7 @@ virNodeDeviceCapsListExport(virNodeDeviceDefPtr def,
#ifdef __linux__
int
virNodeDeviceGetSCSIHostCaps(virNodeDevCapSCSIHostPtr scsi_host)
virNodeDeviceGetSCSIHostCaps(virNodeDevCapSCSIHost *scsi_host)
{
g_autofree char *tmp = NULL;
int ret = -1;
@ -2657,7 +2657,7 @@ virNodeDeviceGetSCSIHostCaps(virNodeDevCapSCSIHostPtr scsi_host)
int
virNodeDeviceGetSCSITargetCaps(const char *sysfsPath,
virNodeDevCapSCSITargetPtr scsi_target)
virNodeDevCapSCSITarget *scsi_target)
{
int ret = -1;
g_autofree char *dir = NULL;
@ -2698,7 +2698,7 @@ virNodeDeviceGetSCSITargetCaps(const char *sysfsPath,
static int
virNodeDeviceGetPCISRIOVCaps(const char *sysfsPath,
virNodeDevCapPCIDevPtr pci_dev)
virNodeDevCapPCIDev *pci_dev)
{
size_t i;
int ret;
@ -2736,7 +2736,7 @@ virNodeDeviceGetPCISRIOVCaps(const char *sysfsPath,
static int
virNodeDeviceGetPCIIOMMUGroupCaps(virNodeDevCapPCIDevPtr pci_dev)
virNodeDeviceGetPCIIOMMUGroupCaps(virNodeDevCapPCIDev *pci_dev)
{
size_t i;
int tmpGroup;
@ -2774,10 +2774,10 @@ virNodeDeviceGetPCIIOMMUGroupCaps(virNodeDevCapPCIDevPtr pci_dev)
static int
virNodeDeviceGetMdevTypesCaps(const char *sysfspath,
virMediatedDeviceTypePtr **mdev_types,
virMediatedDeviceType ***mdev_types,
size_t *nmdev_types)
{
virMediatedDeviceTypePtr *types = NULL;
virMediatedDeviceType **types = NULL;
size_t ntypes = 0;
size_t i;
@ -2805,7 +2805,7 @@ virNodeDeviceGetMdevTypesCaps(const char *sysfspath,
*/
int
virNodeDeviceGetPCIDynamicCaps(const char *sysfsPath,
virNodeDevCapPCIDevPtr pci_dev)
virNodeDevCapPCIDev *pci_dev)
{
if (virNodeDeviceGetPCISRIOVCaps(sysfsPath, pci_dev) < 0 ||
virNodeDeviceGetPCIIOMMUGroupCaps(pci_dev) < 0)
@ -2831,7 +2831,7 @@ virNodeDeviceGetPCIDynamicCaps(const char *sysfsPath,
*/
int
virNodeDeviceGetCSSDynamicCaps(const char *sysfsPath,
virNodeDevCapCCWPtr ccw_dev)
virNodeDevCapCCW *ccw_dev)
{
ccw_dev->flags &= ~VIR_NODE_DEV_CAP_FLAG_CSS_MDEV;
if (virNodeDeviceGetMdevTypesCaps(sysfsPath,
@ -2852,7 +2852,7 @@ virNodeDeviceGetCSSDynamicCaps(const char *sysfsPath,
*/
int
virNodeDeviceGetAPMatrixDynamicCaps(const char *sysfsPath,
virNodeDevCapAPMatrixPtr ap_matrix)
virNodeDevCapAPMatrix *ap_matrix)
{
ap_matrix->flags &= ~VIR_NODE_DEV_CAP_FLAG_AP_MATRIX_MDEV;
if (virNodeDeviceGetMdevTypesCaps(sysfsPath,
@ -2868,35 +2868,35 @@ virNodeDeviceGetAPMatrixDynamicCaps(const char *sysfsPath,
#else
int
virNodeDeviceGetSCSIHostCaps(virNodeDevCapSCSIHostPtr scsi_host G_GNUC_UNUSED)
virNodeDeviceGetSCSIHostCaps(virNodeDevCapSCSIHost *scsi_host G_GNUC_UNUSED)
{
return -1;
}
int
virNodeDeviceGetPCIDynamicCaps(const char *sysfsPath G_GNUC_UNUSED,
virNodeDevCapPCIDevPtr pci_dev G_GNUC_UNUSED)
virNodeDevCapPCIDev *pci_dev G_GNUC_UNUSED)
{
return -1;
}
int virNodeDeviceGetSCSITargetCaps(const char *sysfsPath G_GNUC_UNUSED,
virNodeDevCapSCSITargetPtr scsi_target G_GNUC_UNUSED)
virNodeDevCapSCSITarget *scsi_target G_GNUC_UNUSED)
{
return -1;
}
int
virNodeDeviceGetCSSDynamicCaps(const char *sysfsPath G_GNUC_UNUSED,
virNodeDevCapCCWPtr ccw_dev G_GNUC_UNUSED)
virNodeDevCapCCW *ccw_dev G_GNUC_UNUSED)
{
return -1;
}
int
virNodeDeviceGetAPMatrixDynamicCaps(const char *sysfsPath G_GNUC_UNUSED,
virNodeDevCapAPMatrixPtr ap_matrix G_GNUC_UNUSED)
virNodeDevCapAPMatrix *ap_matrix G_GNUC_UNUSED)
{
return -1;
}

View File

@ -125,7 +125,6 @@ typedef enum {
VIR_ENUM_DECL(virNodeDevDRM);
typedef struct _virNodeDevCapSystemHardware virNodeDevCapSystemHardware;
typedef virNodeDevCapSystemHardware *virNodeDevCapSystemHardwarePtr;
struct _virNodeDevCapSystemHardware {
char *vendor_name;
char *version;
@ -134,7 +133,6 @@ struct _virNodeDevCapSystemHardware {
};
typedef struct _virNodeDevCapSystemFirmware virNodeDevCapSystemFirmware;
typedef virNodeDevCapSystemFirmware *virNodeDevCapSystemFirmwarePtr;
struct _virNodeDevCapSystemFirmware {
char *vendor_name;
char *version;
@ -142,7 +140,6 @@ struct _virNodeDevCapSystemFirmware {
};
typedef struct _virNodeDevCapSystem virNodeDevCapSystem;
typedef virNodeDevCapSystem *virNodeDevCapSystemPtr;
struct _virNodeDevCapSystem {
char *product_name;
virNodeDevCapSystemHardware hardware;
@ -150,17 +147,15 @@ struct _virNodeDevCapSystem {
};
typedef struct _virNodeDevCapMdev virNodeDevCapMdev;
typedef virNodeDevCapMdev *virNodeDevCapMdevPtr;
struct _virNodeDevCapMdev {
char *type;
unsigned int iommuGroupNumber;
char *uuid;
virMediatedDeviceAttrPtr *attributes;
virMediatedDeviceAttr **attributes;
size_t nattributes;
};
typedef struct _virNodeDevCapPCIDev virNodeDevCapPCIDev;
typedef virNodeDevCapPCIDev *virNodeDevCapPCIDevPtr;
struct _virNodeDevCapPCIDev {
unsigned int domain;
unsigned int bus;
@ -171,23 +166,22 @@ struct _virNodeDevCapPCIDev {
int klass;
char *product_name;
char *vendor_name;
virPCIDeviceAddressPtr physical_function;
virPCIDeviceAddressPtr *virtual_functions;
virPCIDeviceAddress *physical_function;
virPCIDeviceAddress **virtual_functions;
size_t num_virtual_functions;
unsigned int max_virtual_functions;
unsigned int flags;
virPCIDeviceAddressPtr *iommuGroupDevices;
virPCIDeviceAddress **iommuGroupDevices;
size_t nIommuGroupDevices;
unsigned int iommuGroupNumber;
int numa_node;
virPCIEDeviceInfoPtr pci_express;
virPCIEDeviceInfo *pci_express;
int hdrType; /* enum virPCIHeaderType or -1 */
virMediatedDeviceTypePtr *mdev_types;
virMediatedDeviceType **mdev_types;
size_t nmdev_types;
};
typedef struct _virNodeDevCapUSBDev virNodeDevCapUSBDev;
typedef virNodeDevCapUSBDev *virNodeDevCapUSBDevPtr;
struct _virNodeDevCapUSBDev {
unsigned int bus;
unsigned int device;
@ -198,7 +192,6 @@ struct _virNodeDevCapUSBDev {
};
typedef struct _virNodeDevCapUSBIf virNodeDevCapUSBIf;
typedef virNodeDevCapUSBIf *virNodeDevCapUSBIfPtr;
struct _virNodeDevCapUSBIf {
unsigned int number;
unsigned int klass;
@ -208,18 +201,16 @@ struct _virNodeDevCapUSBIf {
};
typedef struct _virNodeDevCapNet virNodeDevCapNet;
typedef virNodeDevCapNet *virNodeDevCapNetPtr;
struct _virNodeDevCapNet {
char *address;
unsigned int address_len;
char *ifname;
virNetDevIfLink lnk;
virNodeDevNetCapType subtype; /* LAST -> no subtype */
virBitmapPtr features; /* enum virNetDevFeature */
virBitmap *features; /* enum virNetDevFeature */
};
typedef struct _virNodeDevCapSCSIHost virNodeDevCapSCSIHost;
typedef virNodeDevCapSCSIHost *virNodeDevCapSCSIHostPtr;
struct _virNodeDevCapSCSIHost {
unsigned int host;
int unique_id;
@ -232,7 +223,6 @@ struct _virNodeDevCapSCSIHost {
};
typedef struct _virNodeDevCapSCSITarget virNodeDevCapSCSITarget;
typedef virNodeDevCapSCSITarget *virNodeDevCapSCSITargetPtr;
struct _virNodeDevCapSCSITarget {
char *name;
unsigned int flags; /* enum virNodeDevSCSITargetCapsFlags */
@ -241,7 +231,6 @@ struct _virNodeDevCapSCSITarget {
};
typedef struct _virNodeDevCapSCSI virNodeDevCapSCSI;
typedef virNodeDevCapSCSI *virNodeDevCapSCSIPtr;
struct _virNodeDevCapSCSI {
unsigned int host;
unsigned int bus;
@ -251,7 +240,6 @@ struct _virNodeDevCapSCSI {
};
typedef struct _virNodeDevCapStorage virNodeDevCapStorage;
typedef virNodeDevCapStorage *virNodeDevCapStoragePtr;
struct _virNodeDevCapStorage {
unsigned long long size;
unsigned long long num_blocks;
@ -268,58 +256,50 @@ struct _virNodeDevCapStorage {
};
typedef struct _virNodeDevCapSCSIGeneric virNodeDevCapSCSIGeneric;
typedef virNodeDevCapSCSIGeneric *virNodeDevCapSCSIGenericPtr;
struct _virNodeDevCapSCSIGeneric {
char *path;
};
typedef struct _virNodeDevCapDRM virNodeDevCapDRM;
typedef virNodeDevCapDRM *virNodeDevCapDRMPtr;
struct _virNodeDevCapDRM {
virNodeDevDRMType type;
};
typedef struct _virNodeDevCapCCW virNodeDevCapCCW;
typedef virNodeDevCapCCW *virNodeDevCapCCWPtr;
struct _virNodeDevCapCCW {
unsigned int cssid;
unsigned int ssid;
unsigned int devno;
unsigned int flags; /* enum virNodeDevCCWCapFlags */
virMediatedDeviceTypePtr *mdev_types;
virMediatedDeviceType **mdev_types;
size_t nmdev_types;
};
typedef struct _virNodeDevCapVDPA virNodeDevCapVDPA;
typedef virNodeDevCapVDPA *virNodeDevCapVDPAPtr;
struct _virNodeDevCapVDPA {
char *chardev;
};
typedef struct _virNodeDevCapAPCard virNodeDevCapAPCard;
typedef virNodeDevCapAPCard *virNodeDevCapAPCardPtr;
struct _virNodeDevCapAPCard {
unsigned int ap_adapter;
};
typedef struct _virNodeDevCapAPQueue virNodeDevCapAPQueue;
typedef virNodeDevCapAPQueue *virNodeDevCapAPQueuePtr;
struct _virNodeDevCapAPQueue {
unsigned int ap_adapter;
unsigned int ap_domain;
};
typedef struct _virNodeDevCapAPMatrix virNodeDevCapAPMatrix;
typedef virNodeDevCapAPMatrix *virNodeDevCapAPMatrixPtr;
struct _virNodeDevCapAPMatrix {
char *addr;
unsigned int flags; /* enum virNodeDevAPMatrixCapFlags */
virMediatedDeviceTypePtr *mdev_types;
virMediatedDeviceType **mdev_types;
size_t nmdev_types;
};
typedef struct _virNodeDevCapData virNodeDevCapData;
typedef virNodeDevCapData *virNodeDevCapDataPtr;
struct _virNodeDevCapData {
virNodeDevCapType type;
union {
@ -344,15 +324,13 @@ struct _virNodeDevCapData {
};
typedef struct _virNodeDevCapsDef virNodeDevCapsDef;
typedef virNodeDevCapsDef *virNodeDevCapsDefPtr;
struct _virNodeDevCapsDef {
virNodeDevCapData data;
virNodeDevCapsDefPtr next; /* next capability */
virNodeDevCapsDef *next; /* next capability */
};
typedef struct _virNodeDeviceDef virNodeDeviceDef;
typedef virNodeDeviceDef *virNodeDeviceDefPtr;
struct _virNodeDeviceDef {
char *name; /* device name (unique on node) */
char *sysfs_path; /* udev name/sysfs path */
@ -364,40 +342,40 @@ struct _virNodeDeviceDef {
char *driver; /* optional driver name */
char *devnode; /* /dev path */
char **devlinks; /* /dev links */
virNodeDevCapsDefPtr caps; /* optional device capabilities */
virNodeDevCapsDef *caps; /* optional device capabilities */
};
char *
virNodeDeviceDefFormat(const virNodeDeviceDef *def);
virNodeDeviceDefPtr
virNodeDeviceDef *
virNodeDeviceDefParseString(const char *str,
int create,
const char *virt_type);
virNodeDeviceDefPtr
virNodeDeviceDef *
virNodeDeviceDefParseFile(const char *filename,
int create,
const char *virt_type);
virNodeDeviceDefPtr
virNodeDeviceDef *
virNodeDeviceDefParseNode(xmlDocPtr xml,
xmlNodePtr root,
int create,
const char *virt_type);
int
virNodeDeviceGetWWNs(virNodeDeviceDefPtr def,
virNodeDeviceGetWWNs(virNodeDeviceDef *def,
char **wwnn,
char **wwpn);
void
virNodeDeviceDefFree(virNodeDeviceDefPtr def);
virNodeDeviceDefFree(virNodeDeviceDef *def);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(virNodeDeviceDef, virNodeDeviceDefFree);
void
virNodeDevCapsDefFree(virNodeDevCapsDefPtr caps);
virNodeDevCapsDefFree(virNodeDevCapsDef *caps);
#define VIR_CONNECT_LIST_NODE_DEVICES_FILTERS_CAP \
(VIR_CONNECT_LIST_NODE_DEVICES_CAP_SYSTEM | \
@ -431,27 +409,27 @@ virNodeDevCapsDefFree(virNodeDevCapsDefPtr caps);
VIR_CONNECT_LIST_NODE_DEVICES_FILTERS_ACTIVE
int
virNodeDeviceGetSCSIHostCaps(virNodeDevCapSCSIHostPtr scsi_host);
virNodeDeviceGetSCSIHostCaps(virNodeDevCapSCSIHost *scsi_host);
int
virNodeDeviceGetSCSITargetCaps(const char *sysfsPath,
virNodeDevCapSCSITargetPtr scsi_target);
virNodeDevCapSCSITarget *scsi_target);
int
virNodeDeviceGetPCIDynamicCaps(const char *sysfsPath,
virNodeDevCapPCIDevPtr pci_dev);
virNodeDevCapPCIDev *pci_dev);
int
virNodeDeviceGetCSSDynamicCaps(const char *sysfsPath,
virNodeDevCapCCWPtr ccw_dev);
virNodeDevCapCCW *ccw_dev);
int
virNodeDeviceGetAPMatrixDynamicCaps(const char *sysfsPath,
virNodeDevCapAPMatrixPtr ap_matrix);
virNodeDevCapAPMatrix *ap_matrix);
int
virNodeDeviceUpdateCaps(virNodeDeviceDefPtr def);
virNodeDeviceUpdateCaps(virNodeDeviceDef *def);
int
virNodeDeviceCapsListExport(virNodeDeviceDefPtr def,
virNodeDeviceCapsListExport(virNodeDeviceDef *def,
virNodeDevCapType **list);

View File

@ -37,7 +37,6 @@ struct _virNodeDeviceEvent {
bool dummy;
};
typedef struct _virNodeDeviceEvent virNodeDeviceEvent;
typedef virNodeDeviceEvent *virNodeDeviceEventPtr;
struct _virNodeDeviceEventLifecycle {
virNodeDeviceEvent parent;
@ -46,7 +45,6 @@ struct _virNodeDeviceEventLifecycle {
int detail;
};
typedef struct _virNodeDeviceEventLifecycle virNodeDeviceEventLifecycle;
typedef virNodeDeviceEventLifecycle *virNodeDeviceEventLifecyclePtr;
struct _virNodeDeviceEventUpdate {
virNodeDeviceEvent parent;
@ -54,11 +52,10 @@ struct _virNodeDeviceEventUpdate {
bool dummy;
};
typedef struct _virNodeDeviceEventUpdate virNodeDeviceEventUpdate;
typedef virNodeDeviceEventUpdate *virNodeDeviceEventUpdatePtr;
static virClassPtr virNodeDeviceEventClass;
static virClassPtr virNodeDeviceEventLifecycleClass;
static virClassPtr virNodeDeviceEventUpdateClass;
static virClass *virNodeDeviceEventClass;
static virClass *virNodeDeviceEventLifecycleClass;
static virClass *virNodeDeviceEventUpdateClass;
static void virNodeDeviceEventDispose(void *obj);
static void virNodeDeviceEventLifecycleDispose(void *obj);
static void virNodeDeviceEventUpdateDispose(void *obj);
@ -83,7 +80,7 @@ VIR_ONCE_GLOBAL_INIT(virNodeDeviceEvents);
static void
virNodeDeviceEventDispose(void *obj)
{
virNodeDeviceEventPtr event = obj;
virNodeDeviceEvent *event = obj;
VIR_DEBUG("obj=%p", event);
}
@ -91,7 +88,7 @@ virNodeDeviceEventDispose(void *obj)
static void
virNodeDeviceEventLifecycleDispose(void *obj)
{
virNodeDeviceEventLifecyclePtr event = obj;
virNodeDeviceEventLifecycle *event = obj;
VIR_DEBUG("obj=%p", event);
}
@ -99,14 +96,14 @@ virNodeDeviceEventLifecycleDispose(void *obj)
static void
virNodeDeviceEventUpdateDispose(void *obj)
{
virNodeDeviceEventUpdatePtr event = obj;
virNodeDeviceEventUpdate *event = obj;
VIR_DEBUG("obj=%p", event);
}
static void
virNodeDeviceEventDispatchDefaultFunc(virConnectPtr conn,
virObjectEventPtr event,
virObjectEvent *event,
virConnectObjectEventGenericCallback cb,
void *cbopaque)
{
@ -119,9 +116,9 @@ virNodeDeviceEventDispatchDefaultFunc(virConnectPtr conn,
switch ((virNodeDeviceEventID)event->eventID) {
case VIR_NODE_DEVICE_EVENT_ID_LIFECYCLE:
{
virNodeDeviceEventLifecyclePtr nodeDeviceLifecycleEvent;
virNodeDeviceEventLifecycle *nodeDeviceLifecycleEvent;
nodeDeviceLifecycleEvent = (virNodeDeviceEventLifecyclePtr)event;
nodeDeviceLifecycleEvent = (virNodeDeviceEventLifecycle *)event;
((virConnectNodeDeviceEventLifecycleCallback)cb)(conn, dev,
nodeDeviceLifecycleEvent->type,
nodeDeviceLifecycleEvent->detail,
@ -165,7 +162,7 @@ virNodeDeviceEventDispatchDefaultFunc(virConnectPtr conn,
*/
int
virNodeDeviceEventStateRegisterID(virConnectPtr conn,
virObjectEventStatePtr state,
virObjectEventState *state,
virNodeDevicePtr dev,
int eventID,
virConnectNodeDeviceEventGenericCallback cb,
@ -205,7 +202,7 @@ virNodeDeviceEventStateRegisterID(virConnectPtr conn,
*/
int
virNodeDeviceEventStateRegisterClient(virConnectPtr conn,
virObjectEventStatePtr state,
virObjectEventState *state,
virNodeDevicePtr dev,
int eventID,
virConnectNodeDeviceEventGenericCallback cb,
@ -233,12 +230,12 @@ virNodeDeviceEventStateRegisterClient(virConnectPtr conn,
*
* Create a new node device lifecycle event.
*/
virObjectEventPtr
virObjectEvent *
virNodeDeviceEventLifecycleNew(const char *name,
int type,
int detail)
{
virNodeDeviceEventLifecyclePtr event;
virNodeDeviceEventLifecycle *event;
if (virNodeDeviceEventsInitialize() < 0)
return NULL;
@ -252,7 +249,7 @@ virNodeDeviceEventLifecycleNew(const char *name,
event->type = type;
event->detail = detail;
return (virObjectEventPtr)event;
return (virObjectEvent *)event;
}
@ -262,10 +259,10 @@ virNodeDeviceEventLifecycleNew(const char *name,
*
* Create a new node device update event.
*/
virObjectEventPtr
virObjectEvent *
virNodeDeviceEventUpdateNew(const char *name)
{
virNodeDeviceEventUpdatePtr event;
virNodeDeviceEventUpdate *event;
if (virNodeDeviceEventsInitialize() < 0)
return NULL;
@ -276,5 +273,5 @@ virNodeDeviceEventUpdateNew(const char *name)
0, name, NULL, name)))
return NULL;
return (virObjectEventPtr)event;
return (virObjectEvent *)event;
}

View File

@ -28,7 +28,7 @@
int
virNodeDeviceEventStateRegisterID(virConnectPtr conn,
virObjectEventStatePtr state,
virObjectEventState *state,
virNodeDevicePtr dev,
int eventID,
virConnectNodeDeviceEventGenericCallback cb,
@ -40,7 +40,7 @@ virNodeDeviceEventStateRegisterID(virConnectPtr conn,
int
virNodeDeviceEventStateRegisterClient(virConnectPtr conn,
virObjectEventStatePtr state,
virObjectEventState *state,
virNodeDevicePtr dev,
int eventID,
virConnectNodeDeviceEventGenericCallback cb,
@ -50,10 +50,10 @@ virNodeDeviceEventStateRegisterClient(virConnectPtr conn,
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(5)
ATTRIBUTE_NONNULL(8);
virObjectEventPtr
virObjectEvent *
virNodeDeviceEventLifecycleNew(const char *name,
int type,
int detail);
virObjectEventPtr
virObjectEvent *
virNodeDeviceEventUpdateNew(const char *name);

View File

@ -75,7 +75,7 @@ virNodeDeviceGetParentName(virConnectPtr conn,
* Returns vHBA name on success, NULL on failure with an error message set
*/
char *
virNodeDeviceCreateVport(virStorageAdapterFCHostPtr fchost)
virNodeDeviceCreateVport(virStorageAdapterFCHost *fchost)
{
unsigned int parent_host;
char *name = NULL;
@ -159,7 +159,7 @@ virNodeDeviceCreateVport(virStorageAdapterFCHostPtr fchost)
*/
int
virNodeDeviceDeleteVport(virConnectPtr conn,
virStorageAdapterFCHostPtr fchost)
virStorageAdapterFCHost *fchost)
{
char *name = NULL;
char *scsi_host_name = NULL;

View File

@ -25,8 +25,8 @@ virNodeDeviceGetParentName(virConnectPtr conn,
const char *nodedev_name);
char *
virNodeDeviceCreateVport(virStorageAdapterFCHostPtr fchost);
virNodeDeviceCreateVport(virStorageAdapterFCHost *fchost);
int
virNodeDeviceDeleteVport(virConnectPtr conn,
virStorageAdapterFCHostPtr fchost);
virStorageAdapterFCHost *fchost);

View File

@ -82,29 +82,25 @@ VIR_ENUM_IMPL(virDomainMemoryLatency,
);
typedef struct _virDomainNumaDistance virDomainNumaDistance;
typedef virDomainNumaDistance *virDomainNumaDistancePtr;
typedef struct _virDomainNumaCache virDomainNumaCache;
typedef virDomainNumaCache *virDomainNumaCachePtr;
typedef struct _virDomainNumaInterconnect virDomainNumaInterconnect;
typedef virDomainNumaInterconnect *virDomainNumaInterconnectPtr;
typedef struct _virDomainNumaNode virDomainNumaNode;
typedef virDomainNumaNode *virDomainNumaNodePtr;
struct _virDomainNuma {
struct {
bool specified;
virBitmapPtr nodeset;
virBitmap *nodeset;
virDomainNumatuneMemMode mode;
virDomainNumatunePlacement placement;
} memory; /* pinning for all the memory */
struct _virDomainNumaNode {
unsigned long long mem; /* memory size in KiB */
virBitmapPtr cpumask; /* bitmap of vCPUs corresponding to the node */
virBitmapPtr nodeset; /* host memory nodes where this guest node resides */
virBitmap *cpumask; /* bitmap of vCPUs corresponding to the node */
virBitmap *nodeset; /* host memory nodes where this guest node resides */
virDomainNumatuneMemMode mode; /* memory mode selection */
virDomainMemoryAccess memAccess; /* shared memory access configuration */
virTristateBool discard; /* discard-data for memory-backend-file */
@ -143,7 +139,7 @@ struct _virDomainNuma {
bool
virDomainNumatuneNodeSpecified(virDomainNumaPtr numatune,
virDomainNumatuneNodeSpecified(virDomainNuma *numatune,
int cellid)
{
if (numatune &&
@ -155,7 +151,7 @@ virDomainNumatuneNodeSpecified(virDomainNumaPtr numatune,
}
static int
virDomainNumatuneNodeParseXML(virDomainNumaPtr numa,
virDomainNumatuneNodeParseXML(virDomainNuma *numa,
xmlXPathContextPtr ctxt)
{
char *tmp = NULL;
@ -191,7 +187,7 @@ virDomainNumatuneNodeParseXML(virDomainNumaPtr numa,
for (i = 0; i < n; i++) {
int mode = 0;
unsigned int cellid = 0;
virDomainNumaNodePtr mem_node = NULL;
virDomainNumaNode *mem_node = NULL;
xmlNodePtr cur_node = nodes[i];
tmp = virXMLPropString(cur_node, "cellid");
@ -264,7 +260,7 @@ virDomainNumatuneNodeParseXML(virDomainNumaPtr numa,
}
int
virDomainNumatuneParseXML(virDomainNumaPtr numa,
virDomainNumatuneParseXML(virDomainNuma *numa,
bool placement_static,
xmlXPathContextPtr ctxt)
{
@ -273,7 +269,7 @@ virDomainNumatuneParseXML(virDomainNumaPtr numa,
int n = 0;
int placement = -1;
int ret = -1;
virBitmapPtr nodeset = NULL;
virBitmap *nodeset = NULL;
xmlNodePtr node = NULL;
if (virXPathInt("count(./numatune)", ctxt, &n) < 0) {
@ -341,8 +337,8 @@ virDomainNumatuneParseXML(virDomainNumaPtr numa,
}
int
virDomainNumatuneFormatXML(virBufferPtr buf,
virDomainNumaPtr numatune)
virDomainNumatuneFormatXML(virBuffer *buf,
virDomainNuma *numatune)
{
const char *tmp = NULL;
char *nodeset = NULL;
@ -381,7 +377,7 @@ virDomainNumatuneFormatXML(virBufferPtr buf,
}
for (i = 0; i < numatune->nmem_nodes; i++) {
virDomainNumaNodePtr mem_node = &numatune->mem_nodes[i];
virDomainNumaNode *mem_node = &numatune->mem_nodes[i];
if (!mem_node->nodeset)
continue;
@ -403,7 +399,7 @@ virDomainNumatuneFormatXML(virBufferPtr buf,
}
void
virDomainNumaFree(virDomainNumaPtr numa)
virDomainNumaFree(virDomainNuma *numa)
{
size_t i = 0;
@ -439,7 +435,7 @@ virDomainNumaFree(virDomainNumaPtr numa)
* Returns: 0 on success (with @mode updated)
* -1 if no mode was defined in XML
*/
int virDomainNumatuneGetMode(virDomainNumaPtr numatune,
int virDomainNumatuneGetMode(virDomainNuma *numatune,
int cellid,
virDomainNumatuneMemMode *mode)
{
@ -461,9 +457,9 @@ int virDomainNumatuneGetMode(virDomainNumaPtr numatune,
return 0;
}
virBitmapPtr
virDomainNumatuneGetNodeset(virDomainNumaPtr numatune,
virBitmapPtr auto_nodeset,
virBitmap *
virDomainNumatuneGetNodeset(virDomainNuma *numatune,
virBitmap *auto_nodeset,
int cellid)
{
if (!numatune)
@ -483,8 +479,8 @@ virDomainNumatuneGetNodeset(virDomainNumaPtr numatune,
}
char *
virDomainNumatuneFormatNodeset(virDomainNumaPtr numatune,
virBitmapPtr auto_nodeset,
virDomainNumatuneFormatNodeset(virDomainNuma *numatune,
virBitmap *auto_nodeset,
int cellid)
{
return virBitmapFormat(virDomainNumatuneGetNodeset(numatune,
@ -494,9 +490,9 @@ virDomainNumatuneFormatNodeset(virDomainNumaPtr numatune,
int
virDomainNumatuneMaybeGetNodeset(virDomainNumaPtr numatune,
virBitmapPtr auto_nodeset,
virBitmapPtr *retNodeset,
virDomainNumatuneMaybeGetNodeset(virDomainNuma *numatune,
virBitmap *auto_nodeset,
virBitmap **retNodeset,
int cellid)
{
*retNodeset = NULL;
@ -524,12 +520,12 @@ virDomainNumatuneMaybeGetNodeset(virDomainNumaPtr numatune,
int
virDomainNumatuneMaybeFormatNodeset(virDomainNumaPtr numatune,
virBitmapPtr auto_nodeset,
virDomainNumatuneMaybeFormatNodeset(virDomainNuma *numatune,
virBitmap *auto_nodeset,
char **mask,
int cellid)
{
virBitmapPtr nodeset;
virBitmap *nodeset;
if (virDomainNumatuneMaybeGetNodeset(numatune, auto_nodeset, &nodeset,
cellid) < 0)
@ -543,11 +539,11 @@ virDomainNumatuneMaybeFormatNodeset(virDomainNumaPtr numatune,
}
int
virDomainNumatuneSet(virDomainNumaPtr numa,
virDomainNumatuneSet(virDomainNuma *numa,
bool placement_static,
int placement,
int mode,
virBitmapPtr nodeset)
virBitmap *nodeset)
{
/* No need to do anything in this case */
if (mode == -1 && placement == -1 && !nodeset)
@ -619,8 +615,8 @@ virDomainNumatuneSet(virDomainNumaPtr numa,
}
static bool
virDomainNumaNodesEqual(virDomainNumaPtr n1,
virDomainNumaPtr n2)
virDomainNumaNodesEqual(virDomainNuma *n1,
virDomainNuma *n2)
{
size_t i = 0;
@ -628,8 +624,8 @@ virDomainNumaNodesEqual(virDomainNumaPtr n1,
return false;
for (i = 0; i < n1->nmem_nodes; i++) {
virDomainNumaNodePtr nd1 = &n1->mem_nodes[i];
virDomainNumaNodePtr nd2 = &n2->mem_nodes[i];
virDomainNumaNode *nd1 = &n1->mem_nodes[i];
virDomainNumaNode *nd2 = &n2->mem_nodes[i];
if (!nd1->nodeset && !nd2->nodeset)
continue;
@ -645,8 +641,8 @@ virDomainNumaNodesEqual(virDomainNumaPtr n1,
}
bool
virDomainNumaEquals(virDomainNumaPtr n1,
virDomainNumaPtr n2)
virDomainNumaEquals(virDomainNuma *n1,
virDomainNuma *n2)
{
if (!n1 && !n2)
return true;
@ -673,7 +669,7 @@ virDomainNumaEquals(virDomainNumaPtr n1,
}
bool
virDomainNumatuneHasPlacementAuto(virDomainNumaPtr numatune)
virDomainNumatuneHasPlacementAuto(virDomainNuma *numatune)
{
if (!numatune)
return false;
@ -688,7 +684,7 @@ virDomainNumatuneHasPlacementAuto(virDomainNumaPtr numatune)
}
bool
virDomainNumatuneHasPerNodeBinding(virDomainNumaPtr numatune)
virDomainNumatuneHasPerNodeBinding(virDomainNuma *numatune)
{
size_t i = 0;
@ -704,10 +700,10 @@ virDomainNumatuneHasPerNodeBinding(virDomainNumaPtr numatune)
}
int
virDomainNumatuneSpecifiedMaxNode(virDomainNumaPtr numatune)
virDomainNumatuneSpecifiedMaxNode(virDomainNuma *numatune)
{
int ret = -1;
virBitmapPtr nodemask = NULL;
virBitmap *nodemask = NULL;
size_t i;
int bit;
@ -732,11 +728,11 @@ virDomainNumatuneSpecifiedMaxNode(virDomainNumaPtr numatune)
}
bool
virDomainNumatuneNodesetIsAvailable(virDomainNumaPtr numatune,
virBitmapPtr auto_nodeset)
virDomainNumatuneNodesetIsAvailable(virDomainNuma *numatune,
virBitmap *auto_nodeset)
{
size_t i = 0;
virBitmapPtr b = NULL;
virBitmap *b = NULL;
if (!numatune)
return true;
@ -756,7 +752,7 @@ virDomainNumatuneNodesetIsAvailable(virDomainNumaPtr numatune,
static int
virDomainNumaDefNodeDistanceParseXML(virDomainNumaPtr def,
virDomainNumaDefNodeDistanceParseXML(virDomainNuma *def,
xmlXPathContextPtr ctxt,
unsigned int cur_cell)
{
@ -780,8 +776,8 @@ virDomainNumaDefNodeDistanceParseXML(virDomainNumaPtr def,
}
for (i = 0; i < sibling; i++) {
virDomainNumaDistancePtr ldist;
virDomainNumaDistancePtr rdist;
virDomainNumaDistance *ldist;
virDomainNumaDistance *rdist;
unsigned int sibling_id, sibling_value;
/* siblings are in order of parsing or explicitly numbered */
@ -893,7 +889,7 @@ virDomainNumaDefNodeDistanceParseXML(virDomainNumaPtr def,
static int
virDomainNumaDefNodeCacheParseXML(virDomainNumaPtr def,
virDomainNumaDefNodeCacheParseXML(virDomainNuma *def,
xmlXPathContextPtr ctxt,
unsigned int cur_cell)
{
@ -908,7 +904,7 @@ virDomainNumaDefNodeCacheParseXML(virDomainNumaPtr def,
for (i = 0; i < n; i++) {
VIR_XPATH_NODE_AUTORESTORE(ctxt)
virDomainNumaCachePtr cache = &def->mem_nodes[cur_cell].caches[i];
virDomainNumaCache *cache = &def->mem_nodes[cur_cell].caches[i];
g_autofree char *tmp = NULL;
unsigned int level;
int associativity;
@ -983,7 +979,7 @@ virDomainNumaDefNodeCacheParseXML(virDomainNumaPtr def,
int
virDomainNumaDefParseXML(virDomainNumaPtr def,
virDomainNumaDefParseXML(virDomainNuma *def,
xmlXPathContextPtr ctxt)
{
xmlNodePtr *nodes = NULL;
@ -1208,8 +1204,8 @@ virDomainNumaDefParseXML(virDomainNumaPtr def,
int
virDomainNumaDefFormatXML(virBufferPtr buf,
virDomainNumaPtr def)
virDomainNumaDefFormatXML(virBuffer *buf,
virDomainNuma *def)
{
virDomainMemoryAccess memAccess;
virTristateBool discard;
@ -1222,7 +1218,7 @@ virDomainNumaDefFormatXML(virBufferPtr buf,
virBufferAddLit(buf, "<numa>\n");
virBufferAdjustIndent(buf, 2);
for (i = 0; i < ncells; i++) {
virBitmapPtr cpumask = virDomainNumaGetNodeCpumask(def, i);
virBitmap *cpumask = virDomainNumaGetNodeCpumask(def, i);
int ndistances;
size_t ncaches;
@ -1261,7 +1257,7 @@ virDomainNumaDefFormatXML(virBufferPtr buf,
virBufferAdjustIndent(buf, 2);
if (ndistances) {
virDomainNumaDistancePtr distances = def->mem_nodes[i].distances;
virDomainNumaDistance *distances = def->mem_nodes[i].distances;
virBufferAddLit(buf, "<distances>\n");
virBufferAdjustIndent(buf, 2);
@ -1278,7 +1274,7 @@ virDomainNumaDefFormatXML(virBufferPtr buf,
}
for (j = 0; j < ncaches; j++) {
virDomainNumaCachePtr cache = &def->mem_nodes[i].caches[j];
virDomainNumaCache *cache = &def->mem_nodes[i].caches[j];
virBufferAsprintf(buf, "<cache level='%u'", cache->level);
if (cache->associativity) {
@ -1317,7 +1313,7 @@ virDomainNumaDefFormatXML(virBufferPtr buf,
}
for (i = 0; i < def->ninterconnects; i++) {
virDomainNumaInterconnectPtr l = &def->interconnects[i];
virDomainNumaInterconnect *l = &def->interconnects[i];
switch (l->type) {
case VIR_DOMAIN_NUMA_INTERCONNECT_TYPE_LATENCY:
@ -1459,13 +1455,13 @@ virDomainNumaDefValidate(const virDomainNuma *def)
unsigned int
virDomainNumaGetCPUCountTotal(virDomainNumaPtr numa)
virDomainNumaGetCPUCountTotal(virDomainNuma *numa)
{
size_t i;
unsigned int ret = 0;
for (i = 0; i < numa->nmem_nodes; i++) {
virBitmapPtr cpumask = virDomainNumaGetNodeCpumask(numa, i);
virBitmap *cpumask = virDomainNumaGetNodeCpumask(numa, i);
if (cpumask)
ret += virBitmapCountBits(cpumask);
@ -1475,13 +1471,13 @@ virDomainNumaGetCPUCountTotal(virDomainNumaPtr numa)
}
unsigned int
virDomainNumaGetMaxCPUID(virDomainNumaPtr numa)
virDomainNumaGetMaxCPUID(virDomainNuma *numa)
{
size_t i;
unsigned int ret = 0;
for (i = 0; i < numa->nmem_nodes; i++) {
virBitmapPtr cpumask = virDomainNumaGetNodeCpumask(numa, i);
virBitmap *cpumask = virDomainNumaGetNodeCpumask(numa, i);
int bit;
if (cpumask) {
@ -1495,7 +1491,7 @@ virDomainNumaGetMaxCPUID(virDomainNumaPtr numa)
}
virDomainNumaPtr
virDomainNuma *
virDomainNumaNew(void)
{
return g_new0(virDomainNuma, 1);
@ -1503,8 +1499,8 @@ virDomainNumaNew(void)
bool
virDomainNumaCheckABIStability(virDomainNumaPtr src,
virDomainNumaPtr tgt)
virDomainNumaCheckABIStability(virDomainNuma *src,
virDomainNuma *tgt)
{
size_t i;
size_t j;
@ -1554,7 +1550,7 @@ virDomainNumaCheckABIStability(virDomainNumaPtr src,
size_t
virDomainNumaGetNodeCount(virDomainNumaPtr numa)
virDomainNumaGetNodeCount(virDomainNuma *numa)
{
if (!numa)
return 0;
@ -1564,7 +1560,7 @@ virDomainNumaGetNodeCount(virDomainNumaPtr numa)
size_t
virDomainNumaSetNodeCount(virDomainNumaPtr numa, size_t nmem_nodes)
virDomainNumaSetNodeCount(virDomainNuma *numa, size_t nmem_nodes)
{
if (!nmem_nodes) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
@ -1587,7 +1583,7 @@ virDomainNumaSetNodeCount(virDomainNumaPtr numa, size_t nmem_nodes)
bool
virDomainNumaNodeDistanceIsUsingDefaults(virDomainNumaPtr numa,
virDomainNumaNodeDistanceIsUsingDefaults(virDomainNuma *numa,
size_t node,
size_t sibling)
{
@ -1607,7 +1603,7 @@ virDomainNumaNodeDistanceIsUsingDefaults(virDomainNumaPtr numa,
bool
virDomainNumaNodesDistancesAreBeingSet(virDomainNumaPtr numa)
virDomainNumaNodesDistancesAreBeingSet(virDomainNuma *numa)
{
size_t ncells = virDomainNumaGetNodeCount(numa);
size_t i, j;
@ -1626,11 +1622,11 @@ virDomainNumaNodesDistancesAreBeingSet(virDomainNumaPtr numa)
size_t
virDomainNumaGetNodeDistance(virDomainNumaPtr numa,
virDomainNumaGetNodeDistance(virDomainNuma *numa,
size_t node,
size_t cellid)
{
virDomainNumaDistancePtr distances = NULL;
virDomainNumaDistance *distances = NULL;
if (node < numa->nmem_nodes)
distances = numa->mem_nodes[node].distances;
@ -1650,12 +1646,12 @@ virDomainNumaGetNodeDistance(virDomainNumaPtr numa,
int
virDomainNumaSetNodeDistance(virDomainNumaPtr numa,
virDomainNumaSetNodeDistance(virDomainNuma *numa,
size_t node,
size_t cellid,
unsigned int value)
{
virDomainNumaDistancePtr distances;
virDomainNumaDistance *distances;
if (node >= numa->nmem_nodes) {
virReportError(VIR_ERR_INTERNAL_ERROR,
@ -1704,11 +1700,11 @@ virDomainNumaSetNodeDistance(virDomainNumaPtr numa,
size_t
virDomainNumaSetNodeDistanceCount(virDomainNumaPtr numa,
virDomainNumaSetNodeDistanceCount(virDomainNuma *numa,
size_t node,
size_t ndistances)
{
virDomainNumaDistancePtr distances;
virDomainNumaDistance *distances;
distances = numa->mem_nodes[node].distances;
if (distances) {
@ -1727,8 +1723,8 @@ virDomainNumaSetNodeDistanceCount(virDomainNumaPtr numa,
}
virBitmapPtr
virDomainNumaGetNodeCpumask(virDomainNumaPtr numa,
virBitmap *
virDomainNumaGetNodeCpumask(virDomainNuma *numa,
size_t node)
{
return numa->mem_nodes[node].cpumask;
@ -1736,16 +1732,16 @@ virDomainNumaGetNodeCpumask(virDomainNumaPtr numa,
void
virDomainNumaSetNodeCpumask(virDomainNumaPtr numa,
virDomainNumaSetNodeCpumask(virDomainNuma *numa,
size_t node,
virBitmapPtr cpumask)
virBitmap *cpumask)
{
numa->mem_nodes[node].cpumask = cpumask;
}
virDomainMemoryAccess
virDomainNumaGetNodeMemoryAccessMode(virDomainNumaPtr numa,
virDomainNumaGetNodeMemoryAccessMode(virDomainNuma *numa,
size_t node)
{
return numa->mem_nodes[node].memAccess;
@ -1753,7 +1749,7 @@ virDomainNumaGetNodeMemoryAccessMode(virDomainNumaPtr numa,
virTristateBool
virDomainNumaGetNodeDiscard(virDomainNumaPtr numa,
virDomainNumaGetNodeDiscard(virDomainNuma *numa,
size_t node)
{
return numa->mem_nodes[node].discard;
@ -1761,7 +1757,7 @@ virDomainNumaGetNodeDiscard(virDomainNumaPtr numa,
unsigned long long
virDomainNumaGetNodeMemorySize(virDomainNumaPtr numa,
virDomainNumaGetNodeMemorySize(virDomainNuma *numa,
size_t node)
{
return numa->mem_nodes[node].mem;
@ -1769,7 +1765,7 @@ virDomainNumaGetNodeMemorySize(virDomainNumaPtr numa,
void
virDomainNumaSetNodeMemorySize(virDomainNumaPtr numa,
virDomainNumaSetNodeMemorySize(virDomainNuma *numa,
size_t node,
unsigned long long size)
{
@ -1778,7 +1774,7 @@ virDomainNumaSetNodeMemorySize(virDomainNumaPtr numa,
unsigned long long
virDomainNumaGetMemorySize(virDomainNumaPtr numa)
virDomainNumaGetMemorySize(virDomainNuma *numa)
{
size_t i;
unsigned long long ret = 0;
@ -1791,7 +1787,7 @@ virDomainNumaGetMemorySize(virDomainNumaPtr numa)
int
virDomainNumaFillCPUsInNode(virDomainNumaPtr numa,
virDomainNumaFillCPUsInNode(virDomainNuma *numa,
size_t node,
unsigned int maxCpus)
{
@ -1804,7 +1800,7 @@ virDomainNumaFillCPUsInNode(virDomainNumaPtr numa,
virBitmapSetAll(maxCPUsBitmap);
for (i = 0; i < numa->nmem_nodes; i++) {
virBitmapPtr nodeCpus = virDomainNumaGetNodeCpumask(numa, i);
virBitmap *nodeCpus = virDomainNumaGetNodeCpumask(numa, i);
if (i == node || !nodeCpus)
continue;

View File

@ -29,7 +29,6 @@
typedef struct _virDomainNuma virDomainNuma;
typedef virDomainNuma *virDomainNumaPtr;
typedef enum {
VIR_DOMAIN_NUMATUNE_PLACEMENT_DEFAULT = 0,
@ -85,142 +84,142 @@ typedef enum {
VIR_ENUM_DECL(virDomainMemoryLatency);
virDomainNumaPtr virDomainNumaNew(void);
void virDomainNumaFree(virDomainNumaPtr numa);
virDomainNuma *virDomainNumaNew(void);
void virDomainNumaFree(virDomainNuma *numa);
/*
* XML Parse/Format functions
*/
int virDomainNumatuneParseXML(virDomainNumaPtr numa,
int virDomainNumatuneParseXML(virDomainNuma *numa,
bool placement_static,
xmlXPathContextPtr ctxt)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(3);
int virDomainNumatuneFormatXML(virBufferPtr buf, virDomainNumaPtr numatune)
int virDomainNumatuneFormatXML(virBuffer *buf, virDomainNuma *numatune)
ATTRIBUTE_NONNULL(1);
/*
* Getters
*/
int virDomainNumatuneGetMode(virDomainNumaPtr numatune,
int virDomainNumatuneGetMode(virDomainNuma *numatune,
int cellid,
virDomainNumatuneMemMode *mode);
virBitmapPtr virDomainNumatuneGetNodeset(virDomainNumaPtr numatune,
virBitmapPtr auto_nodeset,
virBitmap *virDomainNumatuneGetNodeset(virDomainNuma *numatune,
virBitmap *auto_nodeset,
int cellid);
int virDomainNumatuneMaybeGetNodeset(virDomainNumaPtr numatune,
virBitmapPtr auto_nodeset,
virBitmapPtr *retNodeset,
int virDomainNumatuneMaybeGetNodeset(virDomainNuma *numatune,
virBitmap *auto_nodeset,
virBitmap **retNodeset,
int cellid);
size_t virDomainNumaGetNodeCount(virDomainNumaPtr numa);
size_t virDomainNumaGetNodeCount(virDomainNuma *numa);
bool virDomainNumaNodeDistanceIsUsingDefaults(virDomainNumaPtr numa,
bool virDomainNumaNodeDistanceIsUsingDefaults(virDomainNuma *numa,
size_t node,
size_t sibling)
ATTRIBUTE_NONNULL(1);
bool virDomainNumaNodesDistancesAreBeingSet(virDomainNumaPtr numa)
bool virDomainNumaNodesDistancesAreBeingSet(virDomainNuma *numa)
ATTRIBUTE_NONNULL(1);
size_t virDomainNumaGetNodeDistance(virDomainNumaPtr numa,
size_t virDomainNumaGetNodeDistance(virDomainNuma *numa,
size_t node,
size_t sibling)
ATTRIBUTE_NONNULL(1);
virBitmapPtr virDomainNumaGetNodeCpumask(virDomainNumaPtr numa,
virBitmap *virDomainNumaGetNodeCpumask(virDomainNuma *numa,
size_t node)
ATTRIBUTE_NONNULL(1);
virDomainMemoryAccess virDomainNumaGetNodeMemoryAccessMode(virDomainNumaPtr numa,
virDomainMemoryAccess virDomainNumaGetNodeMemoryAccessMode(virDomainNuma *numa,
size_t node)
ATTRIBUTE_NONNULL(1);
virTristateBool virDomainNumaGetNodeDiscard(virDomainNumaPtr numa,
virTristateBool virDomainNumaGetNodeDiscard(virDomainNuma *numa,
size_t node)
ATTRIBUTE_NONNULL(1);
unsigned long long virDomainNumaGetNodeMemorySize(virDomainNumaPtr numa,
unsigned long long virDomainNumaGetNodeMemorySize(virDomainNuma *numa,
size_t node)
ATTRIBUTE_NONNULL(1);
unsigned long long virDomainNumaGetMemorySize(virDomainNumaPtr numa)
unsigned long long virDomainNumaGetMemorySize(virDomainNuma *numa)
ATTRIBUTE_NONNULL(1);
unsigned int
virDomainNumaGetMaxCPUID(virDomainNumaPtr numa);
virDomainNumaGetMaxCPUID(virDomainNuma *numa);
/*
* Formatters
*/
char *virDomainNumatuneFormatNodeset(virDomainNumaPtr numatune,
virBitmapPtr auto_nodeset,
char *virDomainNumatuneFormatNodeset(virDomainNuma *numatune,
virBitmap *auto_nodeset,
int cellid);
int virDomainNumatuneMaybeFormatNodeset(virDomainNumaPtr numatune,
virBitmapPtr auto_nodeset,
int virDomainNumatuneMaybeFormatNodeset(virDomainNuma *numatune,
virBitmap *auto_nodeset,
char **mask,
int cellid);
/*
* Setters
*/
int virDomainNumatuneSet(virDomainNumaPtr numa,
int virDomainNumatuneSet(virDomainNuma *numa,
bool placement_static,
int placement,
int mode,
virBitmapPtr nodeset)
virBitmap *nodeset)
ATTRIBUTE_NONNULL(1);
size_t virDomainNumaSetNodeCount(virDomainNumaPtr numa,
size_t virDomainNumaSetNodeCount(virDomainNuma *numa,
size_t nmem_nodes)
ATTRIBUTE_NONNULL(1);
void virDomainNumaSetNodeMemorySize(virDomainNumaPtr numa,
void virDomainNumaSetNodeMemorySize(virDomainNuma *numa,
size_t node,
unsigned long long size)
ATTRIBUTE_NONNULL(1);
int virDomainNumaSetNodeDistance(virDomainNumaPtr numa,
int virDomainNumaSetNodeDistance(virDomainNuma *numa,
size_t node,
size_t sibling,
unsigned int value)
ATTRIBUTE_NONNULL(1);
size_t virDomainNumaSetNodeDistanceCount(virDomainNumaPtr numa,
size_t virDomainNumaSetNodeDistanceCount(virDomainNuma *numa,
size_t node,
size_t ndistances)
ATTRIBUTE_NONNULL(1);
void virDomainNumaSetNodeCpumask(virDomainNumaPtr numa,
void virDomainNumaSetNodeCpumask(virDomainNuma *numa,
size_t node,
virBitmapPtr cpumask)
virBitmap *cpumask)
ATTRIBUTE_NONNULL(1);
/*
* Other accessors
*/
bool virDomainNumaEquals(virDomainNumaPtr n1,
virDomainNumaPtr n2);
bool virDomainNumaEquals(virDomainNuma *n1,
virDomainNuma *n2);
bool virDomainNumaCheckABIStability(virDomainNumaPtr src,
virDomainNumaPtr tgt);
bool virDomainNumaCheckABIStability(virDomainNuma *src,
virDomainNuma *tgt);
bool virDomainNumatuneHasPlacementAuto(virDomainNumaPtr numatune);
bool virDomainNumatuneHasPlacementAuto(virDomainNuma *numatune);
bool virDomainNumatuneHasPerNodeBinding(virDomainNumaPtr numatune);
bool virDomainNumatuneHasPerNodeBinding(virDomainNuma *numatune);
int virDomainNumatuneSpecifiedMaxNode(virDomainNumaPtr numatune);
int virDomainNumatuneSpecifiedMaxNode(virDomainNuma *numatune);
bool virDomainNumatuneNodesetIsAvailable(virDomainNumaPtr numatune,
virBitmapPtr auto_nodeset);
bool virDomainNumatuneNodesetIsAvailable(virDomainNuma *numatune,
virBitmap *auto_nodeset);
bool virDomainNumatuneNodeSpecified(virDomainNumaPtr numatune,
bool virDomainNumatuneNodeSpecified(virDomainNuma *numatune,
int cellid);
int virDomainNumaDefParseXML(virDomainNumaPtr def, xmlXPathContextPtr ctxt);
int virDomainNumaDefFormatXML(virBufferPtr buf, virDomainNumaPtr def);
int virDomainNumaDefParseXML(virDomainNuma *def, xmlXPathContextPtr ctxt);
int virDomainNumaDefFormatXML(virBuffer *buf, virDomainNuma *def);
int virDomainNumaDefValidate(const virDomainNuma *def);
unsigned int virDomainNumaGetCPUCountTotal(virDomainNumaPtr numa);
unsigned int virDomainNumaGetCPUCountTotal(virDomainNuma *numa);
int virDomainNumaFillCPUsInNode(virDomainNumaPtr numa, size_t node,
int virDomainNumaFillCPUsInNode(virDomainNuma *numa, size_t node,
unsigned int maxCpus);
bool virDomainNumaHasHMAT(const virDomainNuma *numa);

View File

@ -299,7 +299,7 @@ intMapGetByString(const struct int_map *intmap,
void
virNWFilterRuleDefFree(virNWFilterRuleDefPtr def)
virNWFilterRuleDefFree(virNWFilterRuleDef *def)
{
size_t i;
if (!def)
@ -319,7 +319,7 @@ virNWFilterRuleDefFree(virNWFilterRuleDefPtr def)
static void
virNWFilterIncludeDefFree(virNWFilterIncludeDefPtr inc)
virNWFilterIncludeDefFree(virNWFilterIncludeDef *inc)
{
if (!inc)
return;
@ -330,7 +330,7 @@ virNWFilterIncludeDefFree(virNWFilterIncludeDefPtr inc)
static void
virNWFilterEntryFree(virNWFilterEntryPtr entry)
virNWFilterEntryFree(virNWFilterEntry *entry)
{
if (!entry)
return;
@ -342,7 +342,7 @@ virNWFilterEntryFree(virNWFilterEntryPtr entry)
void
virNWFilterDefFree(virNWFilterDefPtr def)
virNWFilterDefFree(virNWFilterDef *def)
{
size_t i;
if (!def)
@ -361,12 +361,12 @@ virNWFilterDefFree(virNWFilterDefPtr def)
static int
virNWFilterRuleDefAddVar(virNWFilterRuleDefPtr nwf,
virNWFilterRuleDefAddVar(virNWFilterRuleDef *nwf,
nwItemDesc *item,
const char *var)
{
size_t i = 0;
virNWFilterVarAccessPtr varAccess;
virNWFilterVarAccess *varAccess;
varAccess = virNWFilterVarAccessParse(var);
if (varAccess == NULL)
@ -390,7 +390,7 @@ virNWFilterRuleDefAddVar(virNWFilterRuleDefPtr nwf,
static char *
virNWFilterRuleDefAddString(virNWFilterRuleDefPtr nwf,
virNWFilterRuleDefAddString(virNWFilterRuleDef *nwf,
const char *string,
size_t maxstrlen)
{
@ -412,10 +412,10 @@ union data {
};
typedef bool (*valueValidator)(enum attrDatatype datatype, union data *valptr,
virNWFilterRuleDefPtr nwf,
virNWFilterRuleDef *nwf,
nwItemDesc *item);
typedef bool (*valueFormatter)(virBufferPtr buf,
virNWFilterRuleDefPtr nwf,
typedef bool (*valueFormatter)(virBuffer *buf,
virNWFilterRuleDef *nwf,
nwItemDesc *item);
typedef struct _virXMLAttr2Struct virXMLAttr2Struct;
@ -443,7 +443,7 @@ static const struct int_map macProtoMap[] = {
static bool
checkMacProtocolID(enum attrDatatype datatype,
union data *value,
virNWFilterRuleDefPtr nwf G_GNUC_UNUSED,
virNWFilterRuleDef *nwf G_GNUC_UNUSED,
nwItemDesc *item G_GNUC_UNUSED)
{
int32_t res = -1;
@ -470,8 +470,8 @@ checkMacProtocolID(enum attrDatatype datatype,
static bool
macProtocolIDFormatter(virBufferPtr buf,
virNWFilterRuleDefPtr nwf,
macProtocolIDFormatter(virBuffer *buf,
virNWFilterRuleDef *nwf,
nwItemDesc *item G_GNUC_UNUSED)
{
const char *str = NULL;
@ -494,7 +494,7 @@ macProtocolIDFormatter(virBufferPtr buf,
static bool
checkVlanVlanID(enum attrDatatype datatype,
union data *value,
virNWFilterRuleDefPtr nwf,
virNWFilterRuleDef *nwf,
nwItemDesc *item G_GNUC_UNUSED)
{
int32_t res;
@ -516,7 +516,7 @@ checkVlanVlanID(enum attrDatatype datatype,
static bool
checkVlanProtocolID(enum attrDatatype datatype,
union data *value,
virNWFilterRuleDefPtr nwf,
virNWFilterRuleDef *nwf,
nwItemDesc *item G_GNUC_UNUSED)
{
int32_t res = -1;
@ -543,8 +543,8 @@ checkVlanProtocolID(enum attrDatatype datatype,
static bool
vlanProtocolIDFormatter(virBufferPtr buf,
virNWFilterRuleDefPtr nwf,
vlanProtocolIDFormatter(virBuffer *buf,
virNWFilterRuleDef *nwf,
nwItemDesc *item G_GNUC_UNUSED)
{
const char *str = NULL;
@ -597,7 +597,7 @@ checkValidMask(unsigned char *data,
static bool
checkMACMask(enum attrDatatype datatype G_GNUC_UNUSED,
union data *macMask,
virNWFilterRuleDefPtr nwf G_GNUC_UNUSED,
virNWFilterRuleDef *nwf G_GNUC_UNUSED,
nwItemDesc *item G_GNUC_UNUSED)
{
return checkValidMask(macMask->uc, 6);
@ -624,7 +624,7 @@ static const struct int_map arpOpcodeMap[] = {
static bool
arpOpcodeValidator(enum attrDatatype datatype,
union data *value,
virNWFilterRuleDefPtr nwf,
virNWFilterRuleDef *nwf,
nwItemDesc *item G_GNUC_UNUSED)
{
int32_t res = -1;
@ -648,8 +648,8 @@ arpOpcodeValidator(enum attrDatatype datatype,
static bool
arpOpcodeFormatter(virBufferPtr buf,
virNWFilterRuleDefPtr nwf,
arpOpcodeFormatter(virBuffer *buf,
virNWFilterRuleDef *nwf,
nwItemDesc *item G_GNUC_UNUSED)
{
const char *str = NULL;
@ -686,7 +686,7 @@ static const struct int_map ipProtoMap[] = {
static bool
checkIPProtocolID(enum attrDatatype datatype,
union data *value,
virNWFilterRuleDefPtr nwf,
virNWFilterRuleDef *nwf,
nwItemDesc *item G_GNUC_UNUSED)
{
int32_t res = -1;
@ -710,8 +710,8 @@ checkIPProtocolID(enum attrDatatype datatype,
static bool
formatIPProtocolID(virBufferPtr buf,
virNWFilterRuleDefPtr nwf,
formatIPProtocolID(virBuffer *buf,
virNWFilterRuleDef *nwf,
nwItemDesc *item G_GNUC_UNUSED)
{
const char *str = NULL;
@ -734,7 +734,7 @@ formatIPProtocolID(virBufferPtr buf,
static bool
dscpValidator(enum attrDatatype datatype,
union data *val,
virNWFilterRuleDefPtr nwf,
virNWFilterRuleDef *nwf,
nwItemDesc *item G_GNUC_UNUSED)
{
uint8_t dscp = val->ui;
@ -793,7 +793,7 @@ parseStringItems(const struct int_map *int_map,
static int
printStringItems(virBufferPtr buf,
printStringItems(virBuffer *buf,
const struct int_map *int_map,
int32_t flags,
const char *sep)
@ -837,7 +837,7 @@ parseStateMatch(const char *statematch,
void
virNWFilterPrintStateMatchFlags(virBufferPtr buf,
virNWFilterPrintStateMatchFlags(virBuffer *buf,
const char *prefix,
int32_t flags,
bool disp_none)
@ -854,7 +854,7 @@ virNWFilterPrintStateMatchFlags(virBufferPtr buf,
static bool
stateValidator(enum attrDatatype datatype G_GNUC_UNUSED,
union data *val,
virNWFilterRuleDefPtr nwf,
virNWFilterRuleDef *nwf,
nwItemDesc *item)
{
char *input = val->c;
@ -873,8 +873,8 @@ stateValidator(enum attrDatatype datatype G_GNUC_UNUSED,
static bool
stateFormatter(virBufferPtr buf,
virNWFilterRuleDefPtr nwf G_GNUC_UNUSED,
stateFormatter(virBuffer *buf,
virNWFilterRuleDef *nwf G_GNUC_UNUSED,
nwItemDesc *item)
{
virNWFilterPrintStateMatchFlags(buf, "", item->u.u16, true);
@ -899,7 +899,7 @@ static const struct int_map tcpFlags[] = {
static bool
tcpFlagsValidator(enum attrDatatype datatype G_GNUC_UNUSED,
union data *val,
virNWFilterRuleDefPtr nwf G_GNUC_UNUSED,
virNWFilterRuleDef *nwf G_GNUC_UNUSED,
nwItemDesc *item)
{
bool rc = false;
@ -929,7 +929,7 @@ tcpFlagsValidator(enum attrDatatype datatype G_GNUC_UNUSED,
static void
printTCPFlags(virBufferPtr buf,
printTCPFlags(virBuffer *buf,
uint8_t flags)
{
if (flags == 0)
@ -951,8 +951,8 @@ virNWFilterPrintTCPFlags(uint8_t flags)
static bool
tcpFlagsFormatter(virBufferPtr buf,
virNWFilterRuleDefPtr nwf G_GNUC_UNUSED,
tcpFlagsFormatter(virBuffer *buf,
virNWFilterRuleDef *nwf G_GNUC_UNUSED,
nwItemDesc *item)
{
printTCPFlags(buf, item->u.tcpFlags.mask);
@ -966,7 +966,7 @@ tcpFlagsFormatter(virBufferPtr buf,
static bool
ipsetValidator(enum attrDatatype datatype G_GNUC_UNUSED,
union data *val,
virNWFilterRuleDefPtr nwf G_GNUC_UNUSED,
virNWFilterRuleDef *nwf G_GNUC_UNUSED,
nwItemDesc *item)
{
const char *errmsg = NULL;
@ -992,8 +992,8 @@ ipsetValidator(enum attrDatatype datatype G_GNUC_UNUSED,
static bool
ipsetFormatter(virBufferPtr buf,
virNWFilterRuleDefPtr nwf G_GNUC_UNUSED,
ipsetFormatter(virBuffer *buf,
virNWFilterRuleDef *nwf G_GNUC_UNUSED,
nwItemDesc *item)
{
virBufferAdd(buf, item->u.ipset.setname, -1);
@ -1005,7 +1005,7 @@ ipsetFormatter(virBufferPtr buf,
static bool
ipsetFlagsValidator(enum attrDatatype datatype G_GNUC_UNUSED,
union data *val,
virNWFilterRuleDefPtr nwf G_GNUC_UNUSED,
virNWFilterRuleDef *nwf G_GNUC_UNUSED,
nwItemDesc *item)
{
const char *errmsg = NULL;
@ -1042,8 +1042,8 @@ ipsetFlagsValidator(enum attrDatatype datatype G_GNUC_UNUSED,
static bool
ipsetFlagsFormatter(virBufferPtr buf,
virNWFilterRuleDefPtr nwf G_GNUC_UNUSED,
ipsetFlagsFormatter(virBuffer *buf,
virNWFilterRuleDef *nwf G_GNUC_UNUSED,
nwItemDesc *item)
{
uint8_t ctr;
@ -1794,7 +1794,7 @@ static const virAttributes virAttr[] = {
static int
virNWFilterRuleDetailsParse(xmlNodePtr node,
virNWFilterRuleDefPtr nwf,
virNWFilterRuleDef *nwf,
const virXMLAttr2Struct *att)
{
int rc = 0, g_rc = 0;
@ -2060,10 +2060,10 @@ virNWFilterRuleDetailsParse(xmlNodePtr node,
}
static virNWFilterIncludeDefPtr
static virNWFilterIncludeDef *
virNWFilterIncludeParse(xmlNodePtr cur)
{
virNWFilterIncludeDefPtr ret;
virNWFilterIncludeDef *ret;
ret = g_new0(virNWFilterIncludeDef, 1);
@ -2088,7 +2088,7 @@ virNWFilterIncludeParse(xmlNodePtr cur)
static void
virNWFilterRuleDefFixupIPSet(ipHdrDataDefPtr ipHdr)
virNWFilterRuleDefFixupIPSet(ipHdrDataDef *ipHdr)
{
if (HAS_ENTRY_ITEM(&ipHdr->dataIPSet) &&
!HAS_ENTRY_ITEM(&ipHdr->dataIPSetFlags)) {
@ -2109,11 +2109,11 @@ virNWFilterRuleDefFixupIPSet(ipHdrDataDefPtr ipHdr)
* defined that cannot be instantiated.
*/
static int
virNWFilterRuleValidate(virNWFilterRuleDefPtr rule)
virNWFilterRuleValidate(virNWFilterRuleDef *rule)
{
int ret = 0;
portDataDefPtr portData = NULL;
nwItemDescPtr dataProtocolID = NULL;
portDataDef *portData = NULL;
nwItemDesc *dataProtocolID = NULL;
const char *protocol = NULL;
switch (rule->prtclType) {
@ -2189,7 +2189,7 @@ virNWFilterRuleValidate(virNWFilterRuleDefPtr rule)
static void
virNWFilterRuleDefFixup(virNWFilterRuleDefPtr rule)
virNWFilterRuleDefFixup(virNWFilterRuleDef *rule)
{
#define COPY_NEG_SIGN(A, B) \
(A).flags = ((A).flags & ~NWFILTER_ENTRY_ITEM_FLAG_IS_NEG) | \
@ -2404,7 +2404,7 @@ virNWFilterRuleDefFixup(virNWFilterRuleDefPtr rule)
}
static virNWFilterRuleDefPtr
static virNWFilterRuleDef *
virNWFilterRuleParse(xmlNodePtr node)
{
char *action;
@ -2416,7 +2416,7 @@ virNWFilterRuleParse(xmlNodePtr node)
int priority;
xmlNodePtr cur;
virNWFilterRuleDefPtr ret;
virNWFilterRuleDef *ret;
ret = g_new0(virNWFilterRuleDef, 1);
@ -2598,15 +2598,15 @@ virNWFilterIsAllowedChain(const char *chainname)
}
static virNWFilterDefPtr
static virNWFilterDef *
virNWFilterDefParseXML(xmlXPathContextPtr ctxt)
{
virNWFilterDefPtr ret;
virNWFilterDef *ret;
xmlNodePtr curr = ctxt->node;
char *uuid = NULL;
char *chain = NULL;
char *chain_pri_s = NULL;
virNWFilterEntryPtr entry;
virNWFilterEntry *entry;
int chain_priority;
const char *name_prefix;
@ -2722,7 +2722,7 @@ virNWFilterDefParseXML(xmlXPathContextPtr ctxt)
}
virNWFilterDefPtr
virNWFilterDef *
virNWFilterDefParseNode(xmlDocPtr xml,
xmlNodePtr root)
{
@ -2743,11 +2743,11 @@ virNWFilterDefParseNode(xmlDocPtr xml,
}
static virNWFilterDefPtr
static virNWFilterDef *
virNWFilterDefParse(const char *xmlStr,
const char *filename)
{
virNWFilterDefPtr def = NULL;
virNWFilterDef *def = NULL;
xmlDocPtr xml;
if ((xml = virXMLParse(filename, xmlStr, _("(nwfilter_definition)")))) {
@ -2759,14 +2759,14 @@ virNWFilterDefParse(const char *xmlStr,
}
virNWFilterDefPtr
virNWFilterDef *
virNWFilterDefParseString(const char *xmlStr)
{
return virNWFilterDefParse(xmlStr, NULL);
}
virNWFilterDefPtr
virNWFilterDef *
virNWFilterDefParseFile(const char *filename)
{
return virNWFilterDefParse(NULL, filename);
@ -2775,7 +2775,7 @@ virNWFilterDefParseFile(const char *filename)
int
virNWFilterSaveConfig(const char *configDir,
virNWFilterDefPtr def)
virNWFilterDef *def)
{
int ret = -1;
char *xml;
@ -2802,7 +2802,7 @@ virNWFilterSaveConfig(const char *configDir,
int
virNWFilterDeleteDef(const char *configDir,
virNWFilterDefPtr def)
virNWFilterDef *def)
{
int ret = -1;
char *configFile = NULL;
@ -2825,8 +2825,8 @@ virNWFilterDeleteDef(const char *configDir,
static void
virNWIPAddressFormat(virBufferPtr buf,
virSocketAddrPtr ipaddr)
virNWIPAddressFormat(virBuffer *buf,
virSocketAddr *ipaddr)
{
char *output = virSocketAddrFormat(ipaddr);
@ -2838,10 +2838,10 @@ virNWIPAddressFormat(virBufferPtr buf,
static void
virNWFilterRuleDefDetailsFormat(virBufferPtr buf,
virNWFilterRuleDefDetailsFormat(virBuffer *buf,
const char *type,
const virXMLAttr2Struct *att,
virNWFilterRuleDefPtr def)
virNWFilterRuleDef *def)
{
size_t i = 0, j;
bool typeShown = false;
@ -2985,8 +2985,8 @@ virNWFilterRuleDefDetailsFormat(virBufferPtr buf,
static int
virNWFilterRuleDefFormat(virBufferPtr buf,
virNWFilterRuleDefPtr def)
virNWFilterRuleDefFormat(virBuffer *buf,
virNWFilterRuleDef *def)
{
size_t i;
bool subelement = false;
@ -3025,8 +3025,8 @@ virNWFilterRuleDefFormat(virBufferPtr buf,
static int
virNWFilterEntryFormat(virBufferPtr buf,
virNWFilterEntryPtr entry)
virNWFilterEntryFormat(virBuffer *buf,
virNWFilterEntry *entry)
{
if (entry->rule)
return virNWFilterRuleDefFormat(buf, entry->rule);
@ -3111,7 +3111,7 @@ virNWFilterTriggerRebuild(void)
bool
virNWFilterRuleIsProtocolIPv4(virNWFilterRuleDefPtr rule)
virNWFilterRuleIsProtocolIPv4(virNWFilterRuleDef *rule)
{
if (rule->prtclType >= VIR_NWFILTER_RULE_PROTOCOL_TCP &&
rule->prtclType <= VIR_NWFILTER_RULE_PROTOCOL_ALL)
@ -3121,7 +3121,7 @@ virNWFilterRuleIsProtocolIPv4(virNWFilterRuleDefPtr rule)
bool
virNWFilterRuleIsProtocolIPv6(virNWFilterRuleDefPtr rule)
virNWFilterRuleIsProtocolIPv6(virNWFilterRuleDef *rule)
{
if (rule->prtclType >= VIR_NWFILTER_RULE_PROTOCOL_TCPoIPV6 &&
rule->prtclType <= VIR_NWFILTER_RULE_PROTOCOL_ALLoIPV6)
@ -3131,7 +3131,7 @@ virNWFilterRuleIsProtocolIPv6(virNWFilterRuleDefPtr rule)
bool
virNWFilterRuleIsProtocolEthernet(virNWFilterRuleDefPtr rule)
virNWFilterRuleIsProtocolEthernet(virNWFilterRuleDef *rule)
{
if (rule->prtclType <= VIR_NWFILTER_RULE_PROTOCOL_IPV6)
return true;

View File

@ -111,10 +111,9 @@ typedef enum attrDatatype {
typedef struct _nwItemDesc nwItemDesc;
typedef nwItemDesc *nwItemDescPtr;
struct _nwItemDesc {
virNWFilterEntryItemFlags flags;
virNWFilterVarAccessPtr varAccess;
virNWFilterVarAccess *varAccess;
enum attrDatatype datatype;
union {
virMacAddr macaddr;
@ -141,7 +140,6 @@ struct _nwItemDesc {
"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_.:-+ "
typedef struct _ethHdrDataDef ethHdrDataDef;
typedef ethHdrDataDef *ethHdrDataDefPtr;
struct _ethHdrDataDef {
nwItemDesc dataSrcMACAddr;
nwItemDesc dataSrcMACMask;
@ -151,7 +149,6 @@ struct _ethHdrDataDef {
typedef struct _ethHdrFilterDef ethHdrFilterDef;
typedef ethHdrFilterDef *ethHdrFilterDefPtr;
struct _ethHdrFilterDef {
ethHdrDataDef ethHdr;
nwItemDesc dataProtocolID;
@ -160,7 +157,6 @@ struct _ethHdrFilterDef {
typedef struct _vlanHdrFilterDef vlanHdrFilterDef;
typedef vlanHdrFilterDef *vlanHdrFilterDefPtr;
struct _vlanHdrFilterDef {
ethHdrDataDef ethHdr;
nwItemDesc dataVlanID;
@ -170,7 +166,6 @@ struct _vlanHdrFilterDef {
typedef struct _stpHdrFilterDef stpHdrFilterDef;
typedef stpHdrFilterDef *stpHdrFilterDefPtr;
struct _stpHdrFilterDef {
ethHdrDataDef ethHdr;
nwItemDesc dataType;
@ -200,7 +195,6 @@ struct _stpHdrFilterDef {
typedef struct _arpHdrFilterDef arpHdrFilterDef;
typedef arpHdrFilterDef *arpHdrFilterDefPtr;
struct _arpHdrFilterDef {
ethHdrDataDef ethHdr;
nwItemDesc dataHWType;
@ -218,7 +212,6 @@ struct _arpHdrFilterDef {
typedef struct _ipHdrDataDef ipHdrDataDef;
typedef ipHdrDataDef *ipHdrDataDefPtr;
struct _ipHdrDataDef {
nwItemDesc dataIPVersion;
nwItemDesc dataSrcIPAddr;
@ -240,7 +233,6 @@ struct _ipHdrDataDef {
typedef struct _portDataDef portDataDef;
typedef portDataDef *portDataDefPtr;
struct _portDataDef {
nwItemDesc dataSrcPortStart;
nwItemDesc dataSrcPortEnd;
@ -250,7 +242,6 @@ struct _portDataDef {
typedef struct _ipHdrFilterDef ipHdrFilterDef;
typedef ipHdrFilterDef *ipHdrFilterDefPtr;
struct _ipHdrFilterDef {
ethHdrDataDef ethHdr;
ipHdrDataDef ipHdr;
@ -259,7 +250,6 @@ struct _ipHdrFilterDef {
typedef struct _ipv6HdrFilterDef ipv6HdrFilterDef;
typedef ipv6HdrFilterDef *ipv6HdrFilterDefPtr;
struct _ipv6HdrFilterDef {
ethHdrDataDef ethHdr;
ipHdrDataDef ipHdr;
@ -272,7 +262,6 @@ struct _ipv6HdrFilterDef {
typedef struct _icmpHdrFilterDef icmpHdrFilterDef;
typedef icmpHdrFilterDef *icmpHdrFilterDefPtr;
struct _icmpHdrFilterDef {
nwItemDesc dataSrcMACAddr;
ipHdrDataDef ipHdr;
@ -283,7 +272,6 @@ struct _icmpHdrFilterDef {
typedef struct _allHdrFilterDef allHdrFilterDef;
typedef allHdrFilterDef *allHdrFilterDefPtr;
struct _allHdrFilterDef {
nwItemDesc dataSrcMACAddr;
ipHdrDataDef ipHdr;
@ -291,7 +279,6 @@ struct _allHdrFilterDef {
typedef struct _igmpHdrFilterDef igmpHdrFilterDef;
typedef igmpHdrFilterDef *igmpHdrFilterDefPtr;
struct _igmpHdrFilterDef {
nwItemDesc dataSrcMACAddr;
ipHdrDataDef ipHdr;
@ -299,7 +286,6 @@ struct _igmpHdrFilterDef {
typedef struct _tcpHdrFilterDef tcpHdrFilterDef;
typedef tcpHdrFilterDef *tcpHdrFilterDefPtr;
struct _tcpHdrFilterDef {
nwItemDesc dataSrcMACAddr;
ipHdrDataDef ipHdr;
@ -310,7 +296,6 @@ struct _tcpHdrFilterDef {
typedef struct _udpHdrFilterDef udpHdrFilterDef;
typedef udpHdrFilterDef *udpHdrFilterDefPtr;
struct _udpHdrFilterDef {
nwItemDesc dataSrcMACAddr;
ipHdrDataDef ipHdr;
@ -319,7 +304,6 @@ struct _udpHdrFilterDef {
typedef struct _sctpHdrFilterDef sctpHdrFilterDef;
typedef sctpHdrFilterDef *sctpHdrFilterDefPtr;
struct _sctpHdrFilterDef {
nwItemDesc dataSrcMACAddr;
ipHdrDataDef ipHdr;
@ -328,7 +312,6 @@ struct _sctpHdrFilterDef {
typedef struct _espHdrFilterDef espHdrFilterDef;
typedef espHdrFilterDef *espHdrFilterDefPtr;
struct _espHdrFilterDef {
nwItemDesc dataSrcMACAddr;
ipHdrDataDef ipHdr;
@ -336,7 +319,6 @@ struct _espHdrFilterDef {
typedef struct _ahHdrFilterDef ahHdrFilterDef;
typedef ahHdrFilterDef *ahHdrFilterDefPtr;
struct _ahHdrFilterDef {
nwItemDesc dataSrcMACAddr;
ipHdrDataDef ipHdr;
@ -344,7 +326,6 @@ struct _ahHdrFilterDef {
typedef struct _udpliteHdrFilterDef udpliteHdrFilterDef;
typedef udpliteHdrFilterDef *udpliteHdrFilterDefPtr;
struct _udpliteHdrFilterDef {
nwItemDesc dataSrcMACAddr;
ipHdrDataDef ipHdr;
@ -457,13 +438,12 @@ typedef enum {
RULE_FLAG_STATE_INVALID | \
RULE_FLAG_STATE_NONE)
void virNWFilterPrintStateMatchFlags(virBufferPtr buf, const char *prefix,
void virNWFilterPrintStateMatchFlags(virBuffer *buf, const char *prefix,
int32_t flags, bool disp_none);
typedef int32_t virNWFilterRulePriority;
typedef struct _virNWFilterRuleDef virNWFilterRuleDef;
typedef virNWFilterRuleDef *virNWFilterRuleDefPtr;
struct _virNWFilterRuleDef {
virNWFilterRulePriority priority;
virNWFilterRuleFlags flags;
@ -489,7 +469,7 @@ struct _virNWFilterRuleDef {
} p;
size_t nVarAccess;
virNWFilterVarAccessPtr *varAccess;
virNWFilterVarAccess **varAccess;
size_t nstrings;
char **strings;
@ -497,7 +477,6 @@ struct _virNWFilterRuleDef {
typedef struct _virNWFilterIncludeDef virNWFilterIncludeDef;
typedef virNWFilterIncludeDef *virNWFilterIncludeDefPtr;
struct _virNWFilterIncludeDef {
char *filterref;
GHashTable *params;
@ -505,7 +484,6 @@ struct _virNWFilterIncludeDef {
typedef struct _virNWFilterEntry virNWFilterEntry;
typedef virNWFilterEntry *virNWFilterEntryPtr;
struct _virNWFilterEntry {
virNWFilterRuleDef *rule;
virNWFilterIncludeDef *include;
@ -530,8 +508,6 @@ typedef enum {
typedef int32_t virNWFilterChainPriority;
typedef struct _virNWFilterDef virNWFilterDef;
typedef virNWFilterDef *virNWFilterDefPtr;
struct _virNWFilterDef {
char *name;
unsigned char uuid[VIR_UUID_BUFLEN];
@ -541,24 +517,24 @@ struct _virNWFilterDef {
virNWFilterChainPriority chainPriority;
size_t nentries;
virNWFilterEntryPtr *filterEntries;
virNWFilterEntry **filterEntries;
};
void
virNWFilterRuleDefFree(virNWFilterRuleDefPtr def);
virNWFilterRuleDefFree(virNWFilterRuleDef *def);
void
virNWFilterDefFree(virNWFilterDefPtr def);
virNWFilterDefFree(virNWFilterDef *def);
int
virNWFilterTriggerRebuild(void);
int
virNWFilterDeleteDef(const char *configDir,
virNWFilterDefPtr def);
virNWFilterDef *def);
virNWFilterDefPtr
virNWFilterDef *
virNWFilterDefParseNode(xmlDocPtr xml,
xmlNodePtr root);
@ -567,12 +543,12 @@ virNWFilterDefFormat(const virNWFilterDef *def);
int
virNWFilterSaveConfig(const char *configDir,
virNWFilterDefPtr def);
virNWFilterDef *def);
virNWFilterDefPtr
virNWFilterDef *
virNWFilterDefParseString(const char *xml);
virNWFilterDefPtr
virNWFilterDef *
virNWFilterDefParseFile(const char *filename);
void
@ -598,13 +574,13 @@ char *
virNWFilterPrintTCPFlags(uint8_t flags);
bool
virNWFilterRuleIsProtocolIPv4(virNWFilterRuleDefPtr rule);
virNWFilterRuleIsProtocolIPv4(virNWFilterRuleDef *rule);
bool
virNWFilterRuleIsProtocolIPv6(virNWFilterRuleDefPtr rule);
virNWFilterRuleIsProtocolIPv6(virNWFilterRuleDef *rule);
bool
virNWFilterRuleIsProtocolEthernet(virNWFilterRuleDefPtr rule);
virNWFilterRuleIsProtocolEthernet(virNWFilterRuleDef *rule);
VIR_ENUM_DECL(virNWFilterRuleAction);

View File

@ -51,7 +51,7 @@ virNWFilterIPAddrMapAddIPAddr(const char *ifname, char *addr)
{
int ret = -1;
char *addrCopy;
virNWFilterVarValuePtr val;
virNWFilterVarValue *val;
addrCopy = g_strdup(addr);
@ -100,7 +100,7 @@ int
virNWFilterIPAddrMapDelIPAddr(const char *ifname, const char *ipaddr)
{
int ret = -1;
virNWFilterVarValuePtr val = NULL;
virNWFilterVarValue *val = NULL;
virMutexLock(&ipAddressMapLock);
@ -129,13 +129,13 @@ virNWFilterIPAddrMapDelIPAddr(const char *ifname, const char *ipaddr)
/* Get the list of IP addresses known to be in use by an interface
*
* This function returns NULL in case no IP address is known to be
* associated with the interface, a virNWFilterVarValuePtr otherwise
* associated with the interface, a virNWFilterVarValue *otherwise
* that then can contain one or multiple entries.
*/
virNWFilterVarValuePtr
virNWFilterVarValue *
virNWFilterIPAddrMapGetIPAddr(const char *ifname)
{
virNWFilterVarValuePtr res;
virNWFilterVarValue *res;
virMutexLock(&ipAddressMapLock);

View File

@ -28,4 +28,4 @@ void virNWFilterIPAddrMapShutdown(void);
int virNWFilterIPAddrMapAddIPAddr(const char *ifname, char *addr);
int virNWFilterIPAddrMapDelIPAddr(const char *ifname,
const char *ipaddr);
virNWFilterVarValuePtr virNWFilterIPAddrMapGetIPAddr(const char *ifname);
virNWFilterVarValue *virNWFilterIPAddrMapGetIPAddr(const char *ifname);

View File

@ -36,12 +36,12 @@
VIR_LOG_INIT("conf.nwfilter_params");
static bool isValidVarValue(const char *value);
static void virNWFilterVarAccessSetIntIterId(virNWFilterVarAccessPtr,
static void virNWFilterVarAccessSetIntIterId(virNWFilterVarAccess *,
unsigned int);
static unsigned int virNWFilterVarAccessGetIntIterId(const virNWFilterVarAccess *);
void
virNWFilterVarValueFree(virNWFilterVarValuePtr val)
virNWFilterVarValueFree(virNWFilterVarValue *val)
{
size_t i;
@ -63,10 +63,10 @@ virNWFilterVarValueFree(virNWFilterVarValuePtr val)
g_free(val);
}
virNWFilterVarValuePtr
virNWFilterVarValue *
virNWFilterVarValueCopy(const virNWFilterVarValue *val)
{
virNWFilterVarValuePtr res;
virNWFilterVarValue *res;
size_t i;
char *str;
@ -92,10 +92,10 @@ virNWFilterVarValueCopy(const virNWFilterVarValue *val)
return res;
}
virNWFilterVarValuePtr
virNWFilterVarValue *
virNWFilterVarValueCreateSimple(char *value)
{
virNWFilterVarValuePtr val;
virNWFilterVarValue *val;
if (!isValidVarValue(value)) {
virReportError(VIR_ERR_INVALID_ARG, "%s",
@ -111,11 +111,11 @@ virNWFilterVarValueCreateSimple(char *value)
return val;
}
virNWFilterVarValuePtr
virNWFilterVarValue *
virNWFilterVarValueCreateSimpleCopyValue(const char *value)
{
char *val;
virNWFilterVarValuePtr ret;
virNWFilterVarValue *ret;
val = g_strdup(value);
ret = virNWFilterVarValueCreateSimple(val);
@ -203,7 +203,7 @@ virNWFilterVarValueEqual(const virNWFilterVarValue *a,
}
int
virNWFilterVarValueAddValue(virNWFilterVarValuePtr val, char *value)
virNWFilterVarValueAddValue(virNWFilterVarValue *val, char *value)
{
char *tmp;
int rc = -1;
@ -235,7 +235,7 @@ virNWFilterVarValueAddValue(virNWFilterVarValuePtr val, char *value)
int
virNWFilterVarValueAddValueCopy(virNWFilterVarValuePtr val, const char *value)
virNWFilterVarValueAddValueCopy(virNWFilterVarValue *val, const char *value)
{
char *valdup;
valdup = g_strdup(value);
@ -248,7 +248,7 @@ virNWFilterVarValueAddValueCopy(virNWFilterVarValuePtr val, const char *value)
static int
virNWFilterVarValueDelNthValue(virNWFilterVarValuePtr val, unsigned int pos)
virNWFilterVarValueDelNthValue(virNWFilterVarValue *val, unsigned int pos)
{
switch (val->valType) {
case NWFILTER_VALUE_TYPE_SIMPLE:
@ -270,7 +270,7 @@ virNWFilterVarValueDelNthValue(virNWFilterVarValuePtr val, unsigned int pos)
}
int
virNWFilterVarValueDelValue(virNWFilterVarValuePtr val, const char *value)
virNWFilterVarValueDelValue(virNWFilterVarValue *val, const char *value)
{
size_t i;
@ -292,7 +292,7 @@ virNWFilterVarValueDelValue(virNWFilterVarValuePtr val, const char *value)
}
void
virNWFilterVarCombIterFree(virNWFilterVarCombIterPtr ci)
virNWFilterVarCombIterFree(virNWFilterVarCombIter *ci)
{
size_t i;
@ -308,7 +308,7 @@ virNWFilterVarCombIterFree(virNWFilterVarCombIterPtr ci)
}
static int
virNWFilterVarCombIterGetIndexByIterId(virNWFilterVarCombIterPtr ci,
virNWFilterVarCombIterGetIndexByIterId(virNWFilterVarCombIter *ci,
unsigned int iterId)
{
size_t i;
@ -321,7 +321,7 @@ virNWFilterVarCombIterGetIndexByIterId(virNWFilterVarCombIterPtr ci,
}
static void
virNWFilterVarCombIterEntryInit(virNWFilterVarCombIterEntryPtr cie,
virNWFilterVarCombIterEntryInit(virNWFilterVarCombIterEntry *cie,
unsigned int iterId)
{
memset(cie, 0, sizeof(*cie));
@ -329,11 +329,11 @@ virNWFilterVarCombIterEntryInit(virNWFilterVarCombIterEntryPtr cie,
}
static int
virNWFilterVarCombIterAddVariable(virNWFilterVarCombIterEntryPtr cie,
virNWFilterVarCombIterAddVariable(virNWFilterVarCombIterEntry *cie,
GHashTable *hash,
const virNWFilterVarAccess *varAccess)
{
virNWFilterVarValuePtr varValue;
virNWFilterVarValue *varValue;
unsigned int maxValue = 0, minValue = 0;
const char *varName = virNWFilterVarAccessGetVarName(varAccess);
@ -394,12 +394,12 @@ virNWFilterVarCombIterAddVariable(virNWFilterVarCombIterEntryPtr cie,
* skip them since this pair has already been encountered in the 1st iteration
*/
static bool
virNWFilterVarCombIterEntryAreUniqueEntries(virNWFilterVarCombIterEntryPtr cie,
virNWFilterVarCombIterEntryAreUniqueEntries(virNWFilterVarCombIterEntry *cie,
GHashTable *hash)
{
size_t i, j;
virNWFilterVarValuePtr varValue;
virNWFilterVarValuePtr tmp;
virNWFilterVarValue *varValue;
virNWFilterVarValue *tmp;
const char *value;
varValue = virHashLookup(hash, cie->varNames[0]);
@ -453,12 +453,12 @@ virNWFilterVarCombIterEntryAreUniqueEntries(virNWFilterVarCombIterEntryPtr cie,
* which then would cause all combinations of the items of the two lists to
* be created.
*/
virNWFilterVarCombIterPtr
virNWFilterVarCombIter *
virNWFilterVarCombIterCreate(GHashTable *hash,
virNWFilterVarAccessPtr *varAccess,
virNWFilterVarAccess **varAccess,
size_t nVarAccess)
{
virNWFilterVarCombIterPtr res;
virNWFilterVarCombIter *res;
size_t i;
unsigned int iterId;
int iterIndex = -1;
@ -510,8 +510,8 @@ virNWFilterVarCombIterCreate(GHashTable *hash,
return NULL;
}
virNWFilterVarCombIterPtr
virNWFilterVarCombIterNext(virNWFilterVarCombIterPtr ci)
virNWFilterVarCombIter *
virNWFilterVarCombIterNext(virNWFilterVarCombIter *ci)
{
size_t i;
@ -535,14 +535,14 @@ virNWFilterVarCombIterNext(virNWFilterVarCombIterPtr ci)
}
const char *
virNWFilterVarCombIterGetVarValue(virNWFilterVarCombIterPtr ci,
virNWFilterVarCombIterGetVarValue(virNWFilterVarCombIter *ci,
const virNWFilterVarAccess *vap)
{
size_t i;
unsigned int iterId;
bool found = false;
const char *res = NULL;
virNWFilterVarValuePtr value;
virNWFilterVarValue *value;
int iterIndex = -1;
const char *varName = virNWFilterVarAccessGetVarName(vap);
@ -622,12 +622,12 @@ static int
addToTable(void *payload, const char *name, void *data)
{
struct addToTableStruct *atts = (struct addToTableStruct *)data;
virNWFilterVarValuePtr val;
virNWFilterVarValue *val;
if (atts->errOccurred)
return 0;
val = virNWFilterVarValueCopy((virNWFilterVarValuePtr)payload);
val = virNWFilterVarValueCopy((virNWFilterVarValue *)payload);
if (!val) {
atts->errOccurred = 1;
return 0;
@ -689,7 +689,7 @@ isValidVarValue(const char *value)
return (value[strspn(value, VALID_VARVALUE)] == 0) && (strlen(value) != 0);
}
static virNWFilterVarValuePtr
static virNWFilterVarValue *
virNWFilterParseVarValue(const char *val)
{
return virNWFilterVarValueCreateSimpleCopyValue(val);
@ -699,7 +699,7 @@ GHashTable *
virNWFilterParseParamAttributes(xmlNodePtr cur)
{
char *nam, *val;
virNWFilterVarValuePtr value;
virNWFilterVarValue *value;
GHashTable *table = virHashNew(virNWFilterVarValueHashFree);
if (!table)
@ -755,11 +755,11 @@ virNWFilterParseParamAttributes(xmlNodePtr cur)
int
virNWFilterFormatParamAttributes(virBufferPtr buf,
virNWFilterFormatParamAttributes(virBuffer *buf,
GHashTable *table,
const char *filterref)
{
virHashKeyValuePairPtr items;
virHashKeyValuePair *items;
size_t i, j;
int card, numKeys;
@ -803,7 +803,7 @@ virNWFilterFormatParamAttributes(virBufferPtr buf,
}
void
virNWFilterVarAccessFree(virNWFilterVarAccessPtr varAccess)
virNWFilterVarAccessFree(virNWFilterVarAccess *varAccess)
{
if (!varAccess)
return;
@ -838,11 +838,11 @@ virNWFilterVarAccessEqual(const virNWFilterVarAccess *a,
* Parse a variable access like
* IP, IP[@2], IP[3]
*/
virNWFilterVarAccessPtr
virNWFilterVarAccess *
virNWFilterVarAccessParse(const char *varAccess)
{
size_t idx, varNameLen;
virNWFilterVarAccessPtr dest;
virNWFilterVarAccess *dest;
const char *input = varAccess;
dest = g_new0(virNWFilterVarAccess, 1);
@ -927,7 +927,7 @@ virNWFilterVarAccessParse(const char *varAccess)
}
void
virNWFilterVarAccessPrint(virNWFilterVarAccessPtr vap, virBufferPtr buf)
virNWFilterVarAccessPrint(virNWFilterVarAccess *vap, virBuffer *buf)
{
virBufferAdd(buf, vap->varName, -1);
switch (vap->accessType) {
@ -968,7 +968,7 @@ virNWFilterVarAccessGetIndex(const virNWFilterVarAccess *vap)
}
static void
virNWFilterVarAccessSetIntIterId(virNWFilterVarAccessPtr vap,
virNWFilterVarAccessSetIntIterId(virNWFilterVarAccess *vap,
unsigned int intIterId)
{
vap->u.index.intIterId = intIterId;
@ -987,7 +987,7 @@ virNWFilterVarAccessIsAvailable(const virNWFilterVarAccess *varAccess,
const char *varName = virNWFilterVarAccessGetVarName(varAccess);
const char *res;
unsigned int idx;
virNWFilterVarValuePtr varValue;
virNWFilterVarValue *varValue;
varValue = virHashLookup(hash, varName);
if (!varValue)

View File

@ -34,7 +34,6 @@ typedef enum {
} virNWFilterVarValueType;
typedef struct _virNWFilterVarValue virNWFilterVarValue;
typedef virNWFilterVarValue *virNWFilterVarValuePtr;
struct _virNWFilterVarValue {
virNWFilterVarValueType valType;
union {
@ -48,10 +47,10 @@ struct _virNWFilterVarValue {
} u;
};
virNWFilterVarValuePtr virNWFilterVarValueCreateSimple(char *);
virNWFilterVarValuePtr virNWFilterVarValueCreateSimpleCopyValue(const char *);
virNWFilterVarValuePtr virNWFilterVarValueCopy(const virNWFilterVarValue *);
void virNWFilterVarValueFree(virNWFilterVarValuePtr val);
virNWFilterVarValue *virNWFilterVarValueCreateSimple(char *);
virNWFilterVarValue *virNWFilterVarValueCreateSimpleCopyValue(const char *);
virNWFilterVarValue *virNWFilterVarValueCopy(const virNWFilterVarValue *);
void virNWFilterVarValueFree(virNWFilterVarValue *val);
void virNWFilterVarValueHashFree(void *payload);
const char *virNWFilterVarValueGetSimple(const virNWFilterVarValue *val);
const char *virNWFilterVarValueGetNthValue(const virNWFilterVarValue *val,
@ -59,12 +58,12 @@ const char *virNWFilterVarValueGetNthValue(const virNWFilterVarValue *val,
unsigned int virNWFilterVarValueGetCardinality(const virNWFilterVarValue *);
bool virNWFilterVarValueEqual(const virNWFilterVarValue *a,
const virNWFilterVarValue *b);
int virNWFilterVarValueAddValue(virNWFilterVarValuePtr val, char *value);
int virNWFilterVarValueAddValueCopy(virNWFilterVarValuePtr val, const char *value);
int virNWFilterVarValueDelValue(virNWFilterVarValuePtr val, const char *value);
int virNWFilterVarValueAddValue(virNWFilterVarValue *val, char *value);
int virNWFilterVarValueAddValueCopy(virNWFilterVarValue *val, const char *value);
int virNWFilterVarValueDelValue(virNWFilterVarValue *val, const char *value);
GHashTable *virNWFilterParseParamAttributes(xmlNodePtr cur);
int virNWFilterFormatParamAttributes(virBufferPtr buf,
int virNWFilterFormatParamAttributes(virBuffer *buf,
GHashTable *table,
const char *filterref);
@ -92,7 +91,6 @@ typedef enum {
} virNWFilterVarAccessType;
typedef struct _virNWFilterVarAccess virNWFilterVarAccess;
typedef virNWFilterVarAccess *virNWFilterVarAccessPtr;
struct _virNWFilterVarAccess {
virNWFilterVarAccessType accessType;
union {
@ -107,12 +105,12 @@ struct _virNWFilterVarAccess {
#define VIR_NWFILTER_MAX_ITERID 1000
void virNWFilterVarAccessFree(virNWFilterVarAccessPtr varAccess);
void virNWFilterVarAccessFree(virNWFilterVarAccess *varAccess);
bool virNWFilterVarAccessEqual(const virNWFilterVarAccess *a,
const virNWFilterVarAccess *b);
virNWFilterVarAccessPtr virNWFilterVarAccessParse(const char *varAccess);
void virNWFilterVarAccessPrint(virNWFilterVarAccessPtr vap,
virBufferPtr buf);
virNWFilterVarAccess *virNWFilterVarAccessParse(const char *varAccess);
void virNWFilterVarAccessPrint(virNWFilterVarAccess *vap,
virBuffer *buf);
const char *virNWFilterVarAccessGetVarName(const virNWFilterVarAccess *vap);
virNWFilterVarAccessType virNWFilterVarAccessGetType(
const virNWFilterVarAccess *vap);
@ -122,7 +120,6 @@ bool virNWFilterVarAccessIsAvailable(const virNWFilterVarAccess *vap,
GHashTable *hash);
typedef struct _virNWFilterVarCombIterEntry virNWFilterVarCombIterEntry;
typedef virNWFilterVarCombIterEntry *virNWFilterVarCombIterEntryPtr;
struct _virNWFilterVarCombIterEntry {
unsigned int iterId;
const char **varNames;
@ -133,19 +130,18 @@ struct _virNWFilterVarCombIterEntry {
};
typedef struct _virNWFilterVarCombIter virNWFilterVarCombIter;
typedef virNWFilterVarCombIter *virNWFilterVarCombIterPtr;
struct _virNWFilterVarCombIter {
GHashTable *hashTable;
size_t nIter;
virNWFilterVarCombIterEntryPtr iter;
virNWFilterVarCombIterEntry *iter;
};
virNWFilterVarCombIterPtr virNWFilterVarCombIterCreate(
virNWFilterVarCombIter *virNWFilterVarCombIterCreate(
GHashTable *hash,
virNWFilterVarAccessPtr *vars,
virNWFilterVarAccess **vars,
size_t nVars);
void virNWFilterVarCombIterFree(virNWFilterVarCombIterPtr ci);
virNWFilterVarCombIterPtr virNWFilterVarCombIterNext(
virNWFilterVarCombIterPtr ci);
const char *virNWFilterVarCombIterGetVarValue(virNWFilterVarCombIterPtr ci,
void virNWFilterVarCombIterFree(virNWFilterVarCombIter *ci);
virNWFilterVarCombIter *virNWFilterVarCombIterNext(
virNWFilterVarCombIter *ci);
const char *virNWFilterVarCombIterGetVarValue(virNWFilterVarCombIter *ci,
const virNWFilterVarAccess *);

View File

@ -39,7 +39,7 @@ VIR_LOG_INIT("conf.object_event");
struct _virObjectEventCallback {
int callbackID;
virClassPtr klass;
virClass *klass;
int eventID;
virConnectPtr conn;
int remoteID;
@ -54,35 +54,33 @@ struct _virObjectEventCallback {
bool legacy; /* true if end user does not know callbackID */
};
typedef struct _virObjectEventCallback virObjectEventCallback;
typedef virObjectEventCallback *virObjectEventCallbackPtr;
struct _virObjectEventCallbackList {
unsigned int nextID;
size_t count;
virObjectEventCallbackPtr *callbacks;
virObjectEventCallback **callbacks;
};
struct _virObjectEventQueue {
size_t count;
virObjectEventPtr *events;
virObjectEvent **events;
};
typedef struct _virObjectEventQueue virObjectEventQueue;
typedef virObjectEventQueue *virObjectEventQueuePtr;
struct _virObjectEventState {
virObjectLockable parent;
/* The list of domain event callbacks */
virObjectEventCallbackListPtr callbacks;
virObjectEventCallbackList *callbacks;
/* The queue of object events */
virObjectEventQueuePtr queue;
virObjectEventQueue *queue;
/* Timer for flushing events queue */
int timer;
/* Flag if we're in process of dispatching */
bool isDispatching;
};
static virClassPtr virObjectEventClass;
static virClassPtr virObjectEventStateClass;
static virClass *virObjectEventClass;
static virClass *virObjectEventStateClass;
static void virObjectEventDispose(void *obj);
static void virObjectEventStateDispose(void *obj);
@ -107,7 +105,7 @@ VIR_ONCE_GLOBAL_INIT(virObjectEvent);
* Return the class object to be used as a parent when creating an
* event subclass.
*/
virClassPtr
virClass *
virClassForObjectEvent(void)
{
if (virObjectEventInitialize() < 0)
@ -119,7 +117,7 @@ virClassForObjectEvent(void)
static void
virObjectEventDispose(void *obj)
{
virObjectEventPtr event = obj;
virObjectEvent *event = obj;
VIR_DEBUG("obj=%p", event);
@ -134,7 +132,7 @@ virObjectEventDispose(void *obj)
* Free the memory in the domain event callback
*/
static void
virObjectEventCallbackFree(virObjectEventCallbackPtr cb)
virObjectEventCallbackFree(virObjectEventCallback *cb)
{
if (!cb)
return;
@ -151,7 +149,7 @@ virObjectEventCallbackFree(virObjectEventCallbackPtr cb)
* Free the memory in the domain event callback list
*/
static void
virObjectEventCallbackListFree(virObjectEventCallbackListPtr list)
virObjectEventCallbackListFree(virObjectEventCallbackList *list)
{
size_t i;
if (!list)
@ -192,8 +190,8 @@ virObjectEventCallbackListFree(virObjectEventCallbackListPtr list)
*/
static int
virObjectEventCallbackListCount(virConnectPtr conn,
virObjectEventCallbackListPtr cbList,
virClassPtr klass,
virObjectEventCallbackList *cbList,
virClass *klass,
int eventID,
const char *key,
bool serverFilter)
@ -202,7 +200,7 @@ virObjectEventCallbackListCount(virConnectPtr conn,
int ret = 0;
for (i = 0; i < cbList->count; i++) {
virObjectEventCallbackPtr cb = cbList->callbacks[i];
virObjectEventCallback *cb = cbList->callbacks[i];
if (cb->filter)
continue;
@ -226,18 +224,18 @@ virObjectEventCallbackListCount(virConnectPtr conn,
* @callback: the callback to remove
* @doFreeCb: Inhibit calling the freecb
*
* Internal function to remove a callback from a virObjectEventCallbackListPtr
* Internal function to remove a callback from a virObjectEventCallbackList *
*/
static int
virObjectEventCallbackListRemoveID(virConnectPtr conn,
virObjectEventCallbackListPtr cbList,
virObjectEventCallbackList *cbList,
int callbackID,
bool doFreeCb)
{
size_t i;
for (i = 0; i < cbList->count; i++) {
virObjectEventCallbackPtr cb = cbList->callbacks[i];
virObjectEventCallback *cb = cbList->callbacks[i];
if (cb->callbackID == callbackID && cb->conn == conn) {
int ret;
@ -268,13 +266,13 @@ virObjectEventCallbackListRemoveID(virConnectPtr conn,
static int
virObjectEventCallbackListMarkDeleteID(virConnectPtr conn,
virObjectEventCallbackListPtr cbList,
virObjectEventCallbackList *cbList,
int callbackID)
{
size_t i;
for (i = 0; i < cbList->count; i++) {
virObjectEventCallbackPtr cb = cbList->callbacks[i];
virObjectEventCallback *cb = cbList->callbacks[i];
if (cb->callbackID == callbackID && cb->conn == conn) {
cb->deleted = true;
@ -294,7 +292,7 @@ virObjectEventCallbackListMarkDeleteID(virConnectPtr conn,
static int
virObjectEventCallbackListPurgeMarked(virObjectEventCallbackListPtr cbList)
virObjectEventCallbackListPurgeMarked(virObjectEventCallbackList *cbList)
{
size_t n;
for (n = 0; n < cbList->count; n++) {
@ -332,9 +330,9 @@ virObjectEventCallbackListPurgeMarked(virObjectEventCallbackListPtr cbList)
*/
static int ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2)
virObjectEventCallbackLookup(virConnectPtr conn,
virObjectEventCallbackListPtr cbList,
virObjectEventCallbackList *cbList,
const char *key,
virClassPtr klass,
virClass *klass,
int eventID,
virConnectObjectEventGenericCallback callback,
bool legacy,
@ -346,7 +344,7 @@ virObjectEventCallbackLookup(virConnectPtr conn,
*remoteID = -1;
for (i = 0; i < cbList->count; i++) {
virObjectEventCallbackPtr cb = cbList->callbacks[i];
virObjectEventCallback *cb = cbList->callbacks[i];
if (cb->deleted)
continue;
@ -382,15 +380,15 @@ virObjectEventCallbackLookup(virConnectPtr conn,
* @callbackID: filled with callback ID
* @serverFilter: true if server supports object filtering
*
* Internal function to add a callback from a virObjectEventCallbackListPtr
* Internal function to add a callback from a virObjectEventCallbackList *
*/
static int
virObjectEventCallbackListAddID(virConnectPtr conn,
virObjectEventCallbackListPtr cbList,
virObjectEventCallbackList *cbList,
const char *key,
virObjectEventCallbackFilter filter,
void *filter_opaque,
virClassPtr klass,
virClass *klass,
int eventID,
virConnectObjectEventGenericCallback callback,
void *opaque,
@ -399,7 +397,7 @@ virObjectEventCallbackListAddID(virConnectPtr conn,
int *callbackID,
bool serverFilter)
{
virObjectEventCallbackPtr cb;
virObjectEventCallback *cb;
int ret = -1;
int remoteID = -1;
@ -469,7 +467,7 @@ virObjectEventCallbackListAddID(virConnectPtr conn,
* Removes all elements from the queue
*/
static void
virObjectEventQueueClear(virObjectEventQueuePtr queue)
virObjectEventQueueClear(virObjectEventQueue *queue)
{
size_t i;
if (!queue)
@ -488,7 +486,7 @@ virObjectEventQueueClear(virObjectEventQueuePtr queue)
* Free the memory in the queue. We process this like a list here
*/
static void
virObjectEventQueueFree(virObjectEventQueuePtr queue)
virObjectEventQueueFree(virObjectEventQueue *queue)
{
if (!queue)
return;
@ -497,7 +495,7 @@ virObjectEventQueueFree(virObjectEventQueuePtr queue)
g_free(queue);
}
static virObjectEventQueuePtr
static virObjectEventQueue *
virObjectEventQueueNew(void)
{
return g_new0(virObjectEventQueue, 1);
@ -506,14 +504,14 @@ virObjectEventQueueNew(void)
/**
* virObjectEventStateDispose:
* @list: virObjectEventStatePtr to free
* @list: virObjectEventState * to free
*
* Free a virObjectEventStatePtr and its members, and unregister the timer.
* Free a virObjectEventState * and its members, and unregister the timer.
*/
static void
virObjectEventStateDispose(void *obj)
{
virObjectEventStatePtr state = obj;
virObjectEventState *state = obj;
VIR_DEBUG("obj=%p", state);
@ -525,7 +523,7 @@ virObjectEventStateDispose(void *obj)
}
static void virObjectEventStateFlush(virObjectEventStatePtr state);
static void virObjectEventStateFlush(virObjectEventState *state);
/**
@ -540,7 +538,7 @@ static void virObjectEventStateFlush(virObjectEventStatePtr state);
static void
virObjectEventTimer(int timer G_GNUC_UNUSED, void *opaque)
{
virObjectEventStatePtr state = opaque;
virObjectEventState *state = opaque;
virObjectEventStateFlush(state);
}
@ -551,10 +549,10 @@ virObjectEventTimer(int timer G_GNUC_UNUSED, void *opaque)
*
* Allocate a new event state object.
*/
virObjectEventStatePtr
virObjectEventState *
virObjectEventStateNew(void)
{
virObjectEventStatePtr state = NULL;
virObjectEventState *state = NULL;
if (virObjectEventInitialize() < 0)
return NULL;
@ -590,7 +588,7 @@ virObjectEventStateNew(void)
* Create a new event, with the information common to all events.
*/
void *
virObjectEventNew(virClassPtr klass,
virObjectEventNew(virClass *klass,
virObjectEventDispatchFunc dispatcher,
int eventID,
int id,
@ -598,7 +596,7 @@ virObjectEventNew(virClassPtr klass,
const unsigned char *uuid,
const char *key)
{
virObjectEventPtr event;
virObjectEvent *event;
if (virObjectEventInitialize() < 0)
return NULL;
@ -638,8 +636,8 @@ virObjectEventNew(virClassPtr klass,
* Returns: 0 on success, -1 on failure
*/
static int
virObjectEventQueuePush(virObjectEventQueuePtr evtQueue,
virObjectEventPtr event)
virObjectEventQueuePush(virObjectEventQueue *evtQueue,
virObjectEvent *event)
{
if (!evtQueue)
return -1;
@ -651,8 +649,8 @@ virObjectEventQueuePush(virObjectEventQueuePtr evtQueue,
static bool
virObjectEventDispatchMatchCallback(virObjectEventPtr event,
virObjectEventCallbackPtr cb)
virObjectEventDispatchMatchCallback(virObjectEvent *event,
virObjectEventCallback *cb)
{
if (!cb)
return false;
@ -675,9 +673,9 @@ virObjectEventDispatchMatchCallback(virObjectEventPtr event,
static void
virObjectEventStateDispatchCallbacks(virObjectEventStatePtr state,
virObjectEventPtr event,
virObjectEventCallbackListPtr callbacks)
virObjectEventStateDispatchCallbacks(virObjectEventState *state,
virObjectEvent *event,
virObjectEventCallbackList *callbacks)
{
size_t i;
/* Cache this now, since we may be dropping the lock,
@ -686,7 +684,7 @@ virObjectEventStateDispatchCallbacks(virObjectEventStatePtr state,
size_t cbCount = callbacks->count;
for (i = 0; i < cbCount; i++) {
virObjectEventCallbackPtr cb = callbacks->callbacks[i];
virObjectEventCallback *cb = callbacks->callbacks[i];
if (!virObjectEventDispatchMatchCallback(event, cb))
continue;
@ -700,9 +698,9 @@ virObjectEventStateDispatchCallbacks(virObjectEventStatePtr state,
static void
virObjectEventStateQueueDispatch(virObjectEventStatePtr state,
virObjectEventQueuePtr queue,
virObjectEventCallbackListPtr callbacks)
virObjectEventStateQueueDispatch(virObjectEventState *state,
virObjectEventQueue *queue,
virObjectEventCallbackList *callbacks)
{
size_t i;
@ -729,8 +727,8 @@ virObjectEventStateQueueDispatch(virObjectEventStatePtr state,
* id.
*/
void
virObjectEventStateQueueRemote(virObjectEventStatePtr state,
virObjectEventPtr event,
virObjectEventStateQueueRemote(virObjectEventState *state,
virObjectEvent *event,
int remoteID)
{
if (!event)
@ -765,15 +763,15 @@ virObjectEventStateQueueRemote(virObjectEventStatePtr state,
* call.
*/
void
virObjectEventStateQueue(virObjectEventStatePtr state,
virObjectEventPtr event)
virObjectEventStateQueue(virObjectEventState *state,
virObjectEvent *event)
{
virObjectEventStateQueueRemote(state, event, -1);
}
static void
virObjectEventStateCleanupTimer(virObjectEventStatePtr state, bool clear_queue)
virObjectEventStateCleanupTimer(virObjectEventState *state, bool clear_queue)
{
/* There are still some callbacks, keep the timer. */
if (state->callbacks->count)
@ -792,7 +790,7 @@ virObjectEventStateCleanupTimer(virObjectEventStatePtr state, bool clear_queue)
static void
virObjectEventStateFlush(virObjectEventStatePtr state)
virObjectEventStateFlush(virObjectEventState *state)
{
virObjectEventQueue tempQueue;
@ -863,11 +861,11 @@ virObjectEventStateFlush(virObjectEventStatePtr state)
*/
int
virObjectEventStateRegisterID(virConnectPtr conn,
virObjectEventStatePtr state,
virObjectEventState *state,
const char *key,
virObjectEventCallbackFilter filter,
void *filter_opaque,
virClassPtr klass,
virClass *klass,
int eventID,
virConnectObjectEventGenericCallback cb,
void *opaque,
@ -929,7 +927,7 @@ virObjectEventStateRegisterID(virConnectPtr conn,
*/
int
virObjectEventStateDeregisterID(virConnectPtr conn,
virObjectEventStatePtr state,
virObjectEventState *state,
int callbackID,
bool doFreeCb)
{
@ -966,8 +964,8 @@ virObjectEventStateDeregisterID(virConnectPtr conn,
*/
int
virObjectEventStateCallbackID(virConnectPtr conn,
virObjectEventStatePtr state,
virClassPtr klass,
virObjectEventState *state,
virClass *klass,
int eventID,
virConnectObjectEventGenericCallback callback,
int *remoteID)
@ -1004,17 +1002,17 @@ virObjectEventStateCallbackID(virConnectPtr conn,
*/
int
virObjectEventStateEventID(virConnectPtr conn,
virObjectEventStatePtr state,
virObjectEventState *state,
int callbackID,
int *remoteID)
{
int ret = -1;
size_t i;
virObjectEventCallbackListPtr cbList = state->callbacks;
virObjectEventCallbackList *cbList = state->callbacks;
virObjectLock(state);
for (i = 0; i < cbList->count; i++) {
virObjectEventCallbackPtr cb = cbList->callbacks[i];
virObjectEventCallback *cb = cbList->callbacks[i];
if (cb->deleted)
continue;
@ -1050,7 +1048,7 @@ virObjectEventStateEventID(virConnectPtr conn,
*/
void
virObjectEventStateSetRemote(virConnectPtr conn,
virObjectEventStatePtr state,
virObjectEventState *state,
int callbackID,
int remoteID)
{
@ -1058,7 +1056,7 @@ virObjectEventStateSetRemote(virConnectPtr conn,
virObjectLock(state);
for (i = 0; i < state->callbacks->count; i++) {
virObjectEventCallbackPtr cb = state->callbacks->callbacks[i];
virObjectEventCallback *cb = state->callbacks->callbacks[i];
if (cb->deleted)
continue;

View File

@ -31,13 +31,11 @@
* in a call / response rpc
*/
typedef struct _virObjectEvent virObjectEvent;
typedef virObjectEvent *virObjectEventPtr;
typedef struct _virObjectEventState virObjectEventState;
typedef virObjectEventState *virObjectEventStatePtr;
virObjectEventStatePtr
virObjectEventState *
virObjectEventStateNew(void);
/**
@ -57,33 +55,33 @@ typedef void (*virConnectObjectEventGenericCallback)(virConnectPtr conn,
((virConnectObjectEventGenericCallback)(cb))
void
virObjectEventStateQueue(virObjectEventStatePtr state,
virObjectEventPtr event)
virObjectEventStateQueue(virObjectEventState *state,
virObjectEvent *event)
ATTRIBUTE_NONNULL(1);
void
virObjectEventStateQueueRemote(virObjectEventStatePtr state,
virObjectEventPtr event,
virObjectEventStateQueueRemote(virObjectEventState *state,
virObjectEvent *event,
int remoteID)
ATTRIBUTE_NONNULL(1);
int
virObjectEventStateDeregisterID(virConnectPtr conn,
virObjectEventStatePtr state,
virObjectEventState *state,
int callbackID,
bool doFreeCb)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
int
virObjectEventStateEventID(virConnectPtr conn,
virObjectEventStatePtr state,
virObjectEventState *state,
int callbackID,
int *remoteID)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
void
virObjectEventStateSetRemote(virConnectPtr conn,
virObjectEventStatePtr state,
virObjectEventState *state,
int callbackID,
int remoteID)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);

View File

@ -31,14 +31,12 @@ struct _virObjectMeta {
char *key;
};
typedef struct _virObjectMeta virObjectMeta;
typedef virObjectMeta *virObjectMetaPtr;
typedef struct _virObjectEventCallbackList virObjectEventCallbackList;
typedef virObjectEventCallbackList *virObjectEventCallbackListPtr;
typedef void
(*virObjectEventDispatchFunc)(virConnectPtr conn,
virObjectEventPtr event,
virObjectEvent *event,
virConnectObjectEventGenericCallback cb,
void *cbopaque);
@ -61,19 +59,19 @@ struct __attribute__((aligned(8))) _virObjectEvent {
* be sent to @conn.
*/
typedef bool (*virObjectEventCallbackFilter)(virConnectPtr conn,
virObjectEventPtr event,
virObjectEvent *event,
void *opaque);
virClassPtr
virClass *
virClassForObjectEvent(void);
int
virObjectEventStateRegisterID(virConnectPtr conn,
virObjectEventStatePtr state,
virObjectEventState *state,
const char *key,
virObjectEventCallbackFilter filter,
void *filter_opaque,
virClassPtr klass,
virClass *klass,
int eventID,
virConnectObjectEventGenericCallback cb,
void *opaque,
@ -86,8 +84,8 @@ virObjectEventStateRegisterID(virConnectPtr conn,
int
virObjectEventStateCallbackID(virConnectPtr conn,
virObjectEventStatePtr state,
virClassPtr klass,
virObjectEventState *state,
virClass *klass,
int eventID,
virConnectObjectEventGenericCallback callback,
int *remoteID)
@ -95,7 +93,7 @@ virObjectEventStateCallbackID(virConnectPtr conn,
ATTRIBUTE_NONNULL(5);
void *
virObjectEventNew(virClassPtr klass,
virObjectEventNew(virClass *klass,
virObjectEventDispatchFunc dispatcher,
int eventID,
int id,

View File

@ -38,7 +38,7 @@
VIR_LOG_INIT("conf.secret_conf");
void
virSecretDefFree(virSecretDefPtr def)
virSecretDefFree(virSecretDef *def)
{
if (def == NULL)
return;
@ -50,7 +50,7 @@ virSecretDefFree(virSecretDefPtr def)
static int
virSecretDefParseUsage(xmlXPathContextPtr ctxt,
virSecretDefPtr def)
virSecretDef *def)
{
g_autofree char *type_str = NULL;
int type;
@ -126,7 +126,7 @@ virSecretDefParseUsage(xmlXPathContextPtr ctxt,
return 0;
}
static virSecretDefPtr
static virSecretDef *
secretXMLParseNode(xmlDocPtr xml, xmlNodePtr root)
{
g_autoptr(xmlXPathContext) ctxt = NULL;
@ -189,12 +189,12 @@ secretXMLParseNode(xmlDocPtr xml, xmlNodePtr root)
return g_steal_pointer(&def);
}
static virSecretDefPtr
static virSecretDef *
virSecretDefParse(const char *xmlStr,
const char *filename)
{
xmlDocPtr xml;
virSecretDefPtr ret = NULL;
virSecretDef *ret = NULL;
if ((xml = virXMLParse(filename, xmlStr, _("(definition_of_secret)")))) {
ret = secretXMLParseNode(xml, xmlDocGetRootElement(xml));
@ -204,20 +204,20 @@ virSecretDefParse(const char *xmlStr,
return ret;
}
virSecretDefPtr
virSecretDef *
virSecretDefParseString(const char *xmlStr)
{
return virSecretDefParse(xmlStr, NULL);
}
virSecretDefPtr
virSecretDef *
virSecretDefParseFile(const char *filename)
{
return virSecretDefParse(NULL, filename);
}
static int
virSecretDefFormatUsage(virBufferPtr buf,
virSecretDefFormatUsage(virBuffer *buf,
const virSecretDef *def)
{
const char *type;

View File

@ -23,7 +23,6 @@
#include "internal.h"
typedef struct _virSecretDef virSecretDef;
typedef virSecretDef *virSecretDefPtr;
struct _virSecretDef {
bool isephemeral;
bool isprivate;
@ -33,11 +32,11 @@ struct _virSecretDef {
char *usage_id; /* May be NULL */
};
void virSecretDefFree(virSecretDefPtr def);
void virSecretDefFree(virSecretDef *def);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(virSecretDef, virSecretDefFree);
virSecretDefPtr virSecretDefParseString(const char *xml);
virSecretDefPtr virSecretDefParseFile(const char *filename);
virSecretDef *virSecretDefParseString(const char *xml);
virSecretDef *virSecretDefParseFile(const char *filename);
char *virSecretDefFormat(const virSecretDef *def);
#define VIR_CONNECT_LIST_SECRETS_FILTERS_EPHEMERAL \

Some files were not shown because too many files have changed in this diff Show More