mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-09-17 21:45:33 +03:00
Compare commits
17 Commits
v3.2.1
...
v1.2.6-mai
Author | SHA1 | Date | |
---|---|---|---|
|
d933f68ee6 | ||
|
6ae4339383 | ||
|
aaf8c5dc14 | ||
|
dd2b525161 | ||
|
11b1dd70e4 | ||
|
42e0a5bfd7 | ||
|
b0f598e82e | ||
|
b87f3f835a | ||
|
9b056d8daf | ||
|
6a3b2c09fe | ||
|
3f874370d2 | ||
|
bad50b7501 | ||
|
16d1074306 | ||
|
59fff7ff98 | ||
|
7dcab231de | ||
|
4e701c06c5 | ||
|
87eac02988 |
@@ -24,6 +24,13 @@ AC_DEFUN([LIBVIRT_CHECK_UDEV],[
|
||||
if test "$with_udev" = "yes" && test "$with_pciaccess" != "yes" ; then
|
||||
AC_MSG_ERROR([You must install the pciaccess module to build with udev])
|
||||
fi
|
||||
|
||||
if test "$with_udev" = "yes" ; then
|
||||
PKG_CHECK_EXISTS([libudev >= 218], [with_udev_logging=no], [with_udev_logging=yes])
|
||||
if test "$with_udev_logging" = "yes" ; then
|
||||
AC_DEFINE_UNQUOTED([HAVE_UDEV_LOGGING], 1, [whether libudev logging can be used])
|
||||
fi
|
||||
fi
|
||||
])
|
||||
|
||||
AC_DEFUN([LIBVIRT_RESULT_UDEV],[
|
||||
|
@@ -257,6 +257,8 @@ rm -rf $RPM_BUILD_ROOT%{mingw64_libexecdir}/libvirt-guests.sh
|
||||
|
||||
%{mingw64_libdir}/libvirt.dll.a
|
||||
%{mingw64_libdir}/pkgconfig/libvirt.pc
|
||||
%{mingw64_libdir}/pkgconfig/libvirt-qemu.pc
|
||||
%{mingw64_libdir}/pkgconfig/libvirt-lxc.pc
|
||||
%{mingw64_libdir}/libvirt-lxc.dll.a
|
||||
%{mingw64_libdir}/libvirt-qemu.dll.a
|
||||
|
||||
|
@@ -19407,7 +19407,7 @@ virDomainListPopulate(void *payload,
|
||||
/* just count the machines */
|
||||
if (!data->domains) {
|
||||
data->ndomains++;
|
||||
return;
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if (!(dom = virGetDomain(data->conn, vm->def->name, vm->def->uuid))) {
|
||||
|
@@ -4348,7 +4348,8 @@ virDomainGetXMLDesc(virDomainPtr domain, unsigned int flags)
|
||||
virCheckDomainReturn(domain, NULL);
|
||||
conn = domain->conn;
|
||||
|
||||
if ((conn->flags & VIR_CONNECT_RO) && (flags & VIR_DOMAIN_XML_SECURE)) {
|
||||
if ((conn->flags & VIR_CONNECT_RO) &&
|
||||
(flags & (VIR_DOMAIN_XML_SECURE | VIR_DOMAIN_XML_MIGRATABLE))) {
|
||||
virReportError(VIR_ERR_OPERATION_DENIED, "%s",
|
||||
_("virDomainGetXMLDesc with secure flag"));
|
||||
goto error;
|
||||
|
@@ -351,7 +351,7 @@ static int udevGenerateDeviceName(struct udev_device *device,
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
#if HAVE_UDEV_LOGGING
|
||||
typedef void (*udevLogFunctionPtr)(struct udev *udev,
|
||||
int priority,
|
||||
const char *file,
|
||||
@@ -384,6 +384,7 @@ udevLogFunction(struct udev *udev ATTRIBUTE_UNUSED,
|
||||
|
||||
VIR_FREE(format);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
static int udevTranslatePCIIds(unsigned int vendor,
|
||||
@@ -1774,8 +1775,10 @@ static int nodeStateInitialize(bool privileged,
|
||||
* its return value.
|
||||
*/
|
||||
udev = udev_new();
|
||||
#if HAVE_UDEV_LOGGING
|
||||
/* cast to get rid of missing-format-attribute warning */
|
||||
udev_set_log_fn(udev, (udevLogFunctionPtr) udevLogFunction);
|
||||
#endif
|
||||
|
||||
priv->udev_monitor = udev_monitor_new_from_netlink(udev, "udev");
|
||||
if (priv->udev_monitor == NULL) {
|
||||
|
@@ -5612,7 +5612,7 @@ qemuDomainSaveImageGetXMLDesc(virConnectPtr conn, const char *path,
|
||||
if (fd < 0)
|
||||
goto cleanup;
|
||||
|
||||
if (virDomainSaveImageGetXMLDescEnsureACL(conn, def) < 0)
|
||||
if (virDomainSaveImageGetXMLDescEnsureACL(conn, def, flags) < 0)
|
||||
goto cleanup;
|
||||
|
||||
ret = qemuDomainDefFormatXML(driver, def, flags);
|
||||
@@ -10743,8 +10743,10 @@ qemuDomainMigratePerform(virDomainPtr dom,
|
||||
if (!(vm = qemuDomObjFromDomain(dom)))
|
||||
goto cleanup;
|
||||
|
||||
if (virDomainMigratePerformEnsureACL(dom->conn, vm->def) < 0)
|
||||
if (virDomainMigratePerformEnsureACL(dom->conn, vm->def) < 0) {
|
||||
virObjectUnlock(vm);
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if (flags & VIR_MIGRATE_PEER2PEER) {
|
||||
dconnuri = uri;
|
||||
@@ -10791,8 +10793,10 @@ qemuDomainMigrateFinish2(virConnectPtr dconn,
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if (virDomainMigrateFinish2EnsureACL(dconn, vm->def) < 0)
|
||||
if (virDomainMigrateFinish2EnsureACL(dconn, vm->def) < 0) {
|
||||
virObjectUnlock(vm);
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
/* Do not use cookies in v2 protocol, since the cookie
|
||||
* length was not sufficiently large, causing failures
|
||||
@@ -13523,8 +13527,8 @@ qemuDomainSnapshotCreateXML(virDomainPtr domain,
|
||||
}
|
||||
|
||||
if (redefine) {
|
||||
if (!virDomainSnapshotRedefinePrep(domain, vm, &def, &snap,
|
||||
&update_current, flags) < 0)
|
||||
if (virDomainSnapshotRedefinePrep(domain, vm, &def, &snap,
|
||||
&update_current, flags) < 0)
|
||||
goto cleanup;
|
||||
} else {
|
||||
/* Easiest way to clone inactive portion of vm->def is via
|
||||
@@ -13950,7 +13954,7 @@ static char *qemuDomainSnapshotGetXMLDesc(virDomainSnapshotPtr snapshot,
|
||||
if (!(vm = qemuDomObjFromSnapshot(snapshot)))
|
||||
goto cleanup;
|
||||
|
||||
if (virDomainSnapshotGetXMLDescEnsureACL(snapshot->domain->conn, vm->def) < 0)
|
||||
if (virDomainSnapshotGetXMLDescEnsureACL(snapshot->domain->conn, vm->def, flags) < 0)
|
||||
goto cleanup;
|
||||
|
||||
if (!(snap = qemuSnapObjFromSnapshot(vm, snapshot)))
|
||||
@@ -15966,9 +15970,13 @@ qemuDomainGetBlockIoTune(virDomainPtr dom,
|
||||
}
|
||||
|
||||
if (flags & VIR_DOMAIN_AFFECT_CONFIG) {
|
||||
int idx = virDomainDiskIndexByName(vm->def, disk, true);
|
||||
if (idx < 0)
|
||||
int idx = virDomainDiskIndexByName(persistentDef, disk, true);
|
||||
if (idx < 0) {
|
||||
virReportError(VIR_ERR_INVALID_ARG,
|
||||
_("disk '%s' was not found in the domain config"),
|
||||
disk);
|
||||
goto endjob;
|
||||
}
|
||||
reply = persistentDef->disks[idx]->blkdeviotune;
|
||||
}
|
||||
|
||||
|
@@ -3502,6 +3502,7 @@ qemuDomainChangeGraphicsPasswords(virQEMUDriverPtr driver,
|
||||
time_t now = time(NULL);
|
||||
char expire_time [64];
|
||||
const char *connected = NULL;
|
||||
const char *password;
|
||||
int ret = -1;
|
||||
virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver);
|
||||
|
||||
@@ -3509,15 +3510,13 @@ qemuDomainChangeGraphicsPasswords(virQEMUDriverPtr driver,
|
||||
ret = 0;
|
||||
goto cleanup;
|
||||
}
|
||||
password = auth->passwd ? auth->passwd : defaultPasswd;
|
||||
|
||||
if (auth->connected)
|
||||
connected = virDomainGraphicsAuthConnectedTypeToString(auth->connected);
|
||||
|
||||
qemuDomainObjEnterMonitor(driver, vm);
|
||||
ret = qemuMonitorSetPassword(priv->mon,
|
||||
type,
|
||||
auth->passwd ? auth->passwd : defaultPasswd,
|
||||
connected);
|
||||
ret = qemuMonitorSetPassword(priv->mon, type, password, connected);
|
||||
|
||||
if (ret == -2) {
|
||||
if (type != VIR_DOMAIN_GRAPHICS_TYPE_VNC) {
|
||||
@@ -3525,14 +3524,15 @@ qemuDomainChangeGraphicsPasswords(virQEMUDriverPtr driver,
|
||||
_("Graphics password only supported for VNC"));
|
||||
ret = -1;
|
||||
} else {
|
||||
ret = qemuMonitorSetVNCPassword(priv->mon,
|
||||
auth->passwd ? auth->passwd : defaultPasswd);
|
||||
ret = qemuMonitorSetVNCPassword(priv->mon, password);
|
||||
}
|
||||
}
|
||||
if (ret != 0)
|
||||
goto end_job;
|
||||
|
||||
if (auth->expires) {
|
||||
if (password[0] == '\0') {
|
||||
snprintf(expire_time, sizeof(expire_time), "now");
|
||||
} else if (auth->expires) {
|
||||
time_t lifetime = auth->validTo - now;
|
||||
if (lifetime <= 0)
|
||||
snprintf(expire_time, sizeof(expire_time), "now");
|
||||
|
@@ -518,10 +518,6 @@ remoteClientCloseFunc(virNetClientPtr client ATTRIBUTE_UNUSED,
|
||||
cbdata->freeCallback = NULL;
|
||||
}
|
||||
virObjectUnlock(cbdata);
|
||||
|
||||
/* free the connection reference that comes along with the callback
|
||||
* registration */
|
||||
virObjectUnref(cbdata->conn);
|
||||
}
|
||||
|
||||
/* helper macro to ease extraction of arguments from the URI */
|
||||
|
@@ -3189,6 +3189,7 @@ enum remote_procedure {
|
||||
* @generate: both
|
||||
* @acl: domain:read
|
||||
* @acl: domain:read_secure:VIR_DOMAIN_XML_SECURE
|
||||
* @acl: domain:read_secure:VIR_DOMAIN_XML_MIGRATABLE
|
||||
*/
|
||||
REMOTE_PROC_DOMAIN_GET_XML_DESC = 14,
|
||||
|
||||
@@ -4381,6 +4382,7 @@ enum remote_procedure {
|
||||
* @generate: both
|
||||
* @priority: high
|
||||
* @acl: domain:read
|
||||
* @acl: domain:read_secure:VIR_DOMAIN_XML_SECURE
|
||||
*/
|
||||
REMOTE_PROC_DOMAIN_SNAPSHOT_GET_XML_DESC = 186,
|
||||
|
||||
@@ -4711,6 +4713,7 @@ enum remote_procedure {
|
||||
* @generate: both
|
||||
* @priority: high
|
||||
* @acl: domain:read
|
||||
* @acl: domain:read_secure:VIR_DOMAIN_XML_SECURE
|
||||
*/
|
||||
REMOTE_PROC_DOMAIN_SAVE_IMAGE_GET_XML_DESC = 235,
|
||||
|
||||
|
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* storage_backend_fs.c: storage backend for FS and directory handling
|
||||
*
|
||||
* Copyright (C) 2007-2014 Red Hat, Inc.
|
||||
* Copyright (C) 2007-2015 Red Hat, Inc.
|
||||
* Copyright (C) 2007-2008 Daniel P. Berrange
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
@@ -996,6 +996,14 @@ virStorageBackendFileSystemVolCreate(virConnectPtr conn ATTRIBUTE_UNUSED,
|
||||
|
||||
vol->type = VIR_STORAGE_VOL_FILE;
|
||||
|
||||
/* Volumes within a directory pools are not recursive; do not
|
||||
* allow escape to ../ or a subdir */
|
||||
if (strchr(vol->name, '/')) {
|
||||
virReportError(VIR_ERR_OPERATION_INVALID,
|
||||
_("volume name '%s' cannot contain '/'"), vol->name);
|
||||
return -1;
|
||||
}
|
||||
|
||||
VIR_FREE(vol->target.path);
|
||||
if (virAsprintf(&vol->target.path, "%s/%s",
|
||||
pool->def->target.path,
|
||||
|
@@ -1354,23 +1354,25 @@ static struct nla_policy ifla_vf_policy[IFLA_VF_MAX+1] = {
|
||||
/**
|
||||
* virNetDevLinkDump:
|
||||
*
|
||||
* @ifname: The name of the interface; only use if ifindex < 0
|
||||
* @ifindex: The interface index; may be < 0 if ifname is given
|
||||
* @nlattr: pointer to a pointer of netlink attributes that will contain
|
||||
* the results
|
||||
* @ifname: The name of the interface; only use if ifindex <= 0
|
||||
* @ifindex: The interface index; may be <= 0 if ifname is given
|
||||
* @data: Gets a pointer to the raw data from netlink.
|
||||
MUST BE FREED BY CALLER!
|
||||
* @nlattr: Pointer to a pointer of netlink attributes that will contain
|
||||
* the results
|
||||
* @src_pid: pid used for nl_pid of the local end of the netlink message
|
||||
* (0 == "use getpid()")
|
||||
* @dst_pid: pid of destination nl_pid if the kernel
|
||||
* is not the target of the netlink message but it is to be
|
||||
* sent to another process (0 if sending to the kernel)
|
||||
*
|
||||
* Get information about an interface given its name or index.
|
||||
* Get information from netlink about an interface given its name or index.
|
||||
*
|
||||
* Returns 0 on success, -1 on fatal error.
|
||||
*/
|
||||
int
|
||||
virNetDevLinkDump(const char *ifname, int ifindex,
|
||||
struct nlattr **tb,
|
||||
void **nlData, struct nlattr **tb,
|
||||
uint32_t src_pid, uint32_t dst_pid)
|
||||
{
|
||||
int rc = -1;
|
||||
@@ -1452,7 +1454,9 @@ virNetDevLinkDump(const char *ifname, int ifindex,
|
||||
rc = 0;
|
||||
cleanup:
|
||||
nlmsg_free(nl_msg);
|
||||
VIR_FREE(resp);
|
||||
if (rc < 0)
|
||||
VIR_FREE(resp);
|
||||
*nlData = resp;
|
||||
return rc;
|
||||
|
||||
malformed_resp:
|
||||
@@ -1648,15 +1652,18 @@ virNetDevGetVfConfig(const char *ifname, int vf, virMacAddrPtr mac,
|
||||
int *vlanid)
|
||||
{
|
||||
int rc = -1;
|
||||
void *nlData = NULL;
|
||||
struct nlattr *tb[IFLA_MAX + 1] = {NULL, };
|
||||
int ifindex = -1;
|
||||
|
||||
rc = virNetDevLinkDump(ifname, ifindex, tb, 0, 0);
|
||||
rc = virNetDevLinkDump(ifname, ifindex, &nlData, tb, 0, 0);
|
||||
if (rc < 0)
|
||||
return rc;
|
||||
goto cleanup;
|
||||
|
||||
rc = virNetDevParseVfConfig(tb, vf, mac, vlanid);
|
||||
|
||||
cleanup:
|
||||
VIR_FREE(nlData);
|
||||
return rc;
|
||||
}
|
||||
|
||||
@@ -1799,6 +1806,7 @@ virNetDevRestoreNetConfig(const char *linkdev, int vf, const char *stateDir)
|
||||
int
|
||||
virNetDevLinkDump(const char *ifname ATTRIBUTE_UNUSED,
|
||||
int ifindex ATTRIBUTE_UNUSED,
|
||||
void **nlData ATTRIBUTE_UNUSED,
|
||||
struct nlattr **tb ATTRIBUTE_UNUSED,
|
||||
uint32_t src_pid ATTRIBUTE_UNUSED,
|
||||
uint32_t dst_pid ATTRIBUTE_UNUSED)
|
||||
|
@@ -130,7 +130,7 @@ int virNetDevGetVirtualFunctions(const char *pfname,
|
||||
ATTRIBUTE_NONNULL(4) ATTRIBUTE_RETURN_CHECK;
|
||||
|
||||
int virNetDevLinkDump(const char *ifname, int ifindex,
|
||||
struct nlattr **tb,
|
||||
void **nlData, struct nlattr **tb,
|
||||
uint32_t src_pid, uint32_t dst_pid)
|
||||
ATTRIBUTE_RETURN_CHECK;
|
||||
|
||||
|
@@ -787,7 +787,8 @@ virNetDevVPortProfileGetNthParent(const char *ifname, int ifindex, unsigned int
|
||||
int *parent_ifindex, char *parent_ifname,
|
||||
unsigned int *nth)
|
||||
{
|
||||
int rc;
|
||||
int rc = -1;
|
||||
void *nlData = NULL;
|
||||
struct nlattr *tb[IFLA_MAX + 1] = { NULL, };
|
||||
bool end = false;
|
||||
size_t i = 0;
|
||||
@@ -798,7 +799,8 @@ virNetDevVPortProfileGetNthParent(const char *ifname, int ifindex, unsigned int
|
||||
return -1;
|
||||
|
||||
while (!end && i <= nthParent) {
|
||||
rc = virNetDevLinkDump(ifname, ifindex, tb, 0, 0);
|
||||
VIR_FREE(nlData);
|
||||
rc = virNetDevLinkDump(ifname, ifindex, &nlData, tb, 0, 0);
|
||||
if (rc < 0)
|
||||
break;
|
||||
|
||||
@@ -807,7 +809,8 @@ virNetDevVPortProfileGetNthParent(const char *ifname, int ifindex, unsigned int
|
||||
IFNAMSIZ)) {
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||
_("buffer for root interface name is too small"));
|
||||
return -1;
|
||||
rc = -1;
|
||||
goto cleanup;
|
||||
}
|
||||
*parent_ifindex = ifindex;
|
||||
}
|
||||
@@ -823,6 +826,8 @@ virNetDevVPortProfileGetNthParent(const char *ifname, int ifindex, unsigned int
|
||||
|
||||
*nth = i - 1;
|
||||
|
||||
cleanup:
|
||||
VIR_FREE(nlData);
|
||||
return rc;
|
||||
}
|
||||
|
||||
@@ -844,6 +849,7 @@ virNetDevVPortProfileOpCommon(const char *ifname, int ifindex,
|
||||
int rc;
|
||||
int src_pid = 0;
|
||||
uint32_t dst_pid = 0;
|
||||
void *nlData = NULL;
|
||||
struct nlattr *tb[IFLA_MAX + 1] = { NULL, };
|
||||
int repeats = STATUS_POLL_TIMEOUT_USEC / STATUS_POLL_INTERVL_USEC;
|
||||
uint16_t status = 0;
|
||||
@@ -876,7 +882,8 @@ virNetDevVPortProfileOpCommon(const char *ifname, int ifindex,
|
||||
}
|
||||
|
||||
while (--repeats >= 0) {
|
||||
rc = virNetDevLinkDump(NULL, ifindex, tb, src_pid, dst_pid);
|
||||
VIR_FREE(nlData);
|
||||
rc = virNetDevLinkDump(NULL, ifindex, &nlData, tb, src_pid, dst_pid);
|
||||
if (rc < 0)
|
||||
goto cleanup;
|
||||
|
||||
@@ -908,7 +915,7 @@ virNetDevVPortProfileOpCommon(const char *ifname, int ifindex,
|
||||
}
|
||||
|
||||
cleanup:
|
||||
|
||||
VIR_FREE(nlData);
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
@@ -258,6 +258,13 @@ virURIFormat(virURIPtr uri)
|
||||
xmluri.server = tmpserver;
|
||||
}
|
||||
|
||||
/*
|
||||
* This helps libxml2 deal with the difference
|
||||
* between uri:/absolute/path and uri:///absolute/path.
|
||||
*/
|
||||
if (!xmluri.server && !xmluri.port)
|
||||
xmluri.port = -1;
|
||||
|
||||
ret = (char *)xmlSaveUri(&xmluri);
|
||||
if (!ret) {
|
||||
virReportOOMError();
|
||||
|
@@ -3341,9 +3341,10 @@ virDomainXMLDevID(virConnectPtr conn,
|
||||
xenUnifiedPrivatePtr priv = conn->privateData;
|
||||
char *xref;
|
||||
char *tmp;
|
||||
const char *driver = virDomainDiskGetDriver(dev->data.disk);
|
||||
|
||||
if (dev->type == VIR_DOMAIN_DEVICE_DISK) {
|
||||
const char *driver = virDomainDiskGetDriver(dev->data.disk);
|
||||
|
||||
if (STREQ_NULLABLE(driver, "tap") || STREQ_NULLABLE(driver, "tap2"))
|
||||
strcpy(class, driver);
|
||||
else
|
||||
|
@@ -18,7 +18,7 @@
|
||||
#
|
||||
# Author: Yuto KAWAMURA(kawamuray)
|
||||
|
||||
INCLUDES = -I$(top_srcdir)
|
||||
INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/src -I$(top_srcdir)/gnulib/lib
|
||||
|
||||
ws_plugin_LTLIBRARIES = libvirt.la
|
||||
libvirt_la_SOURCES = packet-libvirt.h packet-libvirt.c plugin.c
|
||||
|
@@ -34,6 +34,17 @@
|
||||
#endif
|
||||
#include <rpc/xdr.h>
|
||||
#include "packet-libvirt.h"
|
||||
#include "internal.h"
|
||||
|
||||
#define WIRESHARK_VERSION \
|
||||
((VERSION_MAJOR * 1000 * 1000) + \
|
||||
(VERSION_MINOR * 1000) + \
|
||||
(VERSION_MICRO))
|
||||
|
||||
/* Wireshark 1.12 brings API change */
|
||||
#if WIRESHARK_VERSION < 1012000
|
||||
# define WIRESHARK_COMPAT
|
||||
#endif
|
||||
|
||||
static int proto_libvirt = -1;
|
||||
static int hf_libvirt_length = -1;
|
||||
@@ -306,7 +317,11 @@ dissect_libvirt_payload_xdr_data(tvbuff_t *tvb, proto_tree *tree, gint payload_l
|
||||
}
|
||||
|
||||
payload_tvb = tvb_new_subset(tvb, start, -1, payload_length);
|
||||
#ifdef WIRESHARK_COMPAT
|
||||
payload_data = (caddr_t)tvb_memdup(payload_tvb, 0, payload_length);
|
||||
#else
|
||||
payload_data = (caddr_t)tvb_memdup(NULL, payload_tvb, 0, payload_length);
|
||||
#endif
|
||||
xdrmem_create(&xdrs, payload_data, payload_length, XDR_DECODE);
|
||||
|
||||
dissect(payload_tvb, tree, &xdrs, -1);
|
||||
@@ -349,8 +364,14 @@ dissect_libvirt_payload(tvbuff_t *tvb, proto_tree *tree,
|
||||
proto_tree_add_item(tree, hf_libvirt_unknown, tvb, VIR_HEADER_LEN, -1, ENC_NA);
|
||||
}
|
||||
|
||||
#ifdef WIRESHARK_COMPAT
|
||||
static void
|
||||
dissect_libvirt_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
||||
#else
|
||||
static int
|
||||
dissect_libvirt_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
|
||||
void *opaque ATTRIBUTE_UNUSED)
|
||||
#endif
|
||||
{
|
||||
goffset offset;
|
||||
guint32 prog, proc, type, serial, status;
|
||||
@@ -410,10 +431,14 @@ dissect_libvirt_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
||||
/* Dissect payload remaining */
|
||||
dissect_libvirt_payload(tvb, libvirt_tree, prog, proc, type, status);
|
||||
}
|
||||
|
||||
#ifndef WIRESHARK_COMPAT
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
static guint32
|
||||
get_message_len(packet_info *pinfo __attribute__((unused)), tvbuff_t *tvb, int offset)
|
||||
get_message_len(packet_info *pinfo ATTRIBUTE_UNUSED, tvbuff_t *tvb, int offset)
|
||||
{
|
||||
return tvb_get_ntohl(tvb, offset);
|
||||
}
|
||||
@@ -423,7 +448,13 @@ dissect_libvirt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
||||
{
|
||||
/* Another magic const - 4; simply, how much bytes
|
||||
* is needed to tell the length of libvirt packet. */
|
||||
tcp_dissect_pdus(tvb, pinfo, tree, TRUE, 4, get_message_len, dissect_libvirt_message);
|
||||
#ifdef WIRESHARK_COMPAT
|
||||
tcp_dissect_pdus(tvb, pinfo, tree, TRUE, 4,
|
||||
get_message_len, dissect_libvirt_message);
|
||||
#else
|
||||
tcp_dissect_pdus(tvb, pinfo, tree, TRUE, 4,
|
||||
get_message_len, dissect_libvirt_message, NULL);
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
|
@@ -21,6 +21,8 @@
|
||||
#ifndef _PACKET_LIBVIRT_H_
|
||||
# define _PACKET_LIBVIRT_H_
|
||||
|
||||
# include "libvirt/libvirt.h"
|
||||
|
||||
# ifndef LIBVIRT_PORT
|
||||
# define LIBVIRT_PORT 16509
|
||||
# endif
|
||||
@@ -84,22 +86,6 @@ static const value_string status_strings[] = {
|
||||
{ -1, NULL }
|
||||
};
|
||||
|
||||
/* TODO: These symbols will automatically included in generated headers in the feature */
|
||||
# define VIR_SECURITY_MODEL_BUFLEN (256 + 1)
|
||||
# define VIR_SECURITY_LABEL_BUFLEN (4096 + 1)
|
||||
# define VIR_SECURITY_DOI_BUFLEN (256 + 1)
|
||||
# define VIR_UUID_BUFLEN (16)
|
||||
enum {
|
||||
VIR_TYPED_PARAM_INT = 1, /* integer case */
|
||||
VIR_TYPED_PARAM_UINT = 2, /* unsigned integer case */
|
||||
VIR_TYPED_PARAM_LLONG = 3, /* long long case */
|
||||
VIR_TYPED_PARAM_ULLONG = 4, /* unsigned long long case */
|
||||
VIR_TYPED_PARAM_DOUBLE = 5, /* double case */
|
||||
VIR_TYPED_PARAM_BOOLEAN = 6, /* boolean(character) case */
|
||||
VIR_TYPED_PARAM_STRING = 7, /* string case */
|
||||
};
|
||||
/* / */
|
||||
|
||||
# define VIR_ERROR_MESSAGE_DISSECTOR dissect_xdr_remote_error
|
||||
|
||||
static gboolean dissect_xdr_int(tvbuff_t *tvb, proto_tree *tree, XDR *xdrs, int hf);
|
||||
|
@@ -55,6 +55,13 @@ then
|
||||
#define WS_BUILD_DLL
|
||||
#include "ws_symbol_export.h"
|
||||
|
||||
/* In 1.12 wireshark WS_DLL_PUBLIC_NOEXTERN was substitued with
|
||||
* WS_DLL_PUBLIC_DEF. See wireshark's commit
|
||||
* 5d87a8c46171f572568db5a47c093423482e342f for more info. */
|
||||
#ifndef WS_DLL_PUBLIC_NOEXTERN
|
||||
# define WS_DLL_PUBLIC_NOEXTERN WS_DLL_PUBLIC_DEF
|
||||
#endif
|
||||
|
||||
#ifndef ENABLE_STATIC
|
||||
WS_DLL_PUBLIC_NOEXTERN const gchar version[] = VERSION;
|
||||
|
||||
|
Reference in New Issue
Block a user