@@ -12,5 +12,6 @@ Patches contributed by:
Stepan Kasal <skasal-at-redhat-dot-com>
Ludwig Nussel <ludwig-dot-nussel-at-suse-dot-de>
Zhe Peng <zpeng-at-redhat-dot-com>
+ Osier Yang <jyang-at-redhat-dot-com>
-- End
@@ -1,5 +1,39 @@
Revision history for perl module Sys::Virt
+1.2.3 2014-04-07
+
+ - Add VIR_FROM_CRYPTO error constant
+ - Add VIR_MIGRATE_AUTO_CONVERGE migration constant
+ - Add virDomainCoreDumpWithFormat and its constants
+
+1.2.2 2014-03-03
+
+ - Add new domain blk I/O constants
+ - Add BHyve error code
+
+1.2.1 2014-01-21
+
+ - Add new network event APIs from libvirt 1.2.1
+ - Add new constants in libvirt 1.2.1
+
+1.2.0 2013-12-02
+
+ - Add all new constants in libvirt 1.2.0
+ - Fix reversed args for virNodeDeviceLookupSCSIHostByWWN
+
+1.1.4 2013-11-05
+
+ - Add all new constants in libvirt 1.1.4
+ - Fix impl of "list_secrets" API (RT #82072)
+
+1.1.3 2013-10-02
+
+ - Add all new APIs in libvirt 1.1.3
+
+1.1.2 2013-09-27
+
+ - Add all new constants in libvirt 1.1.2
+
1.1.1 2013-07-30
- Add all new constants/apis in libvirt 1.1.1
@@ -8,6 +8,8 @@ examples/emulator-pin.pl
examples/events.pl
examples/hv-stat.pl
examples/node-cpu.pl
+examples/node-devlist.pl
+examples/node-info.pl
examples/node-ksm.pl
examples/open-console.pl
examples/save-restore.pl
@@ -1,7 +1,7 @@
--- #YAML:1.0
name: Sys-Virt
abstract: Extension for the libvirt library
-version: 1.1.1
+version: 1.2.3
author:
- Daniel P. Berrange <dan@berrange.com>
license: perl
@@ -4,7 +4,7 @@
"Daniel Berrange <dan@berrange.com>"
],
"dynamic_config" : 0,
- "generated_by" : "ExtUtils::MakeMaker version 6.64, CPAN::Meta::Converter version 2.120921",
+ "generated_by" : "ExtUtils::MakeMaker version 6.72, CPAN::Meta::Converter version 2.132140",
"license" : [
"unknown"
],
@@ -42,5 +42,5 @@
}
},
"release_status" : "stable",
- "version" : "v1.1.1"
+ "version" : "v1.2.3"
}
@@ -7,7 +7,7 @@ build_requires:
configure_requires:
ExtUtils::MakeMaker: 0
dynamic_config: 0
-generated_by: 'ExtUtils::MakeMaker version 6.64, CPAN::Meta::Converter version 2.120921'
+generated_by: 'ExtUtils::MakeMaker version 6.72, CPAN::Meta::Converter version 2.132140'
license: unknown
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.4.html
@@ -24,4 +24,4 @@ requires:
Test::Pod::Coverage: 0
Time::HiRes: 0
XML::XPath: 0
-version: v1.1.1
+version: v1.2.3
@@ -3,7 +3,7 @@ use ExtUtils::MakeMaker;
# See lib/ExtUtils/MakeMaker.pm for details of how to influence
# the contents of the Makefile that is written.
-my $libvirtver = "1.1.1";
+my $libvirtver = "1.2.3";
my $stat = system "pkg-config --atleast-version=$libvirtver libvirt";
die "cannot run pkg-config to check libvirt version" if $stat == -1;
die "libvirt >= $libvirtver is required\n" unless $stat == 0;
@@ -20,7 +20,7 @@ my $gccflags = "-W -Waddress -Wall -Warray-bounds -Wattributes \\
-Wformat-extra-args -Wformat-security -Wformat-y2k \\
-Wformat-zero-length -Wformat=2 -Wfree-nonheap-object \\
-Wignored-qualifiers -Wimplicit -Wimplicit-function-declaration \\
- -Wimplicit-int -Winit-self -Winline -Wint-to-pointer-cast \\
+ -Wimplicit-int -Winit-self -Wint-to-pointer-cast \\
-Winvalid-memory-model -Winvalid-pch -Wjump-misses-init \\
-Wlogical-op -Wmain -Wmaybe-uninitialized -Wmissing-braces \\
-Wmissing-declarations -Wmissing-field-initializers \\
@@ -7,6 +7,6 @@ further details on libvirt consult its website http://libvirt.org/
The only pre-requisite for this module is libvirt itself. For
installation instructions, consult the INSTALL file.
-The current minimum required version of libvirt is 1.1.1
+The current minimum required version of libvirt is 1.2.3
-- End
@@ -1,7 +1,7 @@
/* -*- c -*-
*
- * Copyright (C) 2006 Red Hat
- * Copyright (C) 2006-2007 Daniel P. Berrange
+ * Copyright (C) 2006-2014 Red Hat
+ * Copyright (C) 2006-2014 Daniel P. Berrange
*
* This program is free software; You can redistribute it and/or modify
* it under either:
@@ -781,6 +781,82 @@ _domain_event_device_removed_callback(virConnectPtr con,
}
+static int
+_network_event_lifecycle_callback(virConnectPtr con,
+ virNetworkPtr net,
+ int event,
+ int detail,
+ void *opaque)
+{
+ AV *data = opaque;
+ SV **self;
+ SV **cb;
+ SV *netref;
+ dSP;
+
+ self = av_fetch(data, 0, 0);
+ cb = av_fetch(data, 1, 0);
+
+ SvREFCNT_inc(*self);
+
+ ENTER;
+ SAVETMPS;
+
+ PUSHMARK(SP);
+ XPUSHs(*self);
+ netref = sv_newmortal();
+ sv_setref_pv(netref, "Sys::Virt::Network", (void*)net);
+ virNetworkRef(net);
+ XPUSHs(netref);
+ XPUSHs(sv_2mortal(newSViv(event)));
+ XPUSHs(sv_2mortal(newSViv(detail)));
+ PUTBACK;
+
+ call_sv(*cb, G_DISCARD);
+
+ FREETMPS;
+ LEAVE;
+
+ return 0;
+}
+
+
+static int
+_network_event_generic_callback(virConnectPtr con,
+ virNetworkPtr net,
+ void *opaque)
+{
+ AV *data = opaque;
+ SV **self;
+ SV **cb;
+ SV *netref;
+ dSP;
+
+ self = av_fetch(data, 0, 0);
+ cb = av_fetch(data, 1, 0);
+
+ SvREFCNT_inc(*self);
+
+ ENTER;
+ SAVETMPS;
+
+ PUSHMARK(SP);
+ XPUSHs(*self);
+ netref = sv_newmortal();
+ sv_setref_pv(netref, "Sys::Virt::Network", (void*)net);
+ virNetworkRef(net);
+ XPUSHs(netref);
+ PUTBACK;
+
+ call_sv(*cb, G_DISCARD);
+
+ FREETMPS;
+ LEAVE;
+
+ return 0;
+}
+
+
static void
_domain_event_free(void *opaque)
{
@@ -790,6 +866,14 @@ _domain_event_free(void *opaque)
static void
+_network_event_free(void *opaque)
+{
+ SV *sv = opaque;
+ SvREFCNT_dec(sv);
+}
+
+
+static void
_close_callback(virConnectPtr con,
int reason,
void *opaque)
@@ -1724,6 +1808,8 @@ PREINIT:
(void)hv_store (RETVAL, "idle", 4, virt_newSVull(params[i].value), 0);
} else if (strcmp(params[i].field, VIR_NODE_CPU_STATS_IOWAIT) == 0) {
(void)hv_store (RETVAL, "iowait", 6, virt_newSVull(params[i].value), 0);
+ } else if (strcmp(params[i].field, VIR_NODE_CPU_STATS_INTR) == 0) {
+ (void)hv_store (RETVAL, "intr", 4, virt_newSVull(params[i].value), 0);
} else if (strcmp(params[i].field, VIR_NODE_CPU_STATS_UTILIZATION) == 0) {
(void)hv_store (RETVAL, "utilization", 11, virt_newSVull(params[i].value), 0);
}
@@ -1907,6 +1993,27 @@ PREINIT:
OUTPUT:
RETVAL
+void
+get_cpu_model_names(con, arch, flags=0)
+ virConnectPtr con;
+ char *arch;
+ unsigned int flags;
+PREINIT:
+ int nnames;
+ int i;
+ char **names = NULL;
+ PPCODE:
+ if ((nnames = virConnectGetCPUModelNames(con, arch, &names, flags)) < 0)
+ _croak_error();
+
+ EXTEND(SP, nnames);
+ for (i = 0 ; i < nnames ; i++) {
+ PUSHs(sv_2mortal(newSVpv(names[i], 0)));
+ free(names[i]);
+ }
+ free(names);
+
+
int
get_max_vcpus(con, type)
@@ -2588,6 +2695,53 @@ domain_event_deregister_any(con, callbackID)
virConnectDomainEventDeregisterAny(con, callbackID);
+int
+network_event_register_any(conref, netref, eventID, cb)
+ SV* conref;
+ SV* netref;
+ int eventID;
+ SV* cb;
+PREINIT:
+ AV *opaque;
+ virConnectPtr con;
+ virNetworkPtr net;
+ virConnectNetworkEventGenericCallback callback;
+ CODE:
+ con = (virConnectPtr)SvIV((SV*)SvRV(conref));
+ if (SvROK(netref)) {
+ net = (virNetworkPtr)SvIV((SV*)SvRV(netref));
+ } else {
+ net = NULL;
+ }
+
+ switch (eventID) {
+ case VIR_NETWORK_EVENT_ID_LIFECYCLE:
+ callback = VIR_NETWORK_EVENT_CALLBACK(_network_event_lifecycle_callback);
+ break;
+ default:
+ callback = VIR_NETWORK_EVENT_CALLBACK(_network_event_generic_callback);
+ break;
+ }
+
+ opaque = newAV();
+ SvREFCNT_inc(cb);
+ SvREFCNT_inc(conref);
+ av_push(opaque, conref);
+ av_push(opaque, cb);
+ if ((RETVAL = virConnectNetworkEventRegisterAny(con, net, eventID, callback, opaque, _network_event_free)) < 0)
+ _croak_error();
+OUTPUT:
+ RETVAL
+
+
+void
+network_event_deregister_any(con, callbackID)
+ virConnectPtr con;
+ int callbackID;
+ PPCODE:
+ virConnectNetworkEventDeregisterAny(con, callbackID);
+
+
void
register_close_callback(conref, cb)
SV* conref;
@@ -2971,13 +3125,24 @@ managed_save_remove(dom, flags=0)
void
core_dump(dom, to, flags=0)
virDomainPtr dom;
- const char *to
+ const char *to;
unsigned int flags;
PPCODE:
if (virDomainCoreDump(dom, to, flags) < 0)
_croak_error();
+void
+core_dump_format(dom, to, format, flags=0)
+ virDomainPtr dom;
+ const char *to;
+ unsigned int format;
+ unsigned int flags;
+ PPCODE:
+ if (virDomainCoreDumpWithFormat(dom, to, format, flags) < 0)
+ _croak_error();
+
+
HV *
get_info(dom)
virDomainPtr dom;
@@ -3765,29 +3930,33 @@ _migrate(dom, destcon, newparams, flags=0)
virTypedParameter *params;
int nparams;
CODE:
- nparams = 5;
+ nparams = 6;
Newx(params, nparams, virTypedParameter);
- memcpy(params[0].field, VIR_MIGRATE_PARAM_URI,
- VIR_TYPED_PARAM_FIELD_LENGTH);
+ strncpy(params[0].field, VIR_MIGRATE_PARAM_URI,
+ VIR_TYPED_PARAM_FIELD_LENGTH);
params[0].type = VIR_TYPED_PARAM_STRING;
- memcpy(params[1].field, VIR_MIGRATE_PARAM_DEST_NAME,
- VIR_TYPED_PARAM_FIELD_LENGTH);
+ strncpy(params[1].field, VIR_MIGRATE_PARAM_DEST_NAME,
+ VIR_TYPED_PARAM_FIELD_LENGTH);
params[1].type = VIR_TYPED_PARAM_STRING;
- memcpy(params[2].field, VIR_MIGRATE_PARAM_DEST_XML,
- VIR_TYPED_PARAM_FIELD_LENGTH);
+ strncpy(params[2].field, VIR_MIGRATE_PARAM_DEST_XML,
+ VIR_TYPED_PARAM_FIELD_LENGTH);
params[2].type = VIR_TYPED_PARAM_STRING;
- memcpy(params[3].field, VIR_MIGRATE_PARAM_GRAPHICS_URI,
- VIR_TYPED_PARAM_FIELD_LENGTH);
+ strncpy(params[3].field, VIR_MIGRATE_PARAM_GRAPHICS_URI,
+ VIR_TYPED_PARAM_FIELD_LENGTH);
params[3].type = VIR_TYPED_PARAM_STRING;
- memcpy(params[4].field, VIR_MIGRATE_PARAM_BANDWIDTH,
- VIR_TYPED_PARAM_FIELD_LENGTH);
+ strncpy(params[4].field, VIR_MIGRATE_PARAM_BANDWIDTH,
+ VIR_TYPED_PARAM_FIELD_LENGTH);
params[4].type = VIR_TYPED_PARAM_ULLONG;
+ strncpy(params[5].field, VIR_MIGRATE_PARAM_LISTEN_ADDRESS,
+ VIR_TYPED_PARAM_FIELD_LENGTH);
+ params[5].type = VIR_TYPED_PARAM_STRING;
+
nparams = vir_typed_param_from_hv(newparams, params, nparams);
@@ -3817,26 +3986,30 @@ _migrate_to_uri(dom, desturi, newparams, flags=0)
nparams = 5;
Newx(params, nparams, virTypedParameter);
- memcpy(params[0].field, VIR_MIGRATE_PARAM_URI,
- VIR_TYPED_PARAM_FIELD_LENGTH);
+ strncpy(params[0].field, VIR_MIGRATE_PARAM_URI,
+ VIR_TYPED_PARAM_FIELD_LENGTH);
params[0].type = VIR_TYPED_PARAM_STRING;
- memcpy(params[1].field, VIR_MIGRATE_PARAM_DEST_NAME,
- VIR_TYPED_PARAM_FIELD_LENGTH);
+ strncpy(params[1].field, VIR_MIGRATE_PARAM_DEST_NAME,
+ VIR_TYPED_PARAM_FIELD_LENGTH);
params[1].type = VIR_TYPED_PARAM_STRING;
- memcpy(params[2].field, VIR_MIGRATE_PARAM_DEST_XML,
- VIR_TYPED_PARAM_FIELD_LENGTH);
+ strncpy(params[2].field, VIR_MIGRATE_PARAM_DEST_XML,
+ VIR_TYPED_PARAM_FIELD_LENGTH);
params[2].type = VIR_TYPED_PARAM_STRING;
- memcpy(params[3].field, VIR_MIGRATE_PARAM_GRAPHICS_URI,
- VIR_TYPED_PARAM_FIELD_LENGTH);
+ strncpy(params[3].field, VIR_MIGRATE_PARAM_GRAPHICS_URI,
+ VIR_TYPED_PARAM_FIELD_LENGTH);
params[3].type = VIR_TYPED_PARAM_STRING;
- memcpy(params[4].field, VIR_MIGRATE_PARAM_BANDWIDTH,
- VIR_TYPED_PARAM_FIELD_LENGTH);
+ strncpy(params[4].field, VIR_MIGRATE_PARAM_BANDWIDTH,
+ VIR_TYPED_PARAM_FIELD_LENGTH);
params[4].type = VIR_TYPED_PARAM_ULLONG;
+ strncpy(params[5].field, VIR_MIGRATE_PARAM_LISTEN_ADDRESS,
+ VIR_TYPED_PARAM_FIELD_LENGTH);
+ params[5].type = VIR_TYPED_PARAM_STRING;
+
nparams = vir_typed_param_from_hv(newparams, params, nparams);
/* No need to support virDomainMigrateToURI/virDomainMigrateToURI2, since
@@ -4370,12 +4543,21 @@ get_vcpu_info(dom, flags=0)
maplen = VIR_CPU_MAPLEN(VIR_NODEINFO_MAXCPUS(nodeinfo));
Newx(cpumaps, dominfo.nrVirtCpu * maplen, unsigned char);
- if (flags && (flags & VIR_DOMAIN_AFFECT_CONFIG)) {
- Newx(info, dominfo.nrVirtCpu, virVcpuInfo);
+ if (!flags) {
+ Newx(info, dominfo.nrVirtCpu, virVcpuInfo);
if ((nvCpus = virDomainGetVcpus(dom, info, dominfo.nrVirtCpu, cpumaps, maplen)) < 0) {
+ virErrorPtr err = virGetLastError();
Safefree(info);
- Safefree(cpumaps);
- _croak_error();
+ info = NULL;
+ if (err && err->code == VIR_ERR_OPERATION_INVALID) {
+ if ((nvCpus = virDomainGetVcpuPinInfo(dom, dominfo.nrVirtCpu, cpumaps, maplen, flags)) < 0) {
+ Safefree(cpumaps);
+ _croak_error();
+ }
+ } else {
+ Safefree(cpumaps);
+ _croak_error();
+ }
}
} else {
info = NULL;
@@ -4393,6 +4575,10 @@ get_vcpu_info(dom, flags=0)
(void)hv_store(rec, "state", 5, newSViv(info[i].state), 0);
(void)hv_store(rec, "cpuTime", 7, virt_newSVull(info[i].cpuTime), 0);
(void)hv_store(rec, "cpu", 3, newSViv(info[i].cpu), 0);
+ } else {
+ (void)hv_store(rec, "state", 5, newSViv(0), 0);
+ (void)hv_store(rec, "cpuTime", 7, virt_newSVull(0), 0);
+ (void)hv_store(rec, "cpu", 3, newSViv(0), 0);
}
(void)hv_store(rec, "affinity", 8, newSVpvn((char*)cpumaps + (i *maplen), maplen), 0);
PUSHs(newRV_noinc((SV *)rec));
@@ -5390,8 +5576,10 @@ const char *
get_parent(dev)
virNodeDevicePtr dev;
CODE:
- if (!(RETVAL = virNodeDeviceGetParent(dev)))
- _croak_error();
+ if (!(RETVAL = virNodeDeviceGetParent(dev))) {
+ if (virGetLastError() != NULL)
+ _croak_error();
+ }
OUTPUT:
RETVAL
@@ -6439,6 +6627,7 @@ BOOT:
REGISTER_CONSTANT_STR(VIR_NODE_CPU_STATS_IOWAIT, NODE_CPU_STATS_IOWAIT);
REGISTER_CONSTANT_STR(VIR_NODE_CPU_STATS_KERNEL, NODE_CPU_STATS_KERNEL);
REGISTER_CONSTANT_STR(VIR_NODE_CPU_STATS_USER, NODE_CPU_STATS_USER);
+ REGISTER_CONSTANT_STR(VIR_NODE_CPU_STATS_INTR, NODE_CPU_STATS_INTR);
REGISTER_CONSTANT_STR(VIR_NODE_CPU_STATS_UTILIZATION, NODE_CPU_STATS_UTILIZATION);
REGISTER_CONSTANT(VIR_NODE_MEMORY_STATS_ALL_CELLS, NODE_MEMORY_STATS_ALL_CELLS);
@@ -6460,6 +6649,7 @@ BOOT:
REGISTER_CONSTANT_STR(VIR_NODE_MEMORY_SHARED_PAGES_VOLATILE, NODE_MEMORY_SHARED_PAGES_VOLATILE);
REGISTER_CONSTANT_STR(VIR_NODE_MEMORY_SHARED_FULL_SCANS, NODE_MEMORY_SHARED_FULL_SCANS);
+ REGISTER_CONSTANT(VIR_CONNECT_BASELINE_CPU_EXPAND_FEATURES, BASELINE_CPU_EXPAND_FEATURES);
stash = gv_stashpv( "Sys::Virt::Event", TRUE );
@@ -6582,12 +6772,14 @@ BOOT:
REGISTER_CONSTANT(VIR_MIGRATE_OFFLINE, MIGRATE_OFFLINE);
REGISTER_CONSTANT(VIR_MIGRATE_COMPRESSED, MIGRATE_COMPRESSED);
REGISTER_CONSTANT(VIR_MIGRATE_ABORT_ON_ERROR, MIGRATE_ABORT_ON_ERROR);
+ REGISTER_CONSTANT(VIR_MIGRATE_AUTO_CONVERGE, MIGRATE_AUTO_CONVERGE);
REGISTER_CONSTANT_STR(VIR_MIGRATE_PARAM_BANDWIDTH, MIGRATE_PARAM_BANDWIDTH);
REGISTER_CONSTANT_STR(VIR_MIGRATE_PARAM_DEST_NAME, MIGRATE_PARAM_DEST_NAME);
REGISTER_CONSTANT_STR(VIR_MIGRATE_PARAM_DEST_XML, MIGRATE_PARAM_DEST_XML);
REGISTER_CONSTANT_STR(VIR_MIGRATE_PARAM_GRAPHICS_URI, MIGRATE_PARAM_GRAPHICS_URI);
REGISTER_CONSTANT_STR(VIR_MIGRATE_PARAM_URI, MIGRATE_PARAM_URI);
+ REGISTER_CONSTANT_STR(VIR_MIGRATE_PARAM_LISTEN_ADDRESS, MIGRATE_PARAM_LISTEN_ADDRESS);
REGISTER_CONSTANT(VIR_DOMAIN_XML_SECURE, XML_SECURE);
REGISTER_CONSTANT(VIR_DOMAIN_XML_INACTIVE, XML_INACTIVE);
@@ -6766,6 +6958,7 @@ BOOT:
REGISTER_CONSTANT(VIR_DOMAIN_EVENT_GRAPHICS_ADDRESS_UNIX, EVENT_GRAPHICS_ADDRESS_UNIX);
REGISTER_CONSTANT(VIR_DOMAIN_EVENT_DISK_CHANGE_MISSING_ON_START, EVENT_DISK_CHANGE_MISSING_ON_START);
+ REGISTER_CONSTANT(VIR_DOMAIN_EVENT_DISK_DROP_MISSING_ON_START, EVENT_DISK_DROP_MISSING_ON_START);
REGISTER_CONSTANT(VIR_DOMAIN_EVENT_TRAY_CHANGE_OPEN, EVENT_TRAY_CHANGE_OPEN);
REGISTER_CONSTANT(VIR_DOMAIN_EVENT_TRAY_CHANGE_CLOSE, EVENT_TRAY_CHANGE_CLOSE);
@@ -6778,6 +6971,10 @@ BOOT:
REGISTER_CONSTANT_STR(VIR_DOMAIN_BLKIO_WEIGHT, BLKIO_WEIGHT);
REGISTER_CONSTANT_STR(VIR_DOMAIN_BLKIO_DEVICE_WEIGHT, BLKIO_DEVICE_WEIGHT);
+ REGISTER_CONSTANT_STR(VIR_DOMAIN_BLKIO_DEVICE_READ_BPS, BLKIO_DEVICE_READ_BPS);
+ REGISTER_CONSTANT_STR(VIR_DOMAIN_BLKIO_DEVICE_READ_IOPS, BLKIO_DEVICE_READ_IOPS);
+ REGISTER_CONSTANT_STR(VIR_DOMAIN_BLKIO_DEVICE_WRITE_BPS, BLKIO_DEVICE_WRITE_BPS);
+ REGISTER_CONSTANT_STR(VIR_DOMAIN_BLKIO_DEVICE_WRITE_IOPS, BLKIO_DEVICE_WRITE_IOPS);
REGISTER_CONSTANT_STR(VIR_DOMAIN_SCHEDULER_CPU_SHARES, SCHEDULER_CPU_SHARES);
REGISTER_CONSTANT_STR(VIR_DOMAIN_SCHEDULER_VCPU_PERIOD, SCHEDULER_VCPU_PERIOD);
@@ -6956,6 +7153,10 @@ BOOT:
REGISTER_CONSTANT(VIR_DOMAIN_SEND_KEY_MAX_KEYS, SEND_KEY_MAX_KEYS);
+ REGISTER_CONSTANT(VIR_DOMAIN_CORE_DUMP_FORMAT_RAW, CORE_DUMP_FORMAT_RAW);
+ REGISTER_CONSTANT(VIR_DOMAIN_CORE_DUMP_FORMAT_KDUMP_LZO, CORE_DUMP_FORMAT_KDUMP_LZO);
+ REGISTER_CONSTANT(VIR_DOMAIN_CORE_DUMP_FORMAT_KDUMP_SNAPPY, CORE_DUMP_FORMAT_KDUMP_SNAPPY);
+ REGISTER_CONSTANT(VIR_DOMAIN_CORE_DUMP_FORMAT_KDUMP_ZLIB, CORE_DUMP_FORMAT_KDUMP_ZLIB);
stash = gv_stashpv( "Sys::Virt::DomainSnapshot", TRUE );
REGISTER_CONSTANT(VIR_DOMAIN_SNAPSHOT_DELETE_CHILDREN, DELETE_CHILDREN);
@@ -7025,6 +7226,7 @@ BOOT:
REGISTER_CONSTANT(VIR_CONNECT_LIST_STORAGE_POOLS_MPATH, LIST_MPATH);
REGISTER_CONSTANT(VIR_CONNECT_LIST_STORAGE_POOLS_RBD, LIST_RBD);
REGISTER_CONSTANT(VIR_CONNECT_LIST_STORAGE_POOLS_SHEEPDOG, LIST_SHEEPDOG);
+ REGISTER_CONSTANT(VIR_CONNECT_LIST_STORAGE_POOLS_GLUSTER, LIST_GLUSTER);
stash = gv_stashpv( "Sys::Virt::Network", TRUE );
REGISTER_CONSTANT(VIR_NETWORK_XML_INACTIVE, XML_INACTIVE);
@@ -7060,6 +7262,14 @@ BOOT:
REGISTER_CONSTANT(VIR_CONNECT_LIST_NETWORKS_PERSISTENT, LIST_PERSISTENT);
REGISTER_CONSTANT(VIR_CONNECT_LIST_NETWORKS_TRANSIENT, LIST_TRANSIENT);
+ REGISTER_CONSTANT(VIR_NETWORK_EVENT_ID_LIFECYCLE, EVENT_ID_LIFECYCLE);
+
+ REGISTER_CONSTANT(VIR_NETWORK_EVENT_DEFINED, EVENT_DEFINED);
+ REGISTER_CONSTANT(VIR_NETWORK_EVENT_UNDEFINED, EVENT_UNDEFINED);
+ REGISTER_CONSTANT(VIR_NETWORK_EVENT_STARTED, EVENT_STARTED);
+ REGISTER_CONSTANT(VIR_NETWORK_EVENT_STOPPED, EVENT_STOPPED);
+
+
stash = gv_stashpv( "Sys::Virt::Interface", TRUE );
REGISTER_CONSTANT(VIR_INTERFACE_XML_INACTIVE, XML_INACTIVE);
@@ -7088,6 +7298,7 @@ BOOT:
REGISTER_CONSTANT(VIR_STORAGE_VOL_BLOCK, TYPE_BLOCK);
REGISTER_CONSTANT(VIR_STORAGE_VOL_DIR, TYPE_DIR);
REGISTER_CONSTANT(VIR_STORAGE_VOL_NETWORK, TYPE_NETWORK);
+ REGISTER_CONSTANT(VIR_STORAGE_VOL_NETDIR, TYPE_NETDIR);
REGISTER_CONSTANT(VIR_STORAGE_VOL_DELETE_NORMAL, DELETE_NORMAL);
REGISTER_CONSTANT(VIR_STORAGE_VOL_DELETE_ZEROED, DELETE_ZEROED);
@@ -7196,6 +7407,8 @@ BOOT:
REGISTER_CONSTANT(VIR_FROM_IDENTITY, FROM_IDENTITY);
REGISTER_CONSTANT(VIR_FROM_ACCESS, FROM_ACCESS);
REGISTER_CONSTANT(VIR_FROM_SYSTEMD, FROM_SYSTEMD);
+ REGISTER_CONSTANT(VIR_FROM_BHYVE, FROM_BHYVE);
+ REGISTER_CONSTANT(VIR_FROM_CRYPTO, FROM_CRYPTO);
REGISTER_CONSTANT(VIR_ERR_OK, ERR_OK);
@@ -7288,4 +7501,5 @@ BOOT:
REGISTER_CONSTANT(VIR_ERR_RESOURCE_BUSY, ERR_RESOURCE_BUSY);
REGISTER_CONSTANT(VIR_ERR_ACCESS_DENIED, ERR_ACCESS_DENIED);
REGISTER_CONSTANT(VIR_ERR_DBUS_SERVICE, ERR_DBUS_SERVICE);
+ REGISTER_CONSTANT(VIR_ERR_STORAGE_VOL_EXIST, ERR_STORAGE_VOL_EXIST);
}
@@ -0,0 +1,11 @@
+#!/usr/bin/perl
+
+use Sys::Virt;
+
+my $conn = Sys::Virt->new();
+
+my @nodelist = $conn->list_all_node_devices();
+foreach my $dev (@nodelist){
+ my $parent = $dev->get_parent();
+ printf "%s: < %s\n", $dev->get_name(), $parent;
+}
@@ -0,0 +1,16 @@
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+
+use Sys::Virt;
+
+my $addr = @ARGV ? shift @ARGV : "";
+
+my $hv = Sys::Virt->new(address => $addr, readonly => 1);
+
+my $info = $hv->get_node_info();
+
+my @models = $hv->get_cpu_model_names($info->{model});
+
+print join ("\n", sort{ lc $a cmp lc $b } @models), "\n";
@@ -9,12 +9,12 @@ my $con = Sys::Virt->new(address => $addr, readonly => 1);
print "VMM type: ", $con->get_type(), "\n";
-foreach my $dom (sort { $a->get_id <=> $b->get_id } $con->list_domains) {
+foreach my $dom (sort { $a->get_id <=> $b->get_id } $con->list_all_domains) {
print "Domain: {\n";
print " ID: ", $dom->get_id(), " '" , $dom->get_name(), "'\n";
print " UUID: ", $dom->get_uuid_string(), "\n";
my $nodeinfo = $con->get_node_info;
- my @info = $dom->get_vcpu_info;
+ my @info = $dom->get_vcpu_info(Sys::Virt::Domain::AFFECT_CONFIG);
foreach my $info (@info) {
print " VCPU: {\n";
@@ -227,6 +227,34 @@ image to C<$filename> so it can be analysed by tools such as C<crash>.
The optional C<$flags> flags parameter is currently unused and if
omitted will default to 0.
+=item $dom->core_dump_format($filename, $format, [, $flags])
+
+Trigger a core dump of the guest virtual machine, saving its memory
+image to C<$filename> so it can be analysed by tools such as C<crash>.
+The C<$format> parameter is one of the core dump format constants.
+The optional C<$flags> flags parameter is currently unused and if
+omitted will default to 0.
+
+=over 4
+
+=item Sys::Virt::Domain::CORE_DUMP_FORMAT_RAW
+
+The raw ELF format
+
+=item Sys::Virt::Domain::CORE_DUMP_FORMAT_KDUMP_ZLIB
+
+The zlib compressed ELF format
+
+=item Sys::Virt::Domain::CORE_DUMP_FORMAT_KDUMP_SNAPPY
+
+The snappy compressed ELF format
+
+=item Sys::Virt::Domain::CORE_DUMP_FORMAT_KDUMP_LZO
+
+The lzo compressed ELF format
+
+=back
+
=item $dom->destroy()
Immediately poweroff the machine. This is equivalent to removing the
@@ -898,6 +926,14 @@ set to 0 or omitted, libvirt will choose a suitable default. Some
hypervisors do not support this feature and will return an error if
this field is used and is not 0.
+=item C<Sys::Virt::Domain::MIGRATE_PARAM_LISTEN_ADDRESS>
+
+The address on which to listen for incoming migration connections.
+If omitted, libvirt will listen on the wildcard address (0.0.0.0
+or ::). This default may be a security risk if guests, or other
+untrusted users have the ability to connect to the virtualization
+host, thus use of an explicit restricted listen address is recommended.
+
=back
=item $ddom = $dom->migrate(destcon, flags=0, dname=undef, uri=undef, bandwidth=0)
@@ -1113,7 +1149,7 @@ or multi-card configuration. C<$st> must be a C<Sys::Virt::Stream>
object from which the data can be read. C<$flags> is currently unused
and defaults to 0. The mimetype of the screenshot is returned
-=item @vcpuinfo = $dom->get_vcpu_info()
+=item @vcpuinfo = $dom->get_vcpu_info($flags=0)
Obtain information about the state of all virtual CPUs in a running
guest domain. The returned list will have one element for each vCPU,
@@ -1124,7 +1160,9 @@ time of the vCPU, C<state> the running state and C<affinity> giving
the allowed shedular placement. The value for C<affinity> is a
string representing a bitmask against physical CPUs, 8 cpus per
character. To extract the bits use the C<unpack> function with
-the C<b*> template.
+the C<b*> template. NB The C<state>, C<cpuTime>, C<cpu> values are
+only available if using C<$flags> value of 0, and the domain is
+currently running; otherwise they will all be set to zero.
=item $dom->pin_vcpu($vcpu, $mask)
@@ -1865,6 +1903,11 @@ Enable compression of the migration data stream
Abort if an I/O error occurrs on the disk
+=item Sys::Virt::Domain::MIGRATE_AUTO_CONVERGE
+
+Force convergance of the migration operation by
+throttling guest runtime
+
=back
=head2 UNDEFINE CONSTANTS
@@ -1965,6 +2008,22 @@ The I/O weight parameter
The per-device I/O weight parameter
+=item Sys::Virt::Domain::BLKIO_DEVICE_READ_BPS
+
+The per-device I/O bytes read per second
+
+=item Sys::Virt::Domain::BLKIO_DEVICE_READ_IOPS
+
+The per-device I/O operations read per second
+
+=item Sys::Virt::Domain::BLKIO_DEVICE_WRITE_BPS
+
+The per-device I/O bytes write per second
+
+=item Sys::Virt::Domain::BLKIO_DEVICE_WRITE_IOPS
+
+The per-device I/O operations write per second
+
=back
=head2 BLKIO TUNING PARAMETERS
@@ -2513,7 +2572,11 @@ These constants describe the reason for a disk change event
=item Sys::Virt::Domain::EVENT_DISK_CHANGE_MISSING_ON_START
-The disk media was missing when attempting to start the guest
+The disk media was cleared, as its source was missing when attempting to start the guest
+
+=item Sys::Virt::Domain::EVENT_DISK_DROP_MISSING_ON_START
+
+The disk device was dropped, as its source was missing whe attempting to start the guest
=back
@@ -362,6 +362,14 @@ The access control code
The systemd init service
+=item Sys::Virt::Error::FROM_BHYVE
+
+The FreeBSD BHyve driver
+
+=item Sys::Virt::Error::FROM_CRYPTO
+
+The cryptographic helper APIs.
+
=back
=head2 ERROR CODE CONSTANTS
@@ -732,6 +740,10 @@ Not authorized to perform the operation
An error from a DBus service API
+=item Sys::Virt::Error::ERR_STORAGE_VOL_EXIST
+
+The storage volume already exists
+
=back
=head1 AUTHORS
@@ -299,6 +299,44 @@ Insert the matching entry at the end
=back
+=head2 EVENT ID CONSTANTS
+
+=over 4
+
+=item Sys::Virt::Network::EVENT_ID_LIFECYCLE
+
+Network lifecycle events
+
+=back
+
+=head2 LIFECYCLE CHANGE EVENTS
+
+The following constants allow network lifecycle change events to be
+interpreted. The events contain both a state change, and a
+reason though the reason is currently unsed.
+
+=over 4
+
+=item Sys::Virt::Network::EVENT_DEFINED
+
+Indicates that a persistent configuration has been defined for
+the network.
+
+=item Sys::Virt::Network::EVENT_STARTED
+
+The network has started running
+
+=item Sys::Virt::Network::EVENT_STOPPED
+
+The network has stopped running
+
+=item Sys::Virt::Network::EVENT_UNDEFINED
+
+The persistent configuration has gone away
+
+=back
+
+
=cut
@@ -51,10 +51,11 @@ sub _new {
my $self;
if (exists $params{name}) {
$self = Sys::Virt::NodeDevice::_lookup_by_name($con, $params{name});
- } elsif (exists $params{wwpn}) {
+ } elsif (exists $params{wwnn}) {
$self = Sys::Virt::NodeDevice::_lookup_scsihost_by_wwn($con,
+ $params{wwnn},
$params{wwpn},
- $params{wwnn});
+ $params{flags});
} elsif (exists $params{xml}) {
$self = Sys::Virt::NodeDevice::_create_xml($con, $params{xml});
} else {
@@ -439,6 +439,9 @@ Include SCSI storage pools
Include sheepdog storage pools
+=item Sys::Virt::StoragePool::LIST_GLUSTER
+
+Include gluster storage pools
=back
@@ -171,6 +171,10 @@ The volume is a directory
The volume is a network source
+=item Sys::Virt::StorageVol::TYPE_NETDIR
+
+The volume is a network directory
+
=back
=head2 CREATE MODES
@@ -78,7 +78,7 @@ use Sys::Virt::NWFilter;
use Sys::Virt::DomainSnapshot;
use Sys::Virt::Stream;
-our $VERSION = '1.1.1';
+our $VERSION = '1.2.3';
require XSLoader;
XSLoader::load('Sys::Virt', $VERSION);
@@ -790,7 +790,7 @@ sub list_secrets {
my $self = shift;
my $nuuids = $self->num_of_secrets();
- my @uuids = $self->list_secrets($nuuids);
+ my @uuids = $self->list_secret_uuids($nuuids);
my @secrets;
foreach my $uuid (@uuids) {
@@ -1531,6 +1531,38 @@ unregistering the event.
Unregister a callback, associated with the C<$callbackID> previously
obtained from C<domain_event_register_any>.
+=item $callback = $conn->network_event_register_any($dom, $eventID, $callback)
+
+Register a callback to received notifications of network events.
+The C<$dom> parameter can be C<undef> to request events on all
+known networks, or a specific C<Sys::Virt::Network> object to
+filter events. The C<$eventID> parameter is one of the EVENT ID
+constants described later in this document. The C<$callback> is
+a subroutine reference that will receive the events.
+
+All callbacks receive a C<Sys::Virt> connection as the first parameter
+and a C<Sys::Virt::Network> object indiciating the network on which the
+event occurred as the second parameter. Subsequent parameters vary
+according to the event type
+
+=over
+
+=item EVENT_ID_LIFECYCLE
+
+Extra C<event> and C<detail> parameters defining the lifecycle
+transition that occurred.
+
+=back
+
+The return value is a unique callback ID that must be used when
+unregistering the event.
+
+
+=item $conn->network_event_deregister_any($callbackID)
+
+Unregister a callback, associated with the C<$callbackID> previously
+obtained from C<network_event_register_any>.
+
=item $conn->register_close_callback($coderef);
Register a callback to be invoked when the connection is closed.
@@ -1548,7 +1580,24 @@ Remove the previously registered close callback.
Given an array ref whose elements are XML documents describing host CPUs,
compute the baseline CPU model that is operable across all hosts. The
XML for the baseline CPU model is returned. The optional C<$flags>
-parameter is currently unused and defaults to 0.
+parameter can take one of
+
+=over 4
+
+=item Sys::Virt::BASELINE_CPU_EXPAND_FEATURES
+
+Expand the CPU definition to list all feature flags, even those
+implied by the model name.
+
+=back
+
+=item @names = $con->get_cpu_model_names($arch, $flags=0)
+
+Get a list of valid CPU models names for the architecture
+given by C<$arch>. The C<$arch> value should be one of the
+architectures listed in the capabilities XML document.
+The C<$flags> parameter is currently unused and defaults
+to 0.
=item my $info = $con->get_node_security_model()
@@ -1787,6 +1836,10 @@ Time spent executing kernel code
Time spent executing user code
+=item Sys::Virt::NODE_CPU_STATS_INTR
+
+Time spent processing interrupts
+
=item Sys::Virt::NODE_CPU_STATS_UTILIZATION
Percentage utilization of the CPU.
@@ -1,7 +1,7 @@
# Automatically generated by perl-Sys-Virt.spec.PL
Name: perl-Sys-Virt
-Version: 1.1.1
+Version: 1.2.3
Release: 1%{?dist}%{?extra_release}
Summary: Represent and manage a libvirt hypervisor connection
License: GPLv2+ or Artistic
@@ -89,6 +89,8 @@ virConnectDomainEventTrayChangeCallback
virConnectDomainEventBalloonChangeCallback
virConnectDomainEventDeviceRemovedCallback
+virConnectNetworkEventLifecycleCallback
+
virEventAddHandleFunc
virEventAddTimeoutFunc
virEventRemoveHandleFunc
@@ -161,6 +163,7 @@ VIR_CPU_USED
VIR_DOMAIN_BLKIO_FIELD_LENGTH
VIR_DOMAIN_BLOCK_STATS_FIELD_LENGTH
VIR_DOMAIN_EVENT_CALLBACK
+VIR_NETWORK_EVENT_CALLBACK
VIR_DOMAIN_MEMORY_FIELD_LENGTH
VIR_DOMAIN_MEMORY_PARAM_UNLIMITED
VIR_DOMAIN_SCHED_FIELD_LENGTH
@@ -179,6 +182,7 @@ VIR_UUID_STRING_BUFLEN
_virBlkioParameter
_virMemoryParameter
_virSchedParameter
+LIBVIR_CHECK_VERSION
);
foreach my $macro (sort { $a cmp $b } @macros) {
@@ -3,7 +3,7 @@
use strict;
use warnings;
-use Test::More tests => 24;
+use Test::More tests => 25;
use XML::XPath;
use XML::XPath::XMLParser;
use Sys::Hostname;
@@ -77,3 +77,7 @@ SKIP: {
ok($conn->is_secure(), "connection is secure");
ok(!$conn->is_encrypted(), "connection is not encrypted");
+
+my @models = $conn->get_cpu_model_names($info->{model});
+
+ok($#models > -1, "got some cpu models");