[libvirt] [PATCH v2 00/10] Introduce new libvirt-guest NSS module
by Michal Privoznik
v2 of:
https://www.redhat.com/archives/libvir-list/2016-November/msg01456.html
diff to v1:
- New module is created instead of putting everything into already existing one
- Few hints from review of v1 were worked in
Michal Privoznik (10):
network: Don't unlock non-locked network driver
nssmock: Prefer free() over VIR_FREE()
virstring: Introduce virStringListAdd
virstring: Introduce virStringListRemove
util: Introduce virFileRewriteStr
util: Introduce virMACMap module
network: Track MAC address map
nss: Use macro to generate public API names
nss: Move address appending code into a separate function
nss: Introduce libvirt-guest module
cfg.mk | 2 +-
docs/news.html.in | 4 +
docs/nss.html.in | 58 ++++-
po/POTFILES.in | 1 +
src/Makefile.am | 9 +
src/conf/network_conf.h | 4 +
src/conf/virsecretobj.c | 20 +-
src/libvirt_private.syms | 12 ++
src/network/bridge_driver.c | 95 ++++++++-
src/network/leaseshelper.c | 14 +-
src/util/virfile.c | 24 ++-
src/util/virfile.h | 7 +-
src/util/virmacmap.c | 399 +++++++++++++++++++++++++++++++++++
src/util/virmacmap.h | 48 +++++
src/util/virstring.c | 84 ++++++++
src/util/virstring.h | 6 +
src/util/virxml.c | 4 +-
tests/Makefile.am | 36 +++-
tests/nssdata/virbr0.macs | 23 ++
tests/nssdata/virbr0.status | 5 +
tests/nssdata/virbr1.macs | 21 ++
tests/nssdata/virbr1.status | 5 +
tests/nsslinktest.c | 2 +-
tests/nssmock.c | 25 ++-
tests/nsstest.c | 17 +-
tests/virmacmapmock.c | 29 +++
tests/virmacmaptest.c | 232 ++++++++++++++++++++
tests/virmacmaptestdata/complex.json | 45 ++++
tests/virmacmaptestdata/empty.json | 3 +
tests/virmacmaptestdata/simple.json | 8 +
tests/virmacmaptestdata/simple2.json | 16 ++
tests/virstringtest.c | 98 +++++++++
tools/Makefile.am | 46 +++-
tools/nss/libvirt_guest_nss.syms | 12 ++
tools/nss/libvirt_nss.c | 216 +++++++++++++------
tools/nss/libvirt_nss.h | 30 +--
36 files changed, 1531 insertions(+), 129 deletions(-)
create mode 100644 src/util/virmacmap.c
create mode 100644 src/util/virmacmap.h
create mode 100644 tests/nssdata/virbr0.macs
create mode 100644 tests/nssdata/virbr1.macs
create mode 100644 tests/virmacmapmock.c
create mode 100644 tests/virmacmaptest.c
create mode 100644 tests/virmacmaptestdata/complex.json
create mode 100644 tests/virmacmaptestdata/empty.json
create mode 100644 tests/virmacmaptestdata/simple.json
create mode 100644 tests/virmacmaptestdata/simple2.json
create mode 100644 tools/nss/libvirt_guest_nss.syms
--
2.11.0
7 years, 10 months
[libvirt] [PATCH 0/2] Fix issues getting voldef capacity value
by John Ferlan
Details in each patch - essentially trying to get "more correct" values.
John Ferlan (2):
storage: Fix virStorageBackendUpdateVolTargetInfo type check
storage: Allow probe of volume capacity for BLOCK type
src/storage/storage_backend.c | 12 ++++++++----
src/storage/storage_backend.h | 3 ++-
src/storage/storage_backend_fs.c | 3 ++-
3 files changed, 12 insertions(+), 6 deletions(-)
--
2.7.4
7 years, 10 months
[libvirt] [PATCH] disk: Fixup error handling path for devmapper when part_separator='yes'
by John Ferlan
https://bugzilla.redhat.com/show_bug.cgi?id=1346566
If libvirt_parthelper is erroneously told to append the partition
separator 'p' onto the generated output for a disk pool using device
mapper that has 'user_friendly_names' set to true, then the error
recovery path will fail to find volume resulting in the pool being
in an unusable state.
So, augment the documentation to provide the better hint that the
part_separator='yes' should be set when user_friendly_names are not
being used. Additionally, once we're in the error path where the
returned name doesn't match the expected partition name try to see
if the reason is because the 'p' was erroneosly added. If so alter
the about to be removed vol->target.path so that the DiskDeleteVol
code can find the partition that was created and remove it.
Signed-off-by: John Ferlan <jferlan(a)redhat.com>
---
docs/formatstorage.html.in | 5 ++++-
src/storage/storage_backend_disk.c | 23 +++++++++++++++++++++++
2 files changed, 27 insertions(+), 1 deletion(-)
diff --git a/docs/formatstorage.html.in b/docs/formatstorage.html.in
index ed1f0d1..7690114 100644
--- a/docs/formatstorage.html.in
+++ b/docs/formatstorage.html.in
@@ -138,7 +138,10 @@
causes libvirt to attempt to generate and find target volume path's
using a "p" separator. The default algorithm used by device mapper
is to add the "p" separator only when the source device path ends
- with a number.
+ with a number; however, it's possible to configure the devmapper
+ device to not use 'user_friendly_names' thus creating partitions
+ with the "p" separator even when the device source path does not
+ end with a number.
<span class="since">Since 1.3.1</span></p></dd>
<dt><code>dir</code></dt>
<dd>Provides the source for pools backed by directories (pool
diff --git a/src/storage/storage_backend_disk.c b/src/storage/storage_backend_disk.c
index 666ad03..07a04f1 100644
--- a/src/storage/storage_backend_disk.c
+++ b/src/storage/storage_backend_disk.c
@@ -95,6 +95,29 @@ virStorageBackendDiskMakeDataVol(virStoragePoolObjPtr pool,
virReportError(VIR_ERR_INVALID_ARG,
_("invalid partition name '%s', expected '%s'"),
vol->name, partname);
+
+ /* Let's see if we by chance parthelper created a name that won't be
+ * found later when we try to delete. We tell parthelper to add a 'p'
+ * to the output via the part_separator flag, but if devmapper has
+ * user_friendly_names set, the creation won't happen that way, thus
+ * our deletion will fail because the name we generated is wrong.
+ * Check for our conditions and see if the generated name is the
+ * same as StablePath returns and has the 'p' in it */
+ if (pool->def->source.devices[0].part_separator ==
+ VIR_TRISTATE_BOOL_YES &&
+ !virIsDevMapperDevice(vol->target.path) &&
+ STREQ(groups[0], vol->target.path) &&
+ (tmp = strrchr(groups[0], 'p'))) {
+
+ /* If we remove the 'p' from groups[0] and the resulting
+ * device is a devmapper device, then we know parthelper
+ * was told to create the wrong name based on the results.
+ * So just remove the 'p' from the vol->target.path too. */
+ memmove(tmp, tmp + 1, strlen(tmp));
+ if (virIsDevMapperDevice(groups[0]) &&
+ (tmp = strrchr(vol->target.path, 'p')))
+ memmove(tmp, tmp + 1, strlen(tmp));
+ }
return -1;
}
--
2.7.4
7 years, 10 months
[libvirt] [PATCH 00/11] Adjust build/start format checking for fs, disk, and logical backends
by John Ferlan
Two of these patches (2 and 10) are followups to no-overwrite patches
previously posted (I left links in the patches for reference).
Essentially this series works to unify the probing code from the file
system backend using blkid and the parted format reading code from the
disk backend in one common set of functions.
In doing so, the disk backend will now pick up the ability to use the
blkid 'partitions' APIs in order to "probe" the target device for a
valid/known partition format type. Additionally, the file system
probe will pick up a fallback to the parted mechanism from the disk
backend if the 'blkid' APIs are not built into the system.
A few extra bells/whistles were added for fs pool startup to ensure that
the format in the startup XML matches the format on the target disk,
which is essentially the mechanism the disk backend used (although it
was slightly broken).
Then in order to really pile on, the overwrite logic was added to the
logical pool which didn't have any such checking (both build and start).
Testing was done locally using an iSCSI device and laying down different
formats and seeing what would happen on various usages of the format
(with --overwrite and --no-overwrite).
John Ferlan (11):
storage: Introduce virStorageBackendDeviceProbeEmpty
storage: Fix implementation of no-overwrite for file system backend
storage: Add partition type checks for BLKID probing
storage: Add writelabel bool for virStorageBackendDeviceProbe
storage: For FS pool check for properly formatted target volume
storage: Move and rename disk backend label checking
storage: Adjust disk label found to match labels
storage: Clean up logical pool devices on build failure
storage: Extract logical device initialize into a helper
storage: Add overwrite flag checking for logical pool
storage: Validate the device formats at logical startup
src/libvirt_private.syms | 1 +
src/storage/storage_backend.c | 396 ++++++++++++++++++++++++++++++++++
src/storage/storage_backend.h | 4 +
src/storage/storage_backend_disk.c | 150 ++-----------
src/storage/storage_backend_fs.c | 118 ++--------
src/storage/storage_backend_fs.h | 5 -
src/storage/storage_backend_logical.c | 180 ++++++++++------
tools/virsh-pool.c | 2 +-
tools/virsh.pod | 42 ++--
9 files changed, 585 insertions(+), 313 deletions(-)
--
2.7.4
7 years, 10 months
[libvirt] [PATCH 00/11] tests: qemu: Add cpu hotplug testing
by Peter Krempa
Add some useful monitor infrastructure to simplify testing and add testing for
the cpu hotplug code. The code has some complex logic which was not covered
by current test suite.
Peter Krempa (11):
qemu: monitor: More strict checking of 'query-cpus' if hotplug is
supported
util: json: Add helper to reformat JSON strings
tests: qemu: Document qemuMonitorTestNewFromFile
qemu: Prepare for reuse of qemuDomainSetVcpusLive
qemu: Move cpu hotplug code into qemu_hotplug.c
tests: qemumonitor: Propagate better error messages
tests: qemu: monitor: Add helpers to test full command syntax
tests: qemu: Add helper to load full monitor conversation from file
tests: hotplug: Add test infrastructure for testing qemu CPU hotplug
code
tests: hotplug: Add test data for legacy cpu hotplug
tests: hotplug: Test CPU hotplug with ppc64 data
src/libvirt_private.syms | 1 +
src/qemu/qemu_driver.c | 319 -----------
src/qemu/qemu_hotplug.c | 328 ++++++++++++
src/qemu/qemu_hotplug.h | 7 +
src/qemu/qemu_monitor.c | 6 +-
src/qemu/qemu_monitor_json.c | 6 +-
src/qemu/qemu_monitor_json.h | 3 +-
src/util/virjson.c | 29 +
src/util/virjson.h | 2 +
tests/qemuagenttest.c | 3 +-
tests/qemuhotplugtest.c | 194 +++++++
tests/qemuhotplugtestcpus/ppc64-bulk-domain.xml | 20 +
tests/qemuhotplugtestcpus/ppc64-bulk-monitor.json | 593 +++++++++++++++++++++
.../qemuhotplugtestcpus/ppc64-bulk-result-conf.xml | 64 +++
.../qemuhotplugtestcpus/ppc64-bulk-result-live.xml | 72 +++
.../qemuhotplugtestcpus/x86-modern-bulk-domain.xml | 21 +
.../x86-modern-bulk-monitor.json | 471 ++++++++++++++++
.../x86-modern-bulk-result-conf.xml | 40 ++
.../x86-modern-bulk-result-live.xml | 48 ++
tests/qemuhotplugtestcpus/x86-old-bulk-domain.xml | 21 +
.../qemuhotplugtestcpus/x86-old-bulk-monitor.json | 193 +++++++
.../x86-old-bulk-result-conf.xml | 30 ++
.../x86-old-bulk-result-live.xml | 38 ++
tests/qemumonitorjsontest.c | 2 +-
tests/qemumonitortestutils.c | 322 ++++++++++-
tests/qemumonitortestutils.h | 12 +-
26 files changed, 2505 insertions(+), 340 deletions(-)
create mode 100644 tests/qemuhotplugtestcpus/ppc64-bulk-domain.xml
create mode 100644 tests/qemuhotplugtestcpus/ppc64-bulk-monitor.json
create mode 100644 tests/qemuhotplugtestcpus/ppc64-bulk-result-conf.xml
create mode 100644 tests/qemuhotplugtestcpus/ppc64-bulk-result-live.xml
create mode 100644 tests/qemuhotplugtestcpus/x86-modern-bulk-domain.xml
create mode 100644 tests/qemuhotplugtestcpus/x86-modern-bulk-monitor.json
create mode 100644 tests/qemuhotplugtestcpus/x86-modern-bulk-result-conf.xml
create mode 100644 tests/qemuhotplugtestcpus/x86-modern-bulk-result-live.xml
create mode 100644 tests/qemuhotplugtestcpus/x86-old-bulk-domain.xml
create mode 100644 tests/qemuhotplugtestcpus/x86-old-bulk-monitor.json
create mode 100644 tests/qemuhotplugtestcpus/x86-old-bulk-result-conf.xml
create mode 100644 tests/qemuhotplugtestcpus/x86-old-bulk-result-live.xml
--
2.10.2
7 years, 10 months
[libvirt] [PATCH v3 0/8] aggregate multiple pcie-root-ports onto a single slot
by Laine Stump
Another rebase of the series with no other changes
Laine Stump (8):
conf: use struct instead of int for each slot in
virDomainPCIAddressBus
conf: eliminate concept of "reserveEntireSlot"
conf: eliminate repetitive code in virDomainPCIAddressGetNextSlot()
conf: start search for next unused PCI address at same slot as
previous find
conf: new function virDomainPCIAddressIsMulti()
qemu: use virDomainPCIAddressIsMulti() to determine multifunction
setting
conf: aggregate multiple devices on a slot when assigning PCI
addresses
conf: aggregate multiple pcie-root-ports onto a single slot
src/conf/domain_addr.c | 290 ++++++++++++++-------
src/conf/domain_addr.h | 48 +++-
src/libvirt_private.syms | 1 +
src/qemu/qemu_command.c | 16 +-
src/qemu/qemu_domain_address.c | 35 ++-
.../qemuxml2argv-pcie-root-port.args | 5 +-
.../qemuxml2argv-pcie-switch-upstream-port.args | 5 +-
.../qemuxml2argv-q35-default-devices-only.args | 7 +-
.../qemuxml2argv-q35-multifunction.args | 43 +++
.../qemuxml2argv-q35-multifunction.xml | 51 ++++
.../qemuxml2argv-q35-pcie-autoadd.args | 30 ++-
tests/qemuxml2argvdata/qemuxml2argv-q35-pcie.args | 28 +-
.../qemuxml2argv-q35-virt-manager-basic.args | 13 +-
.../qemuxml2argv-q35-virtio-pci.args | 28 +-
tests/qemuxml2argvtest.c | 25 ++
.../qemuxml2xmlout-pcie-root-port.xml | 2 +-
.../qemuxml2xmlout-pcie-switch-upstream-port.xml | 4 +-
.../qemuxml2xmlout-q35-default-devices-only.xml | 8 +-
.../qemuxml2xmlout-q35-multifunction.xml | 120 +++++++++
.../qemuxml2xmlout-q35-pcie-autoadd.xml | 52 ++--
.../qemuxml2xmloutdata/qemuxml2xmlout-q35-pcie.xml | 48 ++--
.../qemuxml2xmlout-q35-virt-manager-basic.xml | 20 +-
.../qemuxml2xmlout-q35-virtio-pci.xml | 48 ++--
tests/qemuxml2xmltest.c | 25 ++
24 files changed, 676 insertions(+), 276 deletions(-)
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-q35-multifunction.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-q35-multifunction.xml
create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-q35-multifunction.xml
--
2.7.4
7 years, 10 months
[libvirt] Do different Virgil3D users running have the same CANVAS fingerprint?
by bancfc@openmailbox.org
Background:
Canvas fingerprinting is a technique to track users based on their GPUs.
https://en.wikipedia.org/wiki/Canvas_fingerprinting
Someone did some testing and the good news is the fingerprint is common
for all users of the same OS across all KVM users because it presents
the same virtual GPU/drivers for everybody.
What I need your help to find out is whether this holds for Virgil3D
users that enable graphics acceleration. (I am running on Debian and the
libvirt version in the repos is too old to have this included also I
don't have multiple machines)
To test this you need:
To run plain FireFox on a virtualized distro (with GL acceleration
enabled in libvirt) of your choice and visit
https://browserleaks.com/canvas . Then repeat the same steps with that
same distro (in a VM) on another physical machine and compare values.
A good result is if you see the same numbers for both machines. That
means the virtual device fingerprint is uniform for all virtual users.
7 years, 10 months
[libvirt] [PATCH 00/12] vbox: remove support for vbox 3.x and older.
by Dawid Zamirski
Hello,
This series removes support for legacy VirtualBox versions (3.x and
older) that did not have upstream support for a while and won't even
work on any relatively recent distro. The idea for doing this was
first mentioned here [1] and this makes the driver code cleaner as
the APIs for those old versions were quite different from v4.0+ and
required abstractions to handle the differences.
Please note that the first patch in the series is sent to ML as a
compressed attachment because it deletes VirtualBox SDK header files
for those old verions which are large and the patch would not pass ML
message size limit.
[1] https://www.redhat.com/archives/libvir-list/2016-November/msg01133.html
Regards,
Dawid
Dawid Zamirski (12):
vbox: remove SDK header files for vbox 3 and older.
vbox: remove calls to *InstallUniformedAPI macros.
vbox: remove code for old API versions.
vbox: remove _vboxAttachDrivesOld
vbox: do not use IHardDisk anymore.
vbox: remove getMachineForSession flag.
vbox: remove domain events support.
vbox: remove code dealing with oldMediumInterface
vbox: IVRDxServer to IVRDEServer.
vbox: fix _displayTakeScreenShotPNGToArray
vbox: consolidate vbox IID structures.
docs: add news entry in improvements section.
docs/news.html.in | 8 +
src/Makefile.am | 4 -
src/vbox/vbox_CAPI_v2_2.h | 4869 -----------------------------------
src/vbox/vbox_CAPI_v3_0.h | 5396 ---------------------------------------
src/vbox/vbox_CAPI_v3_1.h | 5297 --------------------------------------
src/vbox/vbox_CAPI_v3_2.h | 5625 -----------------------------------------
src/vbox/vbox_V2_2.c | 37 -
src/vbox/vbox_V3_0.c | 37 -
src/vbox/vbox_V3_1.c | 37 -
src/vbox/vbox_V3_2.c | 37 -
src/vbox/vbox_XPCOMCGlue.h | 2 +-
src/vbox/vbox_common.c | 402 +--
src/vbox/vbox_common.h | 13 +-
src/vbox/vbox_network.c | 12 +-
src/vbox/vbox_storage.c | 76 +-
src/vbox/vbox_tmpl.c | 3006 ++--------------------
src/vbox/vbox_uniformed_api.h | 171 +-
17 files changed, 438 insertions(+), 24591 deletions(-)
delete mode 100644 src/vbox/vbox_CAPI_v2_2.h
delete mode 100644 src/vbox/vbox_CAPI_v3_0.h
delete mode 100644 src/vbox/vbox_CAPI_v3_1.h
delete mode 100644 src/vbox/vbox_CAPI_v3_2.h
delete mode 100644 src/vbox/vbox_V2_2.c
delete mode 100644 src/vbox/vbox_V3_0.c
delete mode 100644 src/vbox/vbox_V3_1.c
delete mode 100644 src/vbox/vbox_V3_2.c
--
2.9.3
7 years, 10 months
[libvirt] qemu-kvm blocked for more than 120 seconds when "libvirt-guests" is enabled
by Oscar Segarra
Hi,
I just have two virtual machines in my environment, I want them to
gracefully stop when host is powered off gracefully.
Nevertheless, system hangs on shutdown:
[root@vdicnode01 ~]# virsh list
Id Name State
----------------------------------------------------
1 vdicdb01 running
2 vdicone01 running
The configuration:
/usr/libexec/libvirt-guests.sh
URIS=default
ON_BOOT=ignore
ON_SHUTDOWN=shutdown
SHUTDOWN_TIMEOUT=60
PARALLEL_SHUTDOWN=5
START_DELAY=0
BYPASS_CACHE=0
CONNECT_RETRIES=10
RETRIES_SLEEP=1
SYNC_TIME=0
[root@vdicnode01 ~]# cat /etc/libvirt/qemu.conf
user = "oneadmin"
group = "oneadmin"
dynamic_ownership = 0
spice_tls = 0
With libvirt-guests service started:
[root@vdicnode01 ~]# service libvirt-guests status
Redirecting to /bin/systemctl status libvirt-guests.service
● libvirt-guests.service - Suspend Active Libvirt Guests
Loaded: loaded (/usr/lib/systemd/system/libvirt-guests.service;
disabled; vendor preset: disabled)
Active: active (exited) since Sat 2016-12-31 17:13:34 CET; 5s ago
Docs: man:libvirtd(8)
http://libvirt.org
Process: 6619 ExecStart=/usr/libexec/libvirt-guests.sh start
(code=exited, status=0/SUCCESS)
Main PID: 6619 (code=exited, status=0/SUCCESS)
Dec 31 17:13:34 vdicnode01.vdicube.com systemd[1]: Starting Suspend Active
Libvirt Guests...
Dec 31 17:13:34 vdicnode01.vdicube.com libvirt-guests.sh[6619]:
libvirt-guests is configured not to start any guests on boot
Dec 31 17:13:34 vdicnode01.vdicube.com systemd[1]: Started Suspend Active
Libvirt Guests.
[root@vdicnode01 ~]#
If I stop locally libvirt-guests (as root) Looks work perfectly:
[root@vdicnode01 ~]# virsh list
Id Name State
----------------------------------------------------
[root@vdicnode01 ~]#
--> Now I start again the virtual machines and the libvirt-guests service
<--
[root@vdicnode01 ~]# service libvirtd restart
Redirecting to /bin/systemctl restart libvirtd.service
[root@vdicnode01 ~]# service libvirt-guests start
Redirecting to /bin/systemctl start libvirt-guests.service
[root@vdicnode01 ~]# virsh list
Id Name State
----------------------------------------------------
1 vdicone01 running
2 vdicdb01 running
[root@vdicnode01 ~]#
But If I shutdown the host it look not work properly (I attack screenshots
of the shutdown process).
Any help will be welcome.
Thanks a lot.
7 years, 10 months
[libvirt] [PATCH 0/6] qemu: blockjob: make automatic disk locking less useless
by Peter Krempa
If automatic disk locking would be enabled with either lock manager the
operations would most probably fail. This was mostly as libvirt did not bother
to release images that were no longer written to by qemu, or tried re-lock
the same image.
This fixes the locking code for creation of external snapshots (both disk-only
and with memory), block copy and active block commit.
This series also kills the horrible "rollback" code in the external disk
snapshot code.
Regular block commit work will be tracked by:
https://bugzilla.redhat.com/show_bug.cgi?id=1405537
Peter Krempa (6):
qemu: blockcopy: Save monitor error prior to calling into lock manager
locking: Fix documentation on how automatic sanlock leases are stored
qemu: snapshot: Don't redetect backing chain after snapshot
qemu: snapshot: Refactor snapshot rollback on failure
qemu: snapshot: Properly handle image locking
qemu: blockjob: Fix locking of block copy/active block commit
src/locking/sanlock.conf | 2 +-
src/qemu/qemu_blockjob.c | 26 ++--
src/qemu/qemu_driver.c | 389 +++++++++++++++++++++++++++--------------------
3 files changed, 242 insertions(+), 175 deletions(-)
--
2.11.0
7 years, 10 months