[libvirt] [PATCH RFC 0/9] Introduce virPoolObj[Table]Ptr data/API's
by John Ferlan
Based of current top of git commit id '5620c6095'... I imagine things
will change while this is on-list, so if there is the desire to create
your own branch that's your starting point!
This is perhaps more than an RFC considering I've added comments
already (at least one reason why the insertions count is high). Still
it's not really complete and ready for prime time, but I figured I'd
put it out there for feedback.
Essentially I've tried to follow the domainobj 'model' by creating
an API to manage the "objects" various drivers have the need to manage.
Currently there are 4 drivers using linked lists of some sort and 4
using hash tables in some manner. This implementation modifies the
linked list abusers to use a common hash table.
The common hash table will have uuid/name accessors. The preference
remains uuid for uniqueness, but there are a couple of tables (node
device, nwfilter) that don't have a uuid and thus name is unique
enough for them.
The genesis for this was recent patches to the storage driver that
were essentially copying many lines of code and just changing the
names to do the same thing. As I looked deeper at that - I found
a mish-mash of object management throughout the drivers, so this
is my attempt to unify that.
The "goal" is to have a common look and feel to the API's so there's
less thought over how a specific implementation does things. Each
trip into the driver and exit can be handled in a common manner
especially with respect to locks/refcnt's.
Since I was splitting things apart - I also split out the object
code/data *_conf.{c,h} into separate vir*obj.{c,h} files. I took
some liberties with adjusting some names, modifying some other things
along the way since the type A personality took over to try and
follow more current coding conventions while I was in the middle
of changing things.
While the ultimate goal is to finish with the domain code - that's
just too busy in order to make adjustments right now. Still at least
that code does use a similar hash table model - so while it will be
painful - it can be done later if/when this is accepted (and perhaps
when we know there's a slow period for posting changes).
John Ferlan (9):
conf: Modify gendispatch.pl to make ACL argument opaque
conf: Introduce virPoolObj and virPoolTableObj and PoolObj API's
nodedev: Convert virNodeDevObj[List] to use virPoolObj[Table]
interface: Convert virInterfaceObj[List] to use virPoolObj[Table]
nwfilter: Convert virNWFilterObj[List] to use virPoolObj[Table]
secret: Convert virSecretObj[List] to use virPoolObj[Table]
volume: Convert virStorageVolObj[List] to use virPoolObj[Table]
storage: Convert virStoragePoolObj[List] to use virPoolObj[Table]
network: Convert virNetworkObj[List] to use virPoolObj[Table]
include/libvirt/virterror.h | 1 +
po/POTFILES.in | 5 +
src/Makefile.am | 18 +-
src/conf/domain_conf.h | 3 +-
src/conf/interface_conf.c | 170 +--
src/conf/interface_conf.h | 47 +-
src/conf/network_conf.c | 1308 +-----------------
src/conf/network_conf.h | 133 +-
src/conf/node_device_conf.c | 497 +------
src/conf/node_device_conf.h | 86 +-
src/conf/nwfilter_conf.c | 381 +-----
src/conf/nwfilter_conf.h | 69 +-
src/conf/secret_conf.c | 3 +-
src/conf/secret_conf.h | 2 +-
src/conf/storage_conf.c | 925 +------------
src/conf/storage_conf.h | 128 +-
src/conf/virinterfaceobj.c | 205 +++
src/conf/virinterfaceobj.h | 46 +
src/conf/virnetworkobj.c | 1166 ++++++++++++++++
src/conf/virnetworkobj.h | 121 ++
src/conf/virnodedeviceobj.c | 570 ++++++++
src/conf/virnodedeviceobj.h | 86 ++
src/conf/virnwfilterobj.c | 373 +++++
src/conf/virnwfilterobj.h | 64 +
src/conf/virpoolobj.c | 1184 ++++++++++++++++
src/conf/virpoolobj.h | 222 +++
src/conf/virsecretobj.c | 782 ++++-------
src/conf/virsecretobj.h | 92 +-
src/conf/virstorageobj.c | 1206 +++++++++++++++++
src/conf/virstorageobj.h | 143 ++
src/interface/interface_backend_netcf.c | 6 +-
src/interface/interface_backend_udev.c | 5 +-
src/libvirt_private.syms | 217 +--
src/network/bridge_driver.c | 1812 +++++++++++++------------
src/network/bridge_driver.h | 11 +-
src/network/bridge_driver_platform.h | 3 +-
src/node_device/node_device_driver.c | 388 +++---
src/node_device/node_device_driver.h | 2 +-
src/node_device/node_device_hal.c | 82 +-
src/node_device/node_device_udev.c | 76 +-
src/nwfilter/nwfilter_driver.c | 225 ++-
src/nwfilter/nwfilter_gentech_driver.c | 111 +-
src/nwfilter/nwfilter_gentech_driver.h | 2 +-
src/nwfilter/nwfilter_tech_driver.h | 2 +-
src/rpc/gendispatch.pl | 5 +-
src/secret/secret_driver.c | 187 +--
src/storage/storage_backend.h | 32 +-
src/storage/storage_backend_disk.c | 309 +++--
src/storage/storage_backend_fs.c | 145 +-
src/storage/storage_backend_gluster.c | 52 +-
src/storage/storage_backend_iscsi.c | 65 +-
src/storage/storage_backend_logical.c | 177 +--
src/storage/storage_backend_mpath.c | 37 +-
src/storage/storage_backend_rbd.c | 115 +-
src/storage/storage_backend_scsi.c | 57 +-
src/storage/storage_backend_sheepdog.c | 89 +-
src/storage/storage_backend_vstorage.c | 47 +-
src/storage/storage_backend_zfs.c | 109 +-
src/storage/storage_driver.c | 1952 +++++++++++++-------------
src/storage/storage_driver.h | 6 +-
src/storage/storage_util.c | 234 ++--
src/storage/storage_util.h | 31 +-
src/test/test_driver.c | 2257 ++++++++++++++-----------------
src/util/virerror.c | 1 +
tests/networkxml2conftest.c | 18 +-
tests/storagevolxml2argvtest.c | 16 +-
66 files changed, 10145 insertions(+), 8774 deletions(-)
create mode 100644 src/conf/virinterfaceobj.c
create mode 100644 src/conf/virinterfaceobj.h
create mode 100644 src/conf/virnetworkobj.c
create mode 100644 src/conf/virnetworkobj.h
create mode 100644 src/conf/virnodedeviceobj.c
create mode 100644 src/conf/virnodedeviceobj.h
create mode 100644 src/conf/virnwfilterobj.c
create mode 100644 src/conf/virnwfilterobj.h
create mode 100644 src/conf/virpoolobj.c
create mode 100644 src/conf/virpoolobj.h
create mode 100644 src/conf/virstorageobj.c
create mode 100644 src/conf/virstorageobj.h
--
2.7.4
7 years, 9 months
[libvirt] [PATCH] testNodeDeviceMockCreateVport: Don't call public APIs
by Michal Privoznik
This function is calling public APIs (virNodeDeviceLookupByName
etc.). That requires the driver lock to be unlocked and locked
again. If we, however, replace the public APIs calls with the
internal calls (that public APIs call anyway), we can drop the
lock/unlock exercise.
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
src/test/test_driver.c | 59 ++++++++++++++++++++++++++++----------------------
1 file changed, 33 insertions(+), 26 deletions(-)
diff --git a/src/test/test_driver.c b/src/test/test_driver.c
index 5fef3f10b..8495443db 100644
--- a/src/test/test_driver.c
+++ b/src/test/test_driver.c
@@ -5626,17 +5626,16 @@ testNodeDeviceListCaps(virNodeDevicePtr dev, char **const names, int maxnames)
}
-static virNodeDeviceDefPtr
+static virNodeDeviceObjPtr
testNodeDeviceMockCreateVport(virConnectPtr conn,
const char *wwnn,
const char *wwpn)
{
testDriverPtr driver = conn->privateData;
- virNodeDevicePtr devcpy = NULL;
char *xml = NULL;
virNodeDeviceDefPtr def = NULL;
virNodeDevCapsDefPtr caps;
- virNodeDeviceObjPtr obj = NULL;
+ virNodeDeviceObjPtr obj = NULL, objcopy = NULL;
virObjectEventPtr event = NULL;
/* In the real code, we'd call virVHBAManageVport which would take the
@@ -5648,9 +5647,15 @@ testNodeDeviceMockCreateVport(virConnectPtr conn,
* using the scsi_host11 definition, changing the name and the
* scsi_host capability fields before calling virNodeDeviceAssignDef
* to add the def to the node device objects list. */
- if (!(devcpy = virNodeDeviceLookupByName(conn, "scsi_host11")) ||
- !(xml = virNodeDeviceGetXMLDesc(devcpy, 0)) ||
- !(def = virNodeDeviceDefParseString(xml, EXISTING_DEVICE, NULL)))
+ if (!(objcopy = virNodeDeviceFindByName(&driver->devs, "scsi_host11")))
+ goto cleanup;
+
+ xml = virNodeDeviceDefFormat(objcopy->def);
+ virNodeDeviceObjUnlock(objcopy);
+ if (!xml)
+ goto cleanup;
+
+ if (!(def = virNodeDeviceDefParseString(xml, EXISTING_DEVICE, NULL)))
goto cleanup;
VIR_FREE(def->name);
@@ -5684,23 +5689,17 @@ testNodeDeviceMockCreateVport(virConnectPtr conn,
if (!(obj = virNodeDeviceAssignDef(&driver->devs, def)))
goto cleanup;
- virNodeDeviceObjUnlock(obj);
+ def = NULL;
- event = virNodeDeviceEventLifecycleNew(def->name,
+ event = virNodeDeviceEventLifecycleNew(obj->def->name,
VIR_NODE_DEVICE_EVENT_CREATED,
0);
testObjectEventQueue(driver, event);
cleanup:
VIR_FREE(xml);
- if (!obj) {
- virNodeDeviceDefFree(def);
- def = NULL;
- }
- if (devcpy)
- virNodeDeviceFree(devcpy);
-
- return def;
+ virNodeDeviceDefFree(def);
+ return obj;
}
@@ -5712,8 +5711,8 @@ testNodeDeviceCreateXML(virConnectPtr conn,
testDriverPtr driver = conn->privateData;
virNodeDeviceDefPtr def = NULL;
char *wwnn = NULL, *wwpn = NULL;
- virNodeDevicePtr dev = NULL;
- virNodeDeviceDefPtr newdef = NULL;
+ virNodeDevicePtr dev = NULL, ret = NULL;
+ virNodeDeviceObjPtr obj = NULL;
virCheckFlags(0, NULL);
@@ -5739,20 +5738,28 @@ testNodeDeviceCreateXML(virConnectPtr conn,
* mocking udev. The mock routine will copy an existing vHBA and
* rename a few fields to mock that. So in order to allow that to
* work properly, we need to drop our lock */
- testDriverUnlock(driver);
- if ((newdef = testNodeDeviceMockCreateVport(conn, wwnn, wwpn))) {
- if ((dev = virNodeDeviceLookupByName(conn, newdef->name)))
- ignore_value(VIR_STRDUP(dev->parent, def->parent));
- }
- testDriverLock(driver);
- newdef = NULL;
+ if (!(obj = testNodeDeviceMockCreateVport(conn, wwnn, wwpn)))
+ goto cleanup;
+
+ if (!(dev = virGetNodeDevice(conn, obj->def->name)))
+ goto cleanup;
+
+ VIR_FREE(dev->parent);
+ if (VIR_STRDUP(dev->parent, def->parent) < 0)
+ goto cleanup;
+
+ ret = dev;
+ dev = NULL;
cleanup:
+ if (obj)
+ virNodeDeviceObjUnlock(obj);
testDriverUnlock(driver);
virNodeDeviceDefFree(def);
+ virObjectUnref(dev);
VIR_FREE(wwnn);
VIR_FREE(wwpn);
- return dev;
+ return ret;
}
static int
--
2.11.0
7 years, 9 months
[libvirt] A question for external snapshots with flag“VIR_DOMAIN_SNAPSHOT_CREATE_QUIESCE”
by lizhengui
Hello, I got a question here. When we create consistent active external snapshots with flag “VIR_DOMAIN_SNAPSHOT_CREATE_QUIESCE” , the qemuDomainSnapshotFSFreeze will be called firstly to freeze all filesystems in vm, and then create snapshots. For windows vm, freezing filesystems used by vss service. If IO pressure in vm is too big or internal error happened in vss , freezing filesytems will failed , and qemuDomainSnapshotFSFreeze returns 0 which meaning that no filesystems are frozen. In the function qemuDomainSnapshotCreateActiveExternal, libvirt creates external snapshots all the same in such a situation that qemuDomainSnapshotFSFreeze returns 0, but the created snapshots are not consistent snapshots in such a situation . So shouldn't we abandon creating snapshots and goto cleanup in the situation that qemuDomainSnapshotFSFreeze returns 0?
The code below:
static int
qemuDomainSnapshotCreateActiveExternal(virConnectPtr conn,
virQEMUDriverPtr driver,
virDomainObjPtr vm,
virDomainSnapshotObjPtr snap,
unsigned int flags)
{
virObjectEventPtr event;
bool resume = false;
int ret = -1;
qemuDomainObjPrivatePtr priv = vm->privateData;
char *xml = NULL;
bool memory = snap->def->memory == VIR_DOMAIN_SNAPSHOT_LOCATION_EXTERNAL;
bool memory_unlink = false;
bool atomic = !!(flags & VIR_DOMAIN_SNAPSHOT_CREATE_ATOMIC);
bool transaction = virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_TRANSACTION);
int thaw = 0; /* 1 if freeze succeeded, -1 if freeze failed */
bool pmsuspended = false;
virQEMUDriverConfigPtr cfg = NULL;
int compressed;
char *compressedpath = NULL;
/* If quiesce was requested, then issue a freeze command, and a
* counterpart thaw command when it is actually sent to agent.
* The command will fail if the guest is paused or the guest agent
* is not running, or is already quiesced. */
if (flags & VIR_DOMAIN_SNAPSHOT_CREATE_QUIESCE) {
int freeze = qemuDomainSnapshotFSFreeze(driver, vm, NULL, 0);
if (freeze < 0) {
/* the helper reported the error */
if (freeze == -2)
thaw = -1; /* the command is sent but agent failed */
goto cleanup;
}
thaw = 1;
}
......
......
7 years, 9 months
[libvirt] ANNOUNCE: libguestfs 1.36 released
by Richard W.M. Jones
I'm please to announce libguestfs 1.36, a library and a set of tools
for accessing and modifying virtual machine disk images.
This release represents about 7 months of work by many contributors.
I'd like to call out in particular substantial code contributions
from: Pino Toscano, Tomáš Golembiovský, Cédric Bosdonnat, Roman Kagan,
Dawid Zamirski and Matteo Cafasso. Also our testing team: Tingting
Zheng, Xiang Hua Chen, Ming Xie, Junquin Zhou and Xiaodai Wang.
Amongst the new features are substantial enhancements to virt-v2v
including support for Debian and Ubuntu guest conversions, and
conversions from AWS; a new "virt-tail" command for following log
files in guests; even more support for encrypted guests; robustness
when handling Windows guests with corrupted registries; ExFAT support;
GCC 7 support; and considerable internal code refactoring to make
things more maintainable.
Of course dozens of other features have been added, and many bugs
fixed. See the release notes below for full details.
You can get libguestfs 1.36 from here:
Main website: http://libguestfs.org/
Source: http://libguestfs.org/download/1.36-stable/
Fedora: https://koji.fedoraproject.org/koji/packageinfo?packageID=8391
Debian/experimental: https://packages.debian.org/libguestfs0
Note for distro packagers: libmagic (part of the 'file' command line
tool) is now a required build dependency. It was previously optional.
Rich.
----------------------------------------------------------------------
Release notes for libguestfs 1.36
These are also available online at:
http://libguestfs.org/guestfs-release-notes.1.html
New features
New tools
Virt-tail is a new tool for following (tailing) log files within a
guest, similar to the regular "tail -f" command.
New features in existing tools
Virt-customize, virt-get-kernel, virt-sparsify and virt-sysprep can now
handle encrypted guests (Pino Toscano).
Virt-builder and virt-customize now support --append-line, which is
useful for adding lines to the end of configuration files.
Virt-resize can now shrink and expand swap partitions (Pino Toscano).
Virt-resize can now output to non-local disks (Pino Toscano).
Virt-sysprep has a new operation called "backup-files" for removing
editor backups, and "passwd-backups" for removing /etc/passwd- and
similar.
Virt-dib can now create checksums using the new --checksum option (Pino
Toscano).
Virt-dib can now create tgz files. In addition, extended attributes
and SELinux labels are preserved in the output tar file (Pino Toscano).
Virt-dib can now create squashfs files (Pino Toscano).
Bash tab-completion is now available in every command line tool that is
shipped.
virt-v2v and virt-p2v
Conversions of Debian (6+) and Ubuntu (10.04+) guests are now supported
(Tomáš Golembiovský, Pino Toscano).
Conversions from SUSE Xen hypervisor have now been tested (Cédric
Bosdonnat).
Windows conversions may now install a program "pnp_wait.exe" which
prevents conflicts between the Windows Plug-and-Play Manager and our
own scripts that install virtio device drivers. Enabling this requires
the "pnp_wait.exe" program to be built separately (Roman Kagan).
OVA files exported from AWS can now be converted (Shahar Havivi).
When converting OVA files, in some circumstances virt-v2v can now read
disk images directly from the OVA input file instead of needing to
unpack the OVA file to a temporary directory. This can save large
amounts of disk space, and is quicker (Tomáš Golembiovský).
Virt-p2v can now be built on RHEL 5 (2007-era) Linux and RHEL 6, which
means that 32 bit and hardware with ancient fakeraid disks can be
virtualized. Binaries of virt-p2v based on these old versions of RHEL
can be found at http://oirase.annexia.org/virt-p2v/
Virt-p2v can now use nbdkit (an NBD server) as an alternative to qemu-
nbd. In addition, virt-p2v can use "socket activation" which is a more
robust method for opening the NBD listening socket. Socket activation
works with qemu-nbd or nbdkit, but requires the most up to date
versions.
To prevent timeouts during P2V conversions, virt-p2v inhibits power
saving on the physical machine, and also sends ping packets over the
ssh control and data connections.
Virt-v2v no longer removes the "Processor" and "Intelppm" nodes from
the Windows Registry.
Xen and vCenter conversions can now be done using the libvirt backend,
provided libvirt ≥ 2.1.0 is used.
/dev/srX (SCSI CD-ROM) devices are ignored (Tomáš Golembiovský).
When converting SUSE Linux guests, use /etc/modprobe.conf.local if it
exists.
Removing VMware tools from Linux guests should now work reliably (Pino
Toscano).
When converting OVA files, virt-v2v now checks the disk image hash
contained in the manifest file, whereas previously it was ignored
because of a mistake in the code. In addition, SHA256 hashes are now
supported (Tomáš Golembiovský).
When converting OVA files that contain compressed disk images, we now
trust the "ovf:compression" attribute from the metadata instead of
using content sniffing on the disk image (Tomáš Golembiovský).
A new flag --vdsm-compat has been added to -o vdsm mode, allowing more
efficient qcow2 images to be generated.
Since the RHEV product [commercially supported version of oVirt] has
now been renamed to RHV, "RHEV" was changed to "RHV" throughout the
tooling. In particular, -o rhev becomes -o rhv, although the old name
can be used for backwards compatibility.
The "RHEV-APT" utility is only installed when the output hypervisor is
oVirt or RHV.
A problem with virt-v2v running out of memory when doing an SELinux
relabel of the guest filesystem should now be resolved.
Language bindings
Setting "EXTRA_JAVAC_FLAGS" before ./configure allows you to add
arbitrary flags to "javac" when compiling the Java bindings.
Use of any libguestfs API which returned a single struct, from Perl or
Java bindings, would have leaked memory. This has now been fixed (Pino
Toscano).
Inspection
Inspection of Windows guests with mildly corrupted Windows Registry
hives should now work instead of failing with an error. This feature
requires hivex ≥ 1.3.14 (Dawid Zamirski).
For Debian guests, we can now read the URL, source name, summary and
full description of installed packages. For RPM-based guests we can
read the URL, summary and description (Pino Toscano).
Inspection of guest operating systems that use a separate /usr
partition should now work more reliably (Pino Toscano).
When parsing guest /etc/fstab, paths are reduced to a canonical form
(eg. "///usr//local//" → "/usr/local").
Inspection of btrfs subvolumes now works where the /etc/fstab options
field contains commas.
/dev/cdN devices in guest /etc/fstab are ignored (Pino Toscano).
Architectures and platforms
Stable releases are now tested on aarch64, ppc64 and ppc64le
architectures.
The RISC-V architecture is now handled as a guest, and libguestfs will
now at least compile on RISC-V (but probably not work as there is no
usable qemu at the time of writing).
Detection of S/390 and S/390x binaries and guests is now supported.
Other
ExFAT filesystems are now supported (Miles Wolbe).
Security
See also guestfs-security(1).
There were no CVEs reported in this development cycle. However some
security-related hardening was carried out as described below.
Temporary filenames are now always generated using randomness from
/dev/urandom (previously the C function random(3) was used in one
case).
The $TERM environment variable is now validated before passing it
through to the appliance kernel command line.
API
New APIs
"guestfs_aug_transform"
Exposes the Augeas "aug_transform" API (Pino Toscano).
"guestfs_find_inode"
Find files by inode number (Matteo Cafasso).
"guestfs_inspect_get_windows_software_hive"
"guestfs_inspect_get_windows_system_hive"
Return the path to the Windows "HKLM\SYSTEM" and "HKLM\SOFTWARE"
hives computed during inspection.
"guestfs_mksquashfs"
Create a squashfs filesystem from a path (Pino Toscano).
Other API changes
"guestfs_add_domain"
This call now handles libvirt file-based volumes correctly, where
previously these would have been ignored. Also handled are disks
which require libvirt authentication secrets to open (Pino
Toscano).
"guestfs_canonical_device_name"
This call will no longer incorrectly modify Linux software RAID
device names (like /dev/mdX).
"guestfs_file_architecture"
Previously the "file_architecture" API could return either of the
strings "i386" or "i486" for 32 bit x86 binaries. It now only
returns "i386" (as documented).
This API can now return the following new values: "riscv32",
"riscv64", "riscv128", "s390", "s390x".
"guestfs_hivex_open"
This now has an optional "GUESTFS_HIVEX_OPEN_UNSAFE" flag which
allows certain corrupted Windows Registry hives to be opened. This
feature requires hivex ≥ 1.3.14 (Dawid Zamirski).
"guestfs_list_partitions"
This call now returns Linux software RAID partitions.
"guestfs_part_to_dev"
This call now correctly handles partition names which include
"p<N>" (Pino Toscano).
"guestfs_set_label"
This call can now change the labels of swap partitions (Pino
Toscano).
Build changes
libmagic, the library part of the "file" command, is now required at
build time (previously optional).
GCC 7 is now supported.
"Silent rules" are now used for OCaml programs, Java bindings. To show
the full command line executed, add "V=1" on the make command line
(Pino Toscano).
Slow testing ("make check-slow") now covers: firstboot scripts in Linux
guests; v2v conversion of a selection of real Linux guests; the virt-
customize --hostname and --timezone settings; the --root-password
parameter; that the serial console works in virt-builder guests.
Large generated C source files, eg. the list of commands found in
fish/cmds.c (and many more), have been split into smaller files to
speed parallel compilation.
"make maintainer-check-extra-dist" now checks that all generated files
are included in the tarball.
The tests no longer assume that "." is in Perl's @INC, as it is going
to be removed soon (Pino Toscano).
Debian hosts using UsrMerge are now supported (Pino Toscano).
Header files and C structs can now have internal documentation using
the special "/** ... */" comments.
"@VAR@" subtitutions in "./run" are now fully quoted. This is
necessary so that (eg) "./configure PYTHON=/some/path" works robustly
if "/some/path" contains characters that need to be quoted (Hilko
Bengen).
gperf ≥ 3.1 is now supported.
Kraxel's old edk2 builds can no longer be used for UEFI support. UEFI
code is now fully free software, so use the versions bundled with your
Linux distro instead.
Virt-p2v can now be compiled on RHEL 5 (2007-era) Linux with Gtk 2.10.
Internals
The generator and mllib "Common_utils" modules are now shared from the
same source file.
A considerable amount of common code has been moved into the common
directory in the source and is now compiled only once. The mini-
libraries located under here are: common/edit, common/errnostring,
common/miniexpect, common/options, common/parallel, common/progress,
common/protocol, common/utils, common/visit, common/windows.
The directory containing the main library code has moved from src →
lib.
All tests written in shell script now use a common file of utility
functions (tests/test-functions.sh). There are several new utility
functions, mainly for skipping tests. Also these test scripts can now
use autoconf-like path variables like $abs_top_srcdir.
UEFI paths are now stored in the generator (generator/uefi.ml).
The way the generator handles actions and procedure numbers was changed
quite substantially. See generator/actions_*.ml and
generator/proc_nr.ml.
The gnulib "getprogname" module is now used everywhere when
needing/printing the program name (Pino Toscano).
perl/Guestfs.c is not translatable (Nikos Skalkotos).
Virt-builder templates moved from builder/website to builder/templates
and there is now a single unified program which can build any template.
All Windows registry utilities used by virt-customize and virt-v2v have
been moved to a common module called "Registry" under mllib.
All POSIX bindings have been moved to a new module called "Unix_utils"
under mllib.
Inspection, virt-customize and virt-v2v no longer recompute the Windows
"%systemroot%", "CurrentControlSet" or paths to the "HKLM\SYSTEM" and
"HKLM\SOFTWARE" hives in multiple places. Instead these are all
computed once (during inspection) and passed to the other tools through
various "guestfs_inspect_get_windows_*" APIs.
"/dev/pts" is now available inside the appliance, so any tools we run
which require a pty will now work (Pino Toscano).
Most OCaml warnings have been fixed.
There is now a single common function for creating temporary files
("guestfs_int_make_temp_path") (Matteo Cafasso).
The $TERM environment variable is now validated before passing it
through to the appliance kernel command line.
Useless USB and memballoon devices are no longer created in the
appliance (Laine Stump).
On aarch64 we now use virtio-pci for the appliance. This is somewhat
faster than virtio-mmio.
Use of srandom(3) and random(3) has been minimized. In particular,
temporary filenames are no longer created based on randomness returned
by random(3), but /dev/urandom is used instead.
Bugs fixed
https://bugzilla.redhat.com/1425306
typo error in virt-tail man page
https://bugzilla.redhat.com/1418283
virt-v2v: appliance runs out of memory running setfiles command
https://bugzilla.redhat.com/1417549
/usr/bin/x86_64-linux-gnu-ld.bfd.real:
../common/progress/.libs/libprogress.a(libprogress_la-progress.o):
undefined reference to symbol 'UP@(a)NCURSES_TINFO_5.0.19991023'
https://bugzilla.redhat.com/1417444
*** No rule to make target '../perl/lib/Sys/Guestfs.c', needed by
'libguestfs.pot'
https://bugzilla.redhat.com/1416941
compile of 1.34.3 fails with gperf 3.1
https://bugzilla.redhat.com/1414682
guestfs_canonical_device_name incorrectly returns /dev/sd0 for MD
devices (/dev/md0)
https://bugzilla.redhat.com/1414510
guestfs_list_filesystems does not recognize ddf partitions
https://bugzilla.redhat.com/1409023
[Debian] ldmtool not installed in the appliance
https://bugzilla.redhat.com/1404287
qemu-kvm cannot boot RHEL 7 kernel with TCG, hangs at "Probing EDD
(edd=off to disable)..."
https://bugzilla.redhat.com/1404182
RFE: virt-resize should support a URL as the outdisk
https://bugzilla.redhat.com/1401474
Importing VMs from VMware is failing with error "Inspection field
'i_arch' was 'unknown'"
https://bugzilla.redhat.com/1401320
RFE: Increate virt-sysprep coverage a bit
https://bugzilla.redhat.com/1400205
Add --vdsm-compat=1.1 flag for VDSM
https://bugzilla.redhat.com/1398070
typo error in man page
https://bugzilla.redhat.com/1392798
secrets from libvirt domains are not read
https://bugzilla.redhat.com/1390876
"--machine-readable" info should be updated in virt-v2v manual page
https://bugzilla.redhat.com/1379289
RFE: virt-p2v should support mnemonic operations
https://bugzilla.redhat.com/1378022
There is virt-v2v warning about <listen type='none'> during
converting a guest which has listen type='none' in XML
https://bugzilla.redhat.com/1377081
virt-p2v manual should update the new dialog information
https://bugzilla.redhat.com/1375157
virt-v2v: -i ova: Permission denied when using libvirt and running
as root
https://bugzilla.redhat.com/1374651
Can't install qxl driver for display device in win7 guest after
converting to glance by virt-v2v
https://bugzilla.redhat.com/1374405
There is HTTP 404 error info when convert guest to glance by
virt-v2v
https://bugzilla.redhat.com/1374232
selinux relabel fails on RHEL 6.2 guests with "libguestfs error:
selinux_relabel: : Success"
https://bugzilla.redhat.com/1372668
Process status is not normal in windows guest after converted from
kvm to rhev by virt-v2v
https://bugzilla.redhat.com/1372269
Builder does not set hostname properly for Debian 8 (Jessie)
https://bugzilla.redhat.com/1371843
Improve OVA import compatibility
https://bugzilla.redhat.com/1370424
virt-manager coredump when vm with gluster image exists
https://bugzilla.redhat.com/1367839
Cannot import VMs from Xen and VMware when using RHEL7.3 host.
https://bugzilla.redhat.com/1367738
Missing bash completion scripts for: virt-diff guestunmount virt-
copy-in virt-copy-out virt-customize virt-get-kernel
virt-p2v-make-disk virt-p2v-make-kickstart virt-tar-in virt-tar-out
virt-v2v-copy-to-local virt-win-reg
https://bugzilla.redhat.com/1367615
OVMF file which is built for rhel7.3 can't be used for virt-v2v
uefi conversion
https://bugzilla.redhat.com/1366456
Converting rhel7 host installed on RAID:warning: fstrim: fstrim:
/sysroot/: the discard operation is not supported
https://bugzilla.redhat.com/1366049
RFE: libvirt backend: support handling disks stored as volume name
in a pool
https://bugzilla.redhat.com/1365005
Guest name is incorrect if convert guest from disk image by
virt-v2v
https://bugzilla.redhat.com/1362649
RFE: virt-sysprep does not utilize libguestfs encryption support
https://bugzilla.redhat.com/1354507
virt-v2v conversions from vCenter do not consistently obey the
proxy environment variables
https://bugzilla.redhat.com/1168144
warning: fstrim: fstrim: /sysroot/: FITRIM ioctl failed: Operation
not supported (ignored) when convert win2003 guest from xen server
https://bugzilla.redhat.com/1161019
RFE: Only install RHEV-APT if virt-v2v -o rhev/-o vdsm option is
used
https://bugzilla.redhat.com/1152369
virt-v2v failed to convert RHEL 6.7 UEFI guest: no
grub1/grub-legacy or grub2 configuration file was found
https://bugzilla.redhat.com/1141631
[RFE] virt-v2v should support convert a guest to a dir-pool with
using pool's uuid
https://bugzilla.redhat.com/1134878
libvirt reports json "backing file" is missing
https://bugzilla.redhat.com/1019388
firstboot scripts (virt-builder, virt-sysprep) don't work for
Debian 6 & 7 guests
https://bugzilla.redhat.com/737600
virt-v2v windows xp - machine dies BSOD - processr,sys - workaround
provided
--
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
Fedora Windows cross-compiler. Compile Windows programs, test, and
build Windows installers. Over 100 libraries supported.
http://fedoraproject.org/wiki/MinGW
7 years, 9 months
[libvirt] [PATCH] qemuDomainAttachNetDevice: Support attach of type="user"
by Michal Privoznik
https://bugzilla.redhat.com/show_bug.cgi?id=1420668
This has worked in previous releases.
My commit c266b60440 broke it.
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
src/qemu/qemu_hotplug.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
index 97fb272f6..0c0885695 100644
--- a/src/qemu/qemu_hotplug.c
+++ b/src/qemu/qemu_hotplug.c
@@ -1104,6 +1104,9 @@ qemuDomainAttachNetDevice(virQEMUDriverPtr driver,
break;
case VIR_DOMAIN_NET_TYPE_USER:
+ /* No preparation needed. */
+ break;
+
case VIR_DOMAIN_NET_TYPE_SERVER:
case VIR_DOMAIN_NET_TYPE_CLIENT:
case VIR_DOMAIN_NET_TYPE_MCAST:
--
2.11.0
7 years, 9 months
[libvirt] A question for external snapshots with flag“VIR_DOMAIN_SNAPSHOT_CREATE_QUIESCE”
by WangJie (Captain)
Hello, I got a question here. When we create consistent active external snapshots with flag “VIR_DOMAIN_SNAPSHOT_CREATE_QUIESCE” , the qemuDomainSnapshotFSFreeze will be called firstly to freeze all filesystems in vm, and then create snapshots. For windows vm, freezing filesystems used by vss service. If IO pressure in vm is too big or internal error happened in vss , freezing filesytems will failed , and qemuDomainSnapshotFSFreeze returns 0 which meaning that no filesystems are frozen. In the function qemuDomainSnapshotCreateActiveExternal, libvirt creates external snapshots all the same in such a situation that qemuDomainSnapshotFSFreeze returns 0, but the created snapshots are not consistent snapshots in such a situation . So shouldn't we abandon creating snapshots and goto cleanup in the situation that qemuDomainSnapshotFSFreeze returns 0?
The code below:
static int
qemuDomainSnapshotCreateActiveExternal(virConnectPtr conn,
virQEMUDriverPtr driver,
virDomainObjPtr vm,
virDomainSnapshotObjPtr snap,
unsigned int flags)
{
virObjectEventPtr event;
bool resume = false;
int ret = -1;
qemuDomainObjPrivatePtr priv = vm->privateData;
char *xml = NULL;
bool memory = snap->def->memory == VIR_DOMAIN_SNAPSHOT_LOCATION_EXTERNAL;
bool memory_unlink = false;
bool atomic = !!(flags & VIR_DOMAIN_SNAPSHOT_CREATE_ATOMIC);
bool transaction = virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_TRANSACTION);
int thaw = 0; /* 1 if freeze succeeded, -1 if freeze failed */
bool pmsuspended = false;
virQEMUDriverConfigPtr cfg = NULL;
int compressed;
char *compressedpath = NULL;
/* If quiesce was requested, then issue a freeze command, and a
* counterpart thaw command when it is actually sent to agent.
* The command will fail if the guest is paused or the guest agent
* is not running, or is already quiesced. */
if (flags & VIR_DOMAIN_SNAPSHOT_CREATE_QUIESCE) {
int freeze = qemuDomainSnapshotFSFreeze(driver, vm, NULL, 0);
if (freeze < 0) {
/* the helper reported the error */
if (freeze == -2)
thaw = -1; /* the command is sent but agent failed */
goto cleanup;
}
thaw = 1;
}
......
......
7 years, 9 months
[libvirt] [PATCH 0/4] Cache systemd presence
by Ján Tomko
Reduce the number of DBus calls required, and possibly
the number of timeouts.
Ján Tomko (4):
Unify checking for machine1 systemd service
Use macros for testing virSystemd APIs
Cache the presence of machine1 service
Test virSystemd APIs twice to check the cache effects
src/libvirt_private.syms | 1 +
src/util/virsystemd.c | 55 +++++++++++++++++++++++++++++++++++------------
src/util/virsystemdpriv.h | 33 ++++++++++++++++++++++++++++
tests/virsystemdtest.c | 40 ++++++++++++++++++----------------
4 files changed, 96 insertions(+), 33 deletions(-)
create mode 100644 src/util/virsystemdpriv.h
--
2.10.2
7 years, 9 months
[libvirt] [PATCH 0/8] Converge Storage Pool vHBA logic with Node Device
by John Ferlan
Similar to the recent node device focused vHBA patches, but these focus
more on adjustments to the Storage Pool vHBA logic and finally the mechanism
to define a vHBA for a domain.
The first patch fixes a leak found by coverity that showed up because
node_device_conf had enough changes so that coverity looked harder...
The second patch creates a mechanism to mock creation of the vHBA in
order to test the ability for the storage pool to create a vHBA. As
much as I dislike forward refs for testNodeDeviceMockCreateVport, it
was better than moving all the code....
The third patch extracts out storage device mgmt into it's own set of
src/util API's - similar to the existing virstoragefile, but for devices.
The fourth patch was uncovered while moving code from storage_backend_scsi
into node_device_conf (the fifth patch)...
The fifth patch moves the createVport/deleteVport guts into the
node_device_conf (although they could have moved to virvhba)...
The sixth patch alters the logic to use the node_device API's as the
"preferred" mechanism to create/delete the vport...
The seventh patch tests the storage pool vHBA creation algorithms.
The eigth patch is the reason for all this stirring of the pot. Alter
the domain <controller> XML in order to allow definition of a vHBA which
more or less sits between a "scsi_hostX" host device and a controller. This
is in preparation for https://bugzilla.redhat.com/show_bug.cgi?id=1404962
which can take that created vHBA and automagically add the LUNs from the
vHBA to the domain although that requires a bit more magic for which there
are already onlist patches to let qemu driver know when a node device has
been added/removed. Once all that's in place - the next step will be to
converge the two sets of patches. It's a chicken/egg type problem - one
has to exist before the other can truly work.
John Ferlan (8):
conf: Fix leak in virNodeDeviceDefParseXML
tests: Add createVHBAByStoragePool-by-parent to fchosttest
util: Convert virStoragePoolSourceAdapter to virStorageAdapter
util: Rename virFileWaitForDevices
storage: Move/rename createVport and deleteVport
util: Alter virNodeDevice{Create|Delete}Vport to use nodedev APIs
tests: Add more storage pool vHBA tests
conf: Add vHBA controller definition to domain
docs/schemas/basictypes.rng | 66 ++--
docs/schemas/domaincommon.rng | 12 +-
po/POTFILES.in | 1 +
src/Makefile.am | 1 +
src/conf/domain_audit.c | 32 ++
src/conf/domain_conf.c | 180 ++++++++++-
src/conf/domain_conf.h | 2 +
src/conf/node_device_conf.c | 342 ++++++++++++++++++++-
src/conf/node_device_conf.h | 9 +
src/conf/storage_conf.c | 338 +++++---------------
src/conf/storage_conf.h | 35 +--
src/libvirt_private.syms | 20 +-
src/libxl/libxl_conf.c | 1 +
src/node_device/node_device_driver.c | 2 +-
src/phyp/phyp_driver.c | 3 +-
src/qemu/qemu_alias.c | 5 +
src/qemu/qemu_command.c | 4 +
src/qemu/qemu_hotplug.c | 16 +
src/storage/storage_backend_disk.c | 6 +-
src/storage/storage_backend_iscsi.c | 2 +-
src/storage/storage_backend_logical.c | 4 +-
src/storage/storage_backend_mpath.c | 2 +-
src/storage/storage_backend_scsi.c | 267 +++-------------
src/storage/storage_util.c | 2 +-
src/test/test_driver.c | 101 +++++-
src/util/virfile.h | 2 -
src/util/virscsihost.c | 28 +-
src/util/virscsihost.h | 8 +-
src/util/virstoragedevice.c | 292 ++++++++++++++++++
src/util/virstoragedevice.h | 89 ++++++
src/util/virutil.c | 4 +-
src/util/virutil.h | 2 +
tests/fchosttest.c | 111 +++++++
.../qemuxml2argv-vhba-no-parent.xml | 38 +++
.../qemuxml2argv-vhba-parent-fabric.xml | 38 +++
.../qemuxml2argv-vhba-parent-name.xml | 38 +++
.../qemuxml2argv-vhba-parent-wwns.xml | 38 +++
.../qemuxml2xmlout-vhba-no-parent.xml | 47 +++
.../qemuxml2xmlout-vhba-parent-fabric.xml | 47 +++
.../qemuxml2xmlout-vhba-parent-name.xml | 47 +++
.../qemuxml2xmlout-vhba-parent-wwns.xml | 47 +++
tests/qemuxml2xmltest.c | 9 +
42 files changed, 1727 insertions(+), 611 deletions(-)
create mode 100644 src/util/virstoragedevice.c
create mode 100644 src/util/virstoragedevice.h
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-vhba-no-parent.xml
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-vhba-parent-fabric.xml
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-vhba-parent-name.xml
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-vhba-parent-wwns.xml
create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-vhba-no-parent.xml
create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-vhba-parent-fabric.xml
create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-vhba-parent-name.xml
create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-vhba-parent-wwns.xml
--
2.9.3
7 years, 9 months
[libvirt] [PATCH go v2] domain.go: wrong calculation of bitmask in PinVcpuFlags()
by Leonid Podolny
---
domain.go | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/domain.go b/domain.go
index 2bd9852..7276ef8 100644
--- a/domain.go
+++ b/domain.go
@@ -1768,7 +1768,7 @@ func (d *Domain) PinVcpuFlags(vcpu uint, cpuMap []bool, flags DomainModification
ccpumap := make([]C.uchar, maplen)
for i := 0; i < len(cpuMap); i++ {
if cpuMap[i] {
- byte := (i + 7) / 8
+ byte := i / 8
bit := i % 8
ccpumap[byte] |= (1 << uint(bit))
}
--
2.11.1
7 years, 9 months
Re: [libvirt] [Qemu-devel] Question regarding Snapshots
by Stefan Hajnoczi
On Wed, Feb 22, 2017 at 03:06:41PM -0600, Tim Cusack wrote:
> I have a scenario that perhaps not many have attempted, but I still hope
> that it is possible.
>
> Scenario:
>
> I would like to have a Base Windows 7 VM in KVM/QEMU.
>
> I would follow the following process (confirmed it works)
>
> 1. Shutdown running domain
> - virsh shutdown <Domain>
> 2. Remove existing disk from Domain XML:
> - virt-xml BASE --remove-device --disk target=hda
> 3. Add Correct Disk image for Snapshot to Domain XML:
> - virt-xml BASE --add-device --disk
> /var/lib/libvirt/images/BASE.qcow2,format=qcow2,target=hda,bus=ide
> 4. Create the snapshot with description
> - virsh snapshot-create-as BASE <Model>.qcow2 "OEM, Model" --disk-only
> --atomic
> 5. Start Snapshot
> - virsh start FA2BASE
This process uses libvirt instead of QEMU commands. Adding libvirt
mailing list.
>
> All that works, but my question and issue is this:
>
> Can you make a snapshot, then go back to the base and ignore that snapshot
> like a closed branch, make another snapshot, and then go back and forth
> from each to each?
>
> My reasons for needing this are that I have tools and software that doesnt
> play nice together, and would like to keep them separated on different
> snapshots, but never really need to have more than one up at a time.
>
> This would allow me to have only 1 windows license per computer, and the
> ability to just change from tool to tool with simple front end to virsh to
> remove the disk from the .xml and add the other one.
>
> So like this:
> Tool A is on snapshot A
> Tool B is on snapshot B
> go through steps 1-5 above to go back and forth.
>
> I know that I can not merge things back into the base, but I really don't
> need to do that, in fact, I can throw away the tool snapshots when new
> tools come out, by making new snapshots from the base when new tools come
> out.
>
> We have done this already, but we had an issue where the ability to write
> to the snapshots seemed to stop.
>
> Reason unknown, everything worked one day and next could not write to any
> snapshot, but could still load the base and work on it fine.
>
> This might be the wrong mailing list to post to, if so, could anyone point
> out a more appropriate one?
>
> Tim
7 years, 9 months