[libvirt] [RFC PATCH 0/2] Add vmgenid XML, schema, docs
by John Ferlan
Could be a v1, but figured I'd get feedback first - I have a "working
example" for QEMU (supported since 2.9.0), but it's not quite ready
to be fully posted. Currently only needed for windows guests, but
there is some work upstream (somewhere) to make a Linux implementation.
Still have to work out all the various "combinations" of when to
add the vmgenid device and I think there's one combination that's
not quite possible and may require some sort of set vmgenid guid
value qmp command (that's being debated on qemu upstream now).
To read up on the QEMU implementation, see from the top of a
QEMU source tree:
docs/specs/vmgenid.txt
The (ahem) Microsoft details on the device is found at:
http://go.microsoft.com/fwlink/?LinkId=260709
John Ferlan (2):
conf: Introduce VIR_DOMAIN_DEVICE_VMGENID
conf: Add VM Generation ID device
docs/formatdomain.html.in | 54 ++++++++++++++
docs/schemas/domaincommon.rng | 21 ++++++
src/conf/domain_conf.c | 120 +++++++++++++++++++++++++++++-
src/conf/domain_conf.h | 12 +++
src/qemu/qemu_domain.c | 1 +
src/qemu/qemu_domain_address.c | 1 +
src/qemu/qemu_driver.c | 6 ++
src/qemu/qemu_hotplug.c | 1 +
tests/qemuxml2argvdata/vmgenid-auto.xml | 32 ++++++++
tests/qemuxml2argvdata/vmgenid.xml | 32 ++++++++
tests/qemuxml2xmloutdata/vmgenid-auto.xml | 1 +
tests/qemuxml2xmloutdata/vmgenid.xml | 1 +
tests/qemuxml2xmltest.c | 3 +
13 files changed, 284 insertions(+), 1 deletion(-)
create mode 100644 tests/qemuxml2argvdata/vmgenid-auto.xml
create mode 100644 tests/qemuxml2argvdata/vmgenid.xml
create mode 120000 tests/qemuxml2xmloutdata/vmgenid-auto.xml
create mode 120000 tests/qemuxml2xmloutdata/vmgenid.xml
--
2.13.6
6 years, 9 months
[libvirt] [snmp PATCH 1/2] Replace U64 with struct counter64 to fix build
by Michael Corcoran
Upstream net-snmp removed the U64 typedef in 2016 as it clashed with a
name in Perl, thus all usages of U64 must be replaced by struct counter64 to
compile against recent versions of net-snmp.
The replacements were made by hand, while referencing diff with new
source generated by the mib2c tool. net-snmp have a mib2c-update tool
which supposedly assists with updating existing (modified) source code
but I was unable to get it to work.
Signed-off-by: Michael Corcoran <tracer(a)outlook.co.nz>
---
src/defaults/node-libvirtGuestCpuTime.m2d | 2 +-
src/libvirtGuestTable-README-libvirtGuestTable.txt | 2 +-
src/libvirtGuestTable.h | 4 ++--
src/libvirtGuestTable_data_get.c | 4 ++--
src/libvirtGuestTable_data_get.h | 2 +-
src/libvirtGuestTable_data_set.h | 4 ++--
src/libvirtGuestTable_interface.c | 8 ++++----
7 files changed, 13 insertions(+), 13 deletions(-)
diff --git a/src/defaults/node-libvirtGuestCpuTime.m2d b/src/defaults/node-libvirtGuestCpuTime.m2d
index 795f697..fc93506 100644
--- a/src/defaults/node-libvirtGuestCpuTime.m2d
+++ b/src/defaults/node-libvirtGuestCpuTime.m2d
@@ -11,7 +11,7 @@
## If you do, it is likely to break lots of generated code that
## you will have to fix.
##
-## @eval $m2c_decl = U64@
+## @eval $m2c_decl = "struct counter64"@
##
########################################################################
## Generate/use mapping functions? Useful if the MIB defines
diff --git a/src/libvirtGuestTable-README-libvirtGuestTable.txt b/src/libvirtGuestTable-README-libvirtGuestTable.txt
index 5a74dae..74e2274 100644
--- a/src/libvirtGuestTable-README-libvirtGuestTable.txt
+++ b/src/libvirtGuestTable-README-libvirtGuestTable.txt
@@ -722,7 +722,7 @@ The CPU time used by the virtual guest, in nanoseconds.
*
*
* Its syntax is COUNTER64 (based on perltype COUNTER64)
- * The net-snmp type is ASN_COUNTER64. The C type decl is U64 (U64)
+ * The net-snmp type is ASN_COUNTER64. The C type decl is U64 (struct counter64)
*/
/*---------------------------------------------------------------------
* LIBVIRT-MIB::libvirtGuestEntry.libvirtGuestRowStatus
diff --git a/src/libvirtGuestTable.h b/src/libvirtGuestTable.h
index ca27abd..6762238 100644
--- a/src/libvirtGuestTable.h
+++ b/src/libvirtGuestTable.h
@@ -119,9 +119,9 @@ typedef struct libvirtGuestTable_data_s {
u_long libvirtGuestMemoryLimit;
/*
- * libvirtGuestCpuTime(7)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h
+ * libvirtGuestCpuTime(7)/COUNTER64/ASN_COUNTER64/U64(struct counter64)//l/A/w/e/r/d/h
*/
- U64 libvirtGuestCpuTime;
+ struct counter64 libvirtGuestCpuTime;
/*
* libvirtGuestRowStatus(9)/RowStatus/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
diff --git a/src/libvirtGuestTable_data_get.c b/src/libvirtGuestTable_data_get.c
index b252bdd..08ddb4a 100644
--- a/src/libvirtGuestTable_data_get.c
+++ b/src/libvirtGuestTable_data_get.c
@@ -442,7 +442,7 @@ The CPU time used by the virtual guest, in nanoseconds.
*
*
* Its syntax is COUNTER64 (based on perltype COUNTER64)
- * The net-snmp type is ASN_COUNTER64. The C type decl is U64 (U64)
+ * The net-snmp type is ASN_COUNTER64. The C type decl is U64 (struct counter64)
*/
/**
* Extract the current value of the libvirtGuestCpuTime data.
@@ -459,7 +459,7 @@ The CPU time used by the virtual guest, in nanoseconds.
* @retval MFD_ERROR : Any other error
*/
int
-libvirtGuestCpuTime_get( libvirtGuestTable_rowreq_ctx *rowreq_ctx, U64 * libvirtGuestCpuTime_val_ptr )
+libvirtGuestCpuTime_get( libvirtGuestTable_rowreq_ctx *rowreq_ctx, struct counter64 * libvirtGuestCpuTime_val_ptr )
{
/** we should have a non-NULL pointer */
netsnmp_assert( NULL != libvirtGuestCpuTime_val_ptr );
diff --git a/src/libvirtGuestTable_data_get.h b/src/libvirtGuestTable_data_get.h
index 450d112..6a0e7ff 100644
--- a/src/libvirtGuestTable_data_get.h
+++ b/src/libvirtGuestTable_data_get.h
@@ -55,7 +55,7 @@ extern "C" {
int libvirtGuestCpuCount_get( libvirtGuestTable_rowreq_ctx *rowreq_ctx, u_long * libvirtGuestCpuCount_val_ptr );
int libvirtGuestMemoryCurrent_get( libvirtGuestTable_rowreq_ctx *rowreq_ctx, u_long * libvirtGuestMemoryCurrent_val_ptr );
int libvirtGuestMemoryLimit_get( libvirtGuestTable_rowreq_ctx *rowreq_ctx, u_long * libvirtGuestMemoryLimit_val_ptr );
- int libvirtGuestCpuTime_get( libvirtGuestTable_rowreq_ctx *rowreq_ctx, U64 * libvirtGuestCpuTime_val_ptr );
+ int libvirtGuestCpuTime_get( libvirtGuestTable_rowreq_ctx *rowreq_ctx, struct counter64 * libvirtGuestCpuTime_val_ptr );
int libvirtGuestRowStatus_get( libvirtGuestTable_rowreq_ctx *rowreq_ctx, u_long * libvirtGuestRowStatus_val_ptr );
diff --git a/src/libvirtGuestTable_data_set.h b/src/libvirtGuestTable_data_set.h
index cce0fe7..873f9f5 100644
--- a/src/libvirtGuestTable_data_set.h
+++ b/src/libvirtGuestTable_data_set.h
@@ -80,9 +80,9 @@ int libvirtGuestMemoryLimit_undo_setup( libvirtGuestTable_rowreq_ctx *rowreq_ctx
int libvirtGuestMemoryLimit_set( libvirtGuestTable_rowreq_ctx *rowreq_ctx, u_long libvirtGuestMemoryLimit_val );
int libvirtGuestMemoryLimit_undo( libvirtGuestTable_rowreq_ctx *rowreq_ctx );
-int libvirtGuestCpuTime_check_value( libvirtGuestTable_rowreq_ctx *rowreq_ctx, U64 libvirtGuestCpuTime_val);
+int libvirtGuestCpuTime_check_value( libvirtGuestTable_rowreq_ctx *rowreq_ctx, struct counter64 libvirtGuestCpuTime_val);
int libvirtGuestCpuTime_undo_setup( libvirtGuestTable_rowreq_ctx *rowreq_ctx );
-int libvirtGuestCpuTime_set( libvirtGuestTable_rowreq_ctx *rowreq_ctx, U64 libvirtGuestCpuTime_val );
+int libvirtGuestCpuTime_set( libvirtGuestTable_rowreq_ctx *rowreq_ctx, struct counter64 libvirtGuestCpuTime_val );
int libvirtGuestCpuTime_undo( libvirtGuestTable_rowreq_ctx *rowreq_ctx );
int libvirtGuestRowStatus_check_value( libvirtGuestTable_rowreq_ctx *rowreq_ctx, u_long libvirtGuestRowStatus_val);
diff --git a/src/libvirtGuestTable_interface.c b/src/libvirtGuestTable_interface.c
index ce29c3b..ee48291 100644
--- a/src/libvirtGuestTable_interface.c
+++ b/src/libvirtGuestTable_interface.c
@@ -842,11 +842,11 @@ rc = libvirtGuestMemoryCurrent_get(rowreq_ctx, (u_long *)var->val.string );
rc = libvirtGuestMemoryLimit_get(rowreq_ctx, (u_long *)var->val.string );
break;
- /* libvirtGuestCpuTime(7)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h */
+ /* libvirtGuestCpuTime(7)/COUNTER64/ASN_COUNTER64/U64(struct counter64)//l/A/w/e/r/d/h */
case COLUMN_LIBVIRTGUESTCPUTIME:
- var->val_len = sizeof(U64);
+ var->val_len = sizeof(struct counter64);
var->type = ASN_COUNTER64;
-rc = libvirtGuestCpuTime_get(rowreq_ctx, (U64 *)var->val.string );
+rc = libvirtGuestCpuTime_get(rowreq_ctx, (struct counter64 *)var->val.string );
break;
/* libvirtGuestRowStatus(9)/RowStatus/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */
@@ -1022,7 +1022,7 @@ _libvirtGuestTable_check_column( libvirtGuestTable_rowreq_ctx *rowreq_ctx,
rc = SNMP_ERR_NOTWRITABLE;
break;
- /* libvirtGuestCpuTime(7)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h */
+ /* libvirtGuestCpuTime(7)/COUNTER64/ASN_COUNTER64/U64(struct counter64)//l/A/w/e/r/d/h */
case COLUMN_LIBVIRTGUESTCPUTIME:
rc = SNMP_ERR_NOTWRITABLE;
break;
6 years, 9 months
[libvirt] snapshot: support rbd disk
by Zhangzijian
Hello,
Qemu support create snapshot for rbd disk. But Libvirt have not yet supported this feature now, is there any roadmap?
Thanks.
6 years, 9 months
[libvirt] [PATCH] news: Xen: announce removal of hard-code scheduler weight
by Jim Fehlig
Also describe a possible side-affect due to changes in the default
(unspecified) value from 1000 to 256.
Signed-off-by: Jim Fehlig <jfehlig(a)suse.com>
---
docs/news.xml | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/docs/news.xml b/docs/news.xml
index 75a054308..93ab59cf4 100644
--- a/docs/news.xml
+++ b/docs/news.xml
@@ -66,6 +66,22 @@
If someone customizing IP address inside VM, it will be helpful.
</description>
</change>
+ <change>
+ <summary>
+ Xen: Remove hard-coded scheduler weight
+ </summary>
+ <description>
+ The libxl driver was accidentally hard-coding the per-domain
+ scheduler weight to 1000, silently ignoring any user-provided
+ <code><shares></code> in <code><cputune></code>. The
+ driver now honors <code><shares></code>, and defers setting
+ a default value to Xen. Note that the Xen default is 256, so any
+ domains started after this improvement will have one fourth the
+ shares of previously started domains. If all domains must have
+ equal CPU shares, administrators must manually set the weight of
+ previously started domains to 256, or restart them.
+ </description>
+ </change>
</section>
<section title="Bug fixes">
</section>
--
2.16.2
6 years, 9 months
[libvirt] [PATCH] libxl: don't hardcode scheduler weight
by Jim Fehlig
Long ago in commit dfa1e1dd53 the scheduler weight was accidentally
hardcoded to 1000. Weight is a setting with no unit since it is
relative to the weight of other domains. If no weight is specified,
libxl defaults to 256.
Instead of hardcoding the weight to 1000, honor any <shares> specified
in <cputune>. libvirt's notion of shares is synonomous to libxl's
scheduler weight setting. If shares is unspecified, defer default
weight setting to libxl.
Removing the hardcoded weight required some test fixup. While at it,
add an explicit test for <shares> conversion to scheduler weight.
Signed-off-by: Jim Fehlig <jfehlig(a)suse.com>
---
Honoring <shares> specified by the user is certainly desirable,
but I'm not sure about changing the default weight. One problematic
scenario that came to mind: Several domains started by pre-patch
libvirtd with weight=1000, update libvirtd with patch, start more
domains with weight=256. The pre-patch domains unknowingly have
a weight nearly 4 times that of post-patch domains.
src/libxl/libxl_conf.c | 4 +-
tests/libxlxml2domconfigdata/basic-hvm.json | 2 +-
tests/libxlxml2domconfigdata/basic-pv.json | 2 +-
tests/libxlxml2domconfigdata/cpu-shares-hvm.json | 89 ++++++++++++++++++++++
tests/libxlxml2domconfigdata/cpu-shares-hvm.xml | 39 ++++++++++
tests/libxlxml2domconfigdata/moredevs-hvm.json | 2 +-
tests/libxlxml2domconfigdata/multiple-ip.json | 2 +-
.../libxlxml2domconfigdata/variable-clock-hvm.json | 2 +-
tests/libxlxml2domconfigdata/vnuma-hvm.json | 2 +-
tests/libxlxml2domconfigtest.c | 1 +
10 files changed, 138 insertions(+), 7 deletions(-)
diff --git a/src/libxl/libxl_conf.c b/src/libxl/libxl_conf.c
index dcd46873c..e40145cfa 100644
--- a/src/libxl/libxl_conf.c
+++ b/src/libxl/libxl_conf.c
@@ -366,7 +366,9 @@ libxlMakeDomBuildInfo(virDomainDefPtr def,
}
}
- b_info->sched_params.weight = 1000;
+ if (def->cputune.sharesSpecified)
+ b_info->sched_params.weight = def->cputune.shares;
+
b_info->max_memkb = virDomainDefGetMemoryInitial(def);
b_info->target_memkb = def->mem.cur_balloon;
if (hvm) {
diff --git a/tests/libxlxml2domconfigdata/basic-hvm.json b/tests/libxlxml2domconfigdata/basic-hvm.json
index 6fa41f34f..ccd585385 100644
--- a/tests/libxlxml2domconfigdata/basic-hvm.json
+++ b/tests/libxlxml2domconfigdata/basic-hvm.json
@@ -19,7 +19,7 @@
"device_model_version": "qemu_xen",
"device_model": "/bin/true",
"sched_params": {
- "weight": 1000
+
},
"type.hvm": {
"pae": "True",
diff --git a/tests/libxlxml2domconfigdata/basic-pv.json b/tests/libxlxml2domconfigdata/basic-pv.json
index 7e1abd3d6..0f846daab 100644
--- a/tests/libxlxml2domconfigdata/basic-pv.json
+++ b/tests/libxlxml2domconfigdata/basic-pv.json
@@ -15,7 +15,7 @@
"max_memkb": 524288,
"target_memkb": 524288,
"sched_params": {
- "weight": 1000
+
},
"type.pv": {
"bootloader": "pygrub"
diff --git a/tests/libxlxml2domconfigdata/cpu-shares-hvm.json b/tests/libxlxml2domconfigdata/cpu-shares-hvm.json
new file mode 100644
index 000000000..2e647eada
--- /dev/null
+++ b/tests/libxlxml2domconfigdata/cpu-shares-hvm.json
@@ -0,0 +1,89 @@
+{
+ "c_info": {
+ "type": "hvm",
+ "name": "test-hvm",
+ "uuid": "2147d599-9cc6-c0dc-92ab-4064b5446e9b"
+ },
+ "b_info": {
+ "max_vcpus": 4,
+ "avail_vcpus": [
+ 0,
+ 1,
+ 2,
+ 3
+ ],
+ "max_memkb": 1048576,
+ "target_memkb": 1048576,
+ "video_memkb": 8192,
+ "shadow_memkb": 12288,
+ "device_model_version": "qemu_xen",
+ "device_model": "/bin/true",
+ "sched_params": {
+ "weight": 1500
+ },
+ "type.hvm": {
+ "pae": "True",
+ "apic": "True",
+ "acpi": "True",
+ "vga": {
+ "kind": "cirrus"
+ },
+ "vnc": {
+ "enable": "True",
+ "listen": "0.0.0.0",
+ "findunused": "False"
+ },
+ "sdl": {
+ "enable": "False"
+ },
+ "spice": {
+
+ },
+ "boot": "c",
+ "rdm": {
+
+ }
+ },
+ "arch_arm": {
+
+ }
+ },
+ "disks": [
+ {
+ "pdev_path": "/var/lib/xen/images/test-hvm.img",
+ "vdev": "hda",
+ "backend": "qdisk",
+ "format": "raw",
+ "removable": 1,
+ "readwrite": 1
+ }
+ ],
+ "nics": [
+ {
+ "devid": 0,
+ "mac": "00:16:3e:66:12:b4",
+ "bridge": "br0",
+ "script": "/etc/xen/scripts/vif-bridge",
+ "nictype": "vif_ioemu"
+ }
+ ],
+ "vfbs": [
+ {
+ "devid": -1,
+ "vnc": {
+ "enable": "True",
+ "listen": "0.0.0.0",
+ "findunused": "False"
+ },
+ "sdl": {
+ "enable": "False"
+ }
+ }
+ ],
+ "vkbs": [
+ {
+ "devid": -1
+ }
+ ],
+ "on_reboot": "restart"
+}
diff --git a/tests/libxlxml2domconfigdata/cpu-shares-hvm.xml b/tests/libxlxml2domconfigdata/cpu-shares-hvm.xml
new file mode 100644
index 000000000..49085b4b7
--- /dev/null
+++ b/tests/libxlxml2domconfigdata/cpu-shares-hvm.xml
@@ -0,0 +1,39 @@
+<domain type='xen'>
+ <name>test-hvm</name>
+ <description>None</description>
+ <uuid>2147d599-9cc6-c0dc-92ab-4064b5446e9b</uuid>
+ <memory>1048576</memory>
+ <currentMemory>1048576</currentMemory>
+ <vcpu>4</vcpu>
+ <cputune>
+ <shares>1500</shares>
+ </cputune>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>destroy</on_crash>
+ <clock offset='utc'/>
+ <os>
+ <type>hvm</type>
+ <loader>/usr/lib/xen/boot/hvmloader</loader>
+ <boot dev='hd'/>
+ </os>
+ <features>
+ <apic/>
+ <acpi/>
+ <pae/>
+ </features>
+ <devices>
+ <emulator>/bin/true</emulator>
+ <disk type='file' device='disk'>
+ <driver name='qemu'/>
+ <source file='/var/lib/xen/images/test-hvm.img'/>
+ <target dev='hda'/>
+ </disk>
+ <interface type='bridge'>
+ <source bridge='br0'/>
+ <mac address='00:16:3e:66:12:b4'/>
+ <script path='/etc/xen/scripts/vif-bridge'/>
+ </interface>
+ <graphics type='vnc' port='-1' autoport='yes' listen='0.0.0.0'/>
+ </devices>
+</domain>
diff --git a/tests/libxlxml2domconfigdata/moredevs-hvm.json b/tests/libxlxml2domconfigdata/moredevs-hvm.json
index 8f861f34e..7bfd68bd6 100644
--- a/tests/libxlxml2domconfigdata/moredevs-hvm.json
+++ b/tests/libxlxml2domconfigdata/moredevs-hvm.json
@@ -21,7 +21,7 @@
"device_model_version": "qemu_xen",
"device_model": "/bin/true",
"sched_params": {
- "weight": 1000
+
},
"type.hvm": {
"pae": "True",
diff --git a/tests/libxlxml2domconfigdata/multiple-ip.json b/tests/libxlxml2domconfigdata/multiple-ip.json
index 4aff61d4b..80dca8261 100644
--- a/tests/libxlxml2domconfigdata/multiple-ip.json
+++ b/tests/libxlxml2domconfigdata/multiple-ip.json
@@ -15,7 +15,7 @@
"max_memkb": 524288,
"target_memkb": 524288,
"sched_params": {
- "weight": 1000
+
},
"type.pv": {
"bootloader": "pygrub"
diff --git a/tests/libxlxml2domconfigdata/variable-clock-hvm.json b/tests/libxlxml2domconfigdata/variable-clock-hvm.json
index 49d0a4330..69be9c64c 100644
--- a/tests/libxlxml2domconfigdata/variable-clock-hvm.json
+++ b/tests/libxlxml2domconfigdata/variable-clock-hvm.json
@@ -21,7 +21,7 @@
"device_model_version": "qemu_xen",
"device_model": "/bin/true",
"sched_params": {
- "weight": 1000
+
},
"type.hvm": {
"pae": "True",
diff --git a/tests/libxlxml2domconfigdata/vnuma-hvm.json b/tests/libxlxml2domconfigdata/vnuma-hvm.json
index 3a5071e14..3b2fc5f40 100644
--- a/tests/libxlxml2domconfigdata/vnuma-hvm.json
+++ b/tests/libxlxml2domconfigdata/vnuma-hvm.json
@@ -107,7 +107,7 @@
"device_model_version": "qemu_xen",
"device_model": "/bin/true",
"sched_params": {
- "weight": 1000
+
},
"type.hvm": {
"pae": "True",
diff --git a/tests/libxlxml2domconfigtest.c b/tests/libxlxml2domconfigtest.c
index ea3d2884e..6eec4c752 100644
--- a/tests/libxlxml2domconfigtest.c
+++ b/tests/libxlxml2domconfigtest.c
@@ -192,6 +192,7 @@ mymain(void)
DO_TEST("basic-pv");
DO_TEST("basic-hvm");
+ DO_TEST("cpu-shares-hvm");
DO_TEST("variable-clock-hvm");
DO_TEST("moredevs-hvm");
DO_TEST("vnuma-hvm");
--
2.16.1
6 years, 9 months
[libvirt] [PATCH v3 0/5] Apparmor support for less common devices
by Christian Ehrhardt
So far users added manual rules for most of these uncommon devices,
but recent changes made some of the callbacks mandatory for hotplug
so we should take shot at implementing them as those callbacks as well
as for the initial start of a guest via virt-aa-helper.
*Updates since v1*
- Set(Memory|Input)Label: remove seclabel check already done in reload_profile
- virt-aa-helper: check pointers before accessing them
- add tests for new virt-aa-helper supported xml elements
- extend tests to check for expected content (new patch in series)
*Updates since v2*
- Restore(Memory|Input)Label: drop secdef/relabel check
- Set(Memory|Input)Label: check more pointers to be valid before using them
Christian Ehrhardt (5):
security, apparmor: add (Set|Restore)MemoryLabel
security, apparmor: add (Set|Restore)InputLabel
virt-aa-helper: generate rules for passthrough input devices
virt-aa-helper: generate rules for nvdimm memory
virt-aa-helper: test: check for expected profile content
src/security/security_apparmor.c | 94 ++++++++++++++++++++++++++++++++++++++++
src/security/virt-aa-helper.c | 16 +++++++
tests/virt-aa-helper-test | 88 ++++++++++++++++++++++---------------
3 files changed, 164 insertions(+), 34 deletions(-)
--
2.7.4
6 years, 9 months
[libvirt] [PATCH] travis: skip builds on -maint branches
by Daniel P. Berrangé
For patches pushed upstream we want builds run on master branch, but
don't want them run on the -maint branches, as we are not keeping the
.travis.yml file on stable branches updated wrt latest needs of travis
CI platforms.
We can't just whitelist 'master' though, because that will prevent
developers triggering their own private travis builds. So we just
blacklist *-maint, since developers will typically use named feature
branches for any work.
Signed-off-by: Daniel P. Berrangé <berrange(a)redhat.com>
---
.travis.yml | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/.travis.yml b/.travis.yml
index 01dffaa602..d3f72d46f3 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -2,6 +2,10 @@ sudo: false
language: c
cache: ccache
+branches:
+ except:
+ - /^.*-maint$/
+
matrix:
include:
- compiler: gcc
--
2.14.3
6 years, 9 months
[libvirt] [snmp PATCH 2/2] Replace placeholder org OID with libvirt OID
by Michael Corcoran
An OID of 36957 was assigned to libvirt by IANA, but the placeholder OID
of 12345 was never replaced.
IANA lists the libvirt registration as:
36957
libvirt
Daniel Veillard
daniel&veillard.com
https://www.iana.org/assignments/enterprise-numbers/enterprise-numbers
Signed-off-by: Michael Corcoran <tracer(a)outlook.co.nz>
---
src/LIBVIRT-MIB.txt | 7 ++++---
src/libvirtGuestTable-README-libvirtGuestTable.txt | 18 +++++++++---------
src/libvirtGuestTable.h | 2 +-
src/libvirtGuestTable_data_access.c | 4 ++--
src/libvirtGuestTable_data_access.h | 2 +-
src/libvirtGuestTable_data_get.c | 16 ++++++++--------
src/libvirtGuestTable_data_get.h | 2 +-
src/libvirtGuestTable_data_set.c | 6 +++---
src/libvirtGuestTable_data_set.h | 2 +-
src/libvirtGuestTable_interface.c | 2 +-
src/libvirtGuestTable_oids.h | 2 +-
src/libvirtNotifications.c | 10 +++++-----
12 files changed, 37 insertions(+), 36 deletions(-)
diff --git a/src/LIBVIRT-MIB.txt b/src/LIBVIRT-MIB.txt
index a8195ff..1fd2074 100644
--- a/src/LIBVIRT-MIB.txt
+++ b/src/LIBVIRT-MIB.txt
@@ -14,7 +14,7 @@ IMPORTS
libvirtMIB MODULE-IDENTITY
- LAST-UPDATED "201012020000Z"
+ LAST-UPDATED "201803200000Z"
ORGANIZATION "www.libvirt.org"
CONTACT-INFO
"email: libvirt-users(a)redhat.com
@@ -22,10 +22,11 @@ libvirtMIB MODULE-IDENTITY
DESCRIPTION
"First draft, for experimental purposes only!
Not to be used in real deployment!"
+ REVISION "201803200000Z"
+ DESCRIPTION "Updated OID"
REVISION "201012020000Z"
DESCRIPTION "Initial version."
- ::= { enterprises 12345 }
--- TODO: user real libvirt OID here ^
+ ::= { enterprises 36957 }
-- structure advised by RFC 4181:
diff --git a/src/libvirtGuestTable-README-libvirtGuestTable.txt b/src/libvirtGuestTable-README-libvirtGuestTable.txt
index 74e2274..0871568 100644
--- a/src/libvirtGuestTable-README-libvirtGuestTable.txt
+++ b/src/libvirtGuestTable-README-libvirtGuestTable.txt
@@ -587,14 +587,14 @@ Table / column details
/*
* LIBVIRT-MIB::libvirtGuestTable is subid 1 of libvirtObjects.
* Its status is Current.
- * OID: .1.3.6.1.4.1.12345.1.1, length: 9
+ * OID: .1.3.6.1.4.1.36957.1.1, length: 9
*/
/*---------------------------------------------------------------------
* LIBVIRT-MIB::libvirtGuestEntry.libvirtGuestUUID
* libvirtGuestUUID is subid 1 of libvirtGuestEntry.
* Its status is Current, and its access level is NoAccess.
- * OID: .1.3.6.1.4.1.12345.1.1.1.1
+ * OID: .1.3.6.1.4.1.36957.1.1.1.1
* Description:
The UUID of the virtual guest.
*
@@ -620,7 +620,7 @@ The UUID of the virtual guest.
* LIBVIRT-MIB::libvirtGuestEntry.libvirtGuestName
* libvirtGuestName is subid 2 of libvirtGuestEntry.
* Its status is Current, and its access level is ReadOnly.
- * OID: .1.3.6.1.4.1.12345.1.1.1.2
+ * OID: .1.3.6.1.4.1.36957.1.1.1.2
* Description:
Name of active virtual guest.
*
@@ -638,7 +638,7 @@ Name of active virtual guest.
* LIBVIRT-MIB::libvirtGuestEntry.libvirtGuestState
* libvirtGuestState is subid 3 of libvirtGuestEntry.
* Its status is Current, and its access level is Create.
- * OID: .1.3.6.1.4.1.12345.1.1.1.3
+ * OID: .1.3.6.1.4.1.36957.1.1.1.3
* Description:
Current state of the active guest.
*
@@ -656,7 +656,7 @@ Current state of the active guest.
* LIBVIRT-MIB::libvirtGuestEntry.libvirtGuestCpuCount
* libvirtGuestCpuCount is subid 4 of libvirtGuestEntry.
* Its status is Current, and its access level is ReadOnly.
- * OID: .1.3.6.1.4.1.12345.1.1.1.4
+ * OID: .1.3.6.1.4.1.36957.1.1.1.4
* Description:
Number of virtual CPUs the virtual guest uses.
*
@@ -674,7 +674,7 @@ Number of virtual CPUs the virtual guest uses.
* LIBVIRT-MIB::libvirtGuestEntry.libvirtGuestMemoryCurrent
* libvirtGuestMemoryCurrent is subid 5 of libvirtGuestEntry.
* Its status is Current, and its access level is ReadOnly.
- * OID: .1.3.6.1.4.1.12345.1.1.1.5
+ * OID: .1.3.6.1.4.1.36957.1.1.1.5
* Description:
Current amount of memory (in MiB) used by the virtual guest.
*
@@ -692,7 +692,7 @@ Current amount of memory (in MiB) used by the virtual guest.
* LIBVIRT-MIB::libvirtGuestEntry.libvirtGuestMemoryLimit
* libvirtGuestMemoryLimit is subid 6 of libvirtGuestEntry.
* Its status is Current, and its access level is ReadOnly.
- * OID: .1.3.6.1.4.1.12345.1.1.1.6
+ * OID: .1.3.6.1.4.1.36957.1.1.1.6
* Description:
The maximum amount of memory (in MiB) that can be used by the virtual
guest.
@@ -711,7 +711,7 @@ The maximum amount of memory (in MiB) that can be used by the virtual
* LIBVIRT-MIB::libvirtGuestEntry.libvirtGuestCpuTime
* libvirtGuestCpuTime is subid 7 of libvirtGuestEntry.
* Its status is Current, and its access level is ReadOnly.
- * OID: .1.3.6.1.4.1.12345.1.1.1.7
+ * OID: .1.3.6.1.4.1.36957.1.1.1.7
* Description:
The CPU time used by the virtual guest, in nanoseconds.
*
@@ -728,7 +728,7 @@ The CPU time used by the virtual guest, in nanoseconds.
* LIBVIRT-MIB::libvirtGuestEntry.libvirtGuestRowStatus
* libvirtGuestRowStatus is subid 9 of libvirtGuestEntry.
* Its status is Current, and its access level is Create.
- * OID: .1.3.6.1.4.1.12345.1.1.1.9
+ * OID: .1.3.6.1.4.1.36957.1.1.1.9
* Description:
Status of the virtual guest.
diff --git a/src/libvirtGuestTable.h b/src/libvirtGuestTable.h
index 6762238..529838b 100644
--- a/src/libvirtGuestTable.h
+++ b/src/libvirtGuestTable.h
@@ -68,7 +68,7 @@ void shutdown_libvirtGuestTable(void);
/*
* LIBVIRT-MIB::libvirtGuestTable is subid 1 of libvirtObjects.
* Its status is Current.
- * OID: .1.3.6.1.4.1.12345.1.1, length: 9
+ * OID: .1.3.6.1.4.1.36957.1.1, length: 9
*/
/* *********************************************************************
* When you register your mib, you get to provide a generic
diff --git a/src/libvirtGuestTable_data_access.c b/src/libvirtGuestTable_data_access.c
index 2958284..d7de4d5 100644
--- a/src/libvirtGuestTable_data_access.c
+++ b/src/libvirtGuestTable_data_access.c
@@ -51,7 +51,7 @@
/*
* LIBVIRT-MIB::libvirtGuestTable is subid 1 of libvirtObjects.
* Its status is Current.
- * OID: .1.3.6.1.4.1.12345.1.1, length: 9
+ * OID: .1.3.6.1.4.1.36957.1.1, length: 9
*/
/**
@@ -291,7 +291,7 @@ libvirtGuestTable_row_prep( libvirtGuestTable_rowreq_ctx *rowreq_ctx)
* LIBVIRT-MIB::libvirtGuestEntry.libvirtGuestUUID
* libvirtGuestUUID is subid 1 of libvirtGuestEntry.
* Its status is Current, and its access level is NoAccess.
- * OID: .1.3.6.1.4.1.12345.1.1.1.1
+ * OID: .1.3.6.1.4.1.36957.1.1.1.1
* Description:
The UUID of the virtual guest.
*
diff --git a/src/libvirtGuestTable_data_access.h b/src/libvirtGuestTable_data_access.h
index 3491aa4..49afb9d 100644
--- a/src/libvirtGuestTable_data_access.h
+++ b/src/libvirtGuestTable_data_access.h
@@ -45,7 +45,7 @@ extern "C" {
/*
* LIBVIRT-MIB::libvirtGuestTable is subid 1 of libvirtObjects.
* Its status is Current.
- * OID: .1.3.6.1.4.1.12345.1.1, length: 9
+ * OID: .1.3.6.1.4.1.36957.1.1, length: 9
*/
diff --git a/src/libvirtGuestTable_data_get.c b/src/libvirtGuestTable_data_get.c
index 08ddb4a..890ba07 100644
--- a/src/libvirtGuestTable_data_get.c
+++ b/src/libvirtGuestTable_data_get.c
@@ -50,7 +50,7 @@
/*
* LIBVIRT-MIB::libvirtGuestTable is subid 1 of libvirtObjects.
* Its status is Current.
- * OID: .1.3.6.1.4.1.12345.1.1, length: 9
+ * OID: .1.3.6.1.4.1.36957.1.1, length: 9
*/
/* ---------------------------------------------------------------------
@@ -134,7 +134,7 @@ libvirtGuestTable_indexes_set(libvirtGuestTable_rowreq_ctx *rowreq_ctx, char *li
* LIBVIRT-MIB::libvirtGuestEntry.libvirtGuestName
* libvirtGuestName is subid 2 of libvirtGuestEntry.
* Its status is Current, and its access level is ReadOnly.
- * OID: .1.3.6.1.4.1.12345.1.1.1.2
+ * OID: .1.3.6.1.4.1.36957.1.1.1.2
* Description:
Name of active virtual guest.
*
@@ -222,7 +222,7 @@ libvirtGuestName_get( libvirtGuestTable_rowreq_ctx *rowreq_ctx, char **libvirtGu
* LIBVIRT-MIB::libvirtGuestEntry.libvirtGuestState
* libvirtGuestState is subid 3 of libvirtGuestEntry.
* Its status is Current, and its access level is Create.
- * OID: .1.3.6.1.4.1.12345.1.1.1.3
+ * OID: .1.3.6.1.4.1.36957.1.1.1.3
* Description:
Current state of the active guest.
*
@@ -274,7 +274,7 @@ libvirtGuestState_get( libvirtGuestTable_rowreq_ctx *rowreq_ctx, u_long * libvir
* LIBVIRT-MIB::libvirtGuestEntry.libvirtGuestCpuCount
* libvirtGuestCpuCount is subid 4 of libvirtGuestEntry.
* Its status is Current, and its access level is ReadOnly.
- * OID: .1.3.6.1.4.1.12345.1.1.1.4
+ * OID: .1.3.6.1.4.1.36957.1.1.1.4
* Description:
Number of virtual CPUs the virtual guest uses.
*
@@ -326,7 +326,7 @@ libvirtGuestCpuCount_get( libvirtGuestTable_rowreq_ctx *rowreq_ctx, u_long * lib
* LIBVIRT-MIB::libvirtGuestEntry.libvirtGuestMemoryCurrent
* libvirtGuestMemoryCurrent is subid 5 of libvirtGuestEntry.
* Its status is Current, and its access level is ReadOnly.
- * OID: .1.3.6.1.4.1.12345.1.1.1.5
+ * OID: .1.3.6.1.4.1.36957.1.1.1.5
* Description:
Current amount of memory (in MiB) used by the virtual guest.
*
@@ -378,7 +378,7 @@ libvirtGuestMemoryCurrent_get( libvirtGuestTable_rowreq_ctx *rowreq_ctx, u_long
* LIBVIRT-MIB::libvirtGuestEntry.libvirtGuestMemoryLimit
* libvirtGuestMemoryLimit is subid 6 of libvirtGuestEntry.
* Its status is Current, and its access level is ReadOnly.
- * OID: .1.3.6.1.4.1.12345.1.1.1.6
+ * OID: .1.3.6.1.4.1.36957.1.1.1.6
* Description:
The maximum amount of memory (in MiB) that can be used by the virtual
guest.
@@ -431,7 +431,7 @@ libvirtGuestMemoryLimit_get( libvirtGuestTable_rowreq_ctx *rowreq_ctx, u_long *
* LIBVIRT-MIB::libvirtGuestEntry.libvirtGuestCpuTime
* libvirtGuestCpuTime is subid 7 of libvirtGuestEntry.
* Its status is Current, and its access level is ReadOnly.
- * OID: .1.3.6.1.4.1.12345.1.1.1.7
+ * OID: .1.3.6.1.4.1.36957.1.1.1.7
* Description:
The CPU time used by the virtual guest, in nanoseconds.
*
@@ -479,7 +479,7 @@ libvirtGuestCpuTime_get( libvirtGuestTable_rowreq_ctx *rowreq_ctx, struct counte
* LIBVIRT-MIB::libvirtGuestEntry.libvirtGuestRowStatus
* libvirtGuestRowStatus is subid 9 of libvirtGuestEntry.
* Its status is Current, and its access level is Create.
- * OID: .1.3.6.1.4.1.12345.1.1.1.9
+ * OID: .1.3.6.1.4.1.36957.1.1.1.9
* Description:
Status of the virtual guest.
diff --git a/src/libvirtGuestTable_data_get.h b/src/libvirtGuestTable_data_get.h
index 6a0e7ff..616f824 100644
--- a/src/libvirtGuestTable_data_get.h
+++ b/src/libvirtGuestTable_data_get.h
@@ -44,7 +44,7 @@ extern "C" {
/*
* LIBVIRT-MIB::libvirtGuestTable is subid 1 of libvirtObjects.
* Its status is Current.
- * OID: .1.3.6.1.4.1.12345.1.1, length: 9
+ * OID: .1.3.6.1.4.1.36957.1.1, length: 9
*/
/*
* indexes
diff --git a/src/libvirtGuestTable_data_set.c b/src/libvirtGuestTable_data_set.c
index d67c9d9..7ee8e9f 100644
--- a/src/libvirtGuestTable_data_set.c
+++ b/src/libvirtGuestTable_data_set.c
@@ -46,7 +46,7 @@
/*
* LIBVIRT-MIB::libvirtGuestTable is subid 1 of libvirtObjects.
* Its status is Current.
- * OID: .1.3.6.1.4.1.12345.1.1, length: 9
+ * OID: .1.3.6.1.4.1.36957.1.1, length: 9
*/
/*
* NOTE: if you update this chart, please update the versions in
@@ -407,7 +407,7 @@ libvirtGuestTable_undo_commit( libvirtGuestTable_rowreq_ctx *rowreq_ctx)
* LIBVIRT-MIB::libvirtGuestEntry.libvirtGuestState
* libvirtGuestState is subid 3 of libvirtGuestEntry.
* Its status is Current, and its access level is Create.
- * OID: .1.3.6.1.4.1.12345.1.1.1.3
+ * OID: .1.3.6.1.4.1.36957.1.1.1.3
* Description:
Current state of the active guest.
*
@@ -586,7 +586,7 @@ libvirtGuestState_undo( libvirtGuestTable_rowreq_ctx *rowreq_ctx)
* LIBVIRT-MIB::libvirtGuestEntry.libvirtGuestRowStatus
* libvirtGuestRowStatus is subid 9 of libvirtGuestEntry.
* Its status is Current, and its access level is Create.
- * OID: .1.3.6.1.4.1.12345.1.1.1.9
+ * OID: .1.3.6.1.4.1.36957.1.1.1.9
* Description:
Status of the virtual guest.
diff --git a/src/libvirtGuestTable_data_set.h b/src/libvirtGuestTable_data_set.h
index 873f9f5..28092c5 100644
--- a/src/libvirtGuestTable_data_set.h
+++ b/src/libvirtGuestTable_data_set.h
@@ -44,7 +44,7 @@ extern "C" {
/*
* LIBVIRT-MIB::libvirtGuestTable is subid 1 of libvirtObjects.
* Its status is Current.
- * OID: .1.3.6.1.4.1.12345.1.1, length: 9
+ * OID: .1.3.6.1.4.1.36957.1.1, length: 9
*/
diff --git a/src/libvirtGuestTable_interface.c b/src/libvirtGuestTable_interface.c
index ee48291..14057aa 100644
--- a/src/libvirtGuestTable_interface.c
+++ b/src/libvirtGuestTable_interface.c
@@ -68,7 +68,7 @@
/*
* LIBVIRT-MIB::libvirtGuestTable is subid 1 of libvirtObjects.
* Its status is Current.
- * OID: .1.3.6.1.4.1.12345.1.1, length: 9
+ * OID: .1.3.6.1.4.1.36957.1.1, length: 9
*/
typedef struct libvirtGuestTable_interface_ctx_s {
diff --git a/src/libvirtGuestTable_oids.h b/src/libvirtGuestTable_oids.h
index 85950f4..67ccd6f 100644
--- a/src/libvirtGuestTable_oids.h
+++ b/src/libvirtGuestTable_oids.h
@@ -29,7 +29,7 @@ extern "C" {
/* column number definitions for table libvirtGuestTable */
-#define LIBVIRTGUESTTABLE_OID 1,3,6,1,4,1,12345,1,1
+#define LIBVIRTGUESTTABLE_OID 1,3,6,1,4,1,36957,1,1
#define COLUMN_LIBVIRTGUESTUUID 1
diff --git a/src/libvirtNotifications.c b/src/libvirtNotifications.c
index 52c7ae4..135f177 100644
--- a/src/libvirtNotifications.c
+++ b/src/libvirtNotifications.c
@@ -34,15 +34,15 @@ int
send_libvirtGuestNotif_trap(virDomainPtr dom)
{
netsnmp_variable_list *var_list = NULL;
- const oid libvirtGuestNotif_oid[] = { 1, 3, 6, 1, 4, 1, 12345, 0, 1 };
+ const oid libvirtGuestNotif_oid[] = { 1, 3, 6, 1, 4, 1, 36957, 0, 1 };
const oid libvirtGuestName_oid[] =
- { 1, 3, 6, 1, 4, 1, 12345, 1, 1, 1, 2, 0 };
+ { 1, 3, 6, 1, 4, 1, 36957, 1, 1, 1, 2, 0 };
const oid libvirtGuestUUID_oid[] =
- { 1, 3, 6, 1, 4, 1, 12345, 1, 1, 1, 1, 1 };
+ { 1, 3, 6, 1, 4, 1, 36957, 1, 1, 1, 1, 1 };
const oid libvirtGuestState_oid[] =
- { 1, 3, 6, 1, 4, 1, 12345, 1, 1, 1, 3, 2 };
+ { 1, 3, 6, 1, 4, 1, 36957, 1, 1, 1, 3, 2 };
const oid libvirtGuestRowStatus_oid[] =
- { 1, 3, 6, 1, 4, 1, 12345, 1, 1, 1, 9, 3 };
+ { 1, 3, 6, 1, 4, 1, 36957, 1, 1, 1, 9, 3 };
const char *domName = virDomainGetName(dom);
6 years, 9 months
[libvirt] [PATCH v2 0/5] Apparmor support for less common devices
by Christian Ehrhardt
So far users added manual rules for most of these uncommon devices,
but recent changes made some of the callbacks mandatory for hotplug
so we should take shot at implementing them as those callbacks as well
as for the initial start of a guest via virt-aa-helper.
*Updates since v1*
- (Set|Restore)*Label: remove seclabel check already done in reload_profile
- virt-aa-helper: check pointers before accessing them
- add tests for new virt-aa-helper supported xml elements
- extend tests to check for expected content (new patch in series)
Christian Ehrhardt (5):
security, apparmor: add (Set|Restore)MemoryLabel
security, apparmor: add (Set|Restore)InputLabel
virt-aa-helper: generate rules for passthrough input devices
virt-aa-helper: generate rules for nvdimm memory
virt-aa-helper: test: check for expected profile content
src/security/security_apparmor.c | 88 ++++++++++++++++++++++++++++++++++++++++
src/security/virt-aa-helper.c | 16 ++++++++
tests/virt-aa-helper-test | 88 ++++++++++++++++++++++++----------------
3 files changed, 158 insertions(+), 34 deletions(-)
--
2.7.4
6 years, 9 months
[libvirt] [PATCH 0/3] libxl: misc fixes for migration
by Jim Fehlig
While working on the {Begin,End}API improvements I noticed a few problems
in the migration code. The first two are trival, but the third describes
a problem I encountered while testing, and provides a potential fix. See
the patch for more details.
Jim Fehlig (3):
libxl: dont dereference NULL libxlDomainObjPrivatePtr
libxl: remove needless 'else' in libxlDomainMigrationPrepare
util: introduce virSocketAddrParseQuiet
src/libvirt_private.syms | 1 +
src/libxl/libxl_migration.c | 10 ++++----
src/rpc/virnetsocket.c | 2 +-
src/util/virsocketaddr.c | 60 +++++++++++++++++++++++++++++++++------------
src/util/virsocketaddr.h | 4 +++
5 files changed, 55 insertions(+), 22 deletions(-)
--
2.16.2
6 years, 9 months