[libvirt] [PATCH] qemuDomainDeviceDefValidate: Drop unused qemuCaps
by Jiri Denemark
Signed-off-by: Jiri Denemark <jdenemar(a)redhat.com>
---
src/qemu/qemu_domain.c | 4 ----
1 file changed, 4 deletions(-)
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index 0c107aa..fd25669 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -2196,12 +2196,9 @@ qemuDomainDeviceDefValidate(const virDomainDeviceDef *dev,
void *opaque)
{
virQEMUDriverPtr driver = opaque;
- virQEMUCapsPtr qemuCaps = NULL;
virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver);
int ret = -1;
- qemuCaps = virQEMUCapsCacheLookup(driver->qemuCapsCache, def->emulator);
-
if (dev->type == VIR_DOMAIN_DEVICE_NET) {
const virDomainNetDef *net = dev->data.net;
@@ -2216,7 +2213,6 @@ qemuDomainDeviceDefValidate(const virDomainDeviceDef *dev,
ret = 0;
cleanup:
- virObjectUnref(qemuCaps);
virObjectUnref(cfg);
return ret;
}
--
2.9.0
8 years, 4 months
[libvirt] [PATCH RFC 00/48] Sparse streams
by Michal Privoznik
So, after some time spent working on this, I think I finally have
something that works. Finally, we have a formatted messages
between iohelper and the daemon. BUT, it there's a corner case
because where this does not work 100%. If there's a hole at EOF,
it is either not transferred to the other side or not fully
seeked. Therefore, hole at EOF is not in the copy. I guess it is
some silly mistake somewhere. Anyway, any comments appreciated.
v2 can be found here:
https://www.redhat.com/archives/libvir-list/2016-May/msg01691.html
Michal Privoznik (48):
util: Introduce virFileInData
src: Move iohelper out from utils/ to a separate dir
fdstream: s/struct virFDStreamData */virFDStreamDataPtr/
virFDStreamData: Turn into virObjectLockable
Introduce virStreamRecvFlags
Implement virStreamRecvFlags to some drivers
Introduce virStreamSkip
Introduce virStreamHoleSize
Introduce VIR_STREAM_RECV_STOP_AT_HOLE flag
Introduce virStreamSparseRecvAll
Introduce virStreamSparseSendAll
Introduce virStreamInData
virNetClientStreamNew: Track origin stream
Track if stream is skippable
RPC: Introduce virNetStreamSkip
Introduce VIR_NET_STREAM_SKIP message type
Teach wireshark plugin about VIR_NET_STREAM_SKIP
daemon: Introduce virNetServerProgramSendStreamSkip
virnetclientstream: Introduce virNetClientStreamSendSkip
daemon: Implement VIR_NET_STREAM_SKIP handling
virnetclientstream: Introduce virNetClientStreamHandleSkip
remote_driver: Implement virStreamSkip
virNetClientStreamRecvPacket: Introduce @flags argument
Introduce virNetClientStreamHoleSize
remote: Implement virStreamHoleSize
virNetClientStream: Wire up VIR_NET_STREAM_SKIP
remote_driver: Implement VIR_STREAM_RECV_STOP_AT_HOLE
daemonStreamHandleRead: Wire up seekable stream
fdstream: Implement seek
gendispatch: Introduce @sparseflag for our calls
Introduce virStorageVol{Download,Upload}Flags
virsh: Implement sparse stream to vol-download
virsh: Implement sparse stream to vol-upload
daemon: Don't call virStreamInData so often
storage: Enable sparse streams for virStorageVol{Download,Upload}
fdstream: Track formatted message
fdstream: Handle formatted messages separately
iohelper: Introduce iohelper_message
iohelper_message: Introduce API stubs
iohelper_message: Implement formatted read
iohelper_message: Implement formatted write
tests: Introduce iohelpermessagetest
iohelpermessagetest: test non-blocking read & write
iohelper_message: Add support for sparse streams
iohelper: Move runIO to runIOBasic
iohelper: Introduce setupFDs
iohelper: Teach command line 'sparse' argument
iohelper: Wire up formatted messages
daemon/remote.c | 2 +-
daemon/stream.c | 152 +++++++++++-
daemon/stream.h | 3 +-
include/libvirt/libvirt-storage.h | 9 +
include/libvirt/libvirt-stream.h | 86 ++++++-
po/POTFILES.in | 2 +-
src/Makefile.am | 33 ++-
src/driver-stream.h | 23 ++
src/esx/esx_stream.c | 16 +-
src/fdstream.c | 267 +++++++++++++++-----
src/fdstream.h | 3 +-
src/{util => iohelper}/iohelper.c | 234 +++++++++++++++---
src/iohelper/iohelper_message.c | 429 ++++++++++++++++++++++++++++++++
src/iohelper/iohelper_message.h | 53 ++++
src/libvirt-storage.c | 4 +-
src/libvirt-stream.c | 455 ++++++++++++++++++++++++++++++++++
src/libvirt_internal.h | 3 +
src/libvirt_private.syms | 2 +
src/libvirt_public.syms | 8 +-
src/libvirt_remote.syms | 3 +
src/remote/remote_driver.c | 89 ++++++-
src/remote/remote_protocol.x | 2 +
src/rpc/gendispatch.pl | 21 +-
src/rpc/virnetclient.c | 1 +
src/rpc/virnetclientstream.c | 203 ++++++++++++++-
src/rpc/virnetclientstream.h | 17 +-
src/rpc/virnetprotocol.x | 16 +-
src/rpc/virnetserverprogram.c | 33 +++
src/rpc/virnetserverprogram.h | 7 +
src/storage/storage_backend.c | 12 +-
src/storage/storage_driver.c | 4 +-
src/util/virfile.c | 70 ++++++
src/util/virfile.h | 4 +
src/virnetprotocol-structs | 4 +
tests/Makefile.am | 10 +-
tests/iohelpermessagetest.c | 466 +++++++++++++++++++++++++++++++++++
tools/virsh-volume.c | 49 ++--
tools/virsh.c | 36 +++
tools/virsh.h | 17 ++
tools/virsh.pod | 6 +-
tools/wireshark/src/packet-libvirt.c | 40 +++
tools/wireshark/src/packet-libvirt.h | 2 +
42 files changed, 2716 insertions(+), 180 deletions(-)
rename src/{util => iohelper}/iohelper.c (58%)
create mode 100644 src/iohelper/iohelper_message.c
create mode 100644 src/iohelper/iohelper_message.h
create mode 100644 tests/iohelpermessagetest.c
--
2.8.4
8 years, 4 months
[libvirt] [PATCH] Drop virStorageBackendLogicalMatchPoolSource
by Ján Tomko
Regression introduced by commit 71b803a for [1] that prevents starting up
a logical pool created with <source><device path=''></source>
after it has been moved to a different physical volume.
For logical pools <source><name> contains the name of the volume group
and uniquely identifies the VG on the host.
This also speeds up startup for pools that do not have any <device>s
specified.
[1] https://bugzilla.redhat.com/show_bug.cgi?id=1025230
---
src/storage/storage_backend_logical.c | 104 +---------------------------------
1 file changed, 2 insertions(+), 102 deletions(-)
diff --git a/src/storage/storage_backend_logical.c b/src/storage/storage_backend_logical.c
index ca05fe1..057e0b9 100644
--- a/src/storage/storage_backend_logical.c
+++ b/src/storage/storage_backend_logical.c
@@ -558,107 +558,11 @@ virStorageBackendLogicalFindPoolSources(virConnectPtr conn ATTRIBUTE_UNUSED,
}
-/*
- * virStorageBackendLogicalMatchPoolSource
- * @pool: Pointer to the source pool object
- *
- * Search the output generated by a 'pvs --noheadings -o pv_name,vg_name'
- * to match the 'vg_name' with the pool def->source.name and for the list
- * of pool def->source.devices[].
- *
- * Returns true if the volume group name matches the pool's source.name
- * and at least one of the pool's def->source.devices[] matches the
- * list of physical device names listed for the pool. Return false if
- * we cannot find a matching volume group name and if we cannot match
- * the any device list members.
- */
-static bool
-virStorageBackendLogicalMatchPoolSource(virStoragePoolObjPtr pool)
-{
- virStoragePoolSourceList sourceList;
- virStoragePoolSource *thisSource = NULL;
- size_t i, j;
- int matchcount = 0;
- bool ret = false;
-
- memset(&sourceList, 0, sizeof(sourceList));
- sourceList.type = VIR_STORAGE_POOL_LOGICAL;
-
- if (virStorageBackendLogicalGetPoolSources(&sourceList) < 0)
- goto cleanup;
-
- /* Search the pvs output for this pool's source.name */
- for (i = 0; i < sourceList.nsources; i++) {
- thisSource = &sourceList.sources[i];
- if (STREQ(thisSource->name, pool->def->source.name))
- break;
- }
-
- if (i == sourceList.nsources) {
- virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
- _("cannot find logical volume group name '%s'"),
- pool->def->source.name);
- goto cleanup;
- }
-
- /* If the pool has defined source device(s), then let's make sure
- * they match as well; otherwise, matching can only occur on the
- * pool's name.
- */
- if (!pool->def->source.ndevice) {
- ret = true;
- goto cleanup;
- }
-
- /* Let's make sure the pool's device(s) match what the pvs output has
- * for volume group devices.
- */
- for (i = 0; i < pool->def->source.ndevice; i++) {
- for (j = 0; j < thisSource->ndevice; j++) {
- if (STREQ(pool->def->source.devices[i].path,
- thisSource->devices[j].path))
- matchcount++;
- }
- }
-
- /* If we didn't find any matches, then this pool has listed (a) source
- * device path(s) that don't/doesn't match what was created for the pool
- */
- if (matchcount == 0) {
- virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
- _("cannot find any matching source devices for logical "
- "volume group '%s'"), pool->def->source.name);
- goto cleanup;
- }
-
- /* Either there's more devices in the pool source device list or there's
- * more devices in the pvs output. Could easily happen if someone decides
- * to 'add' to or 'remove' from the volume group outside of libvirt's
- * knowledge. Rather than fail on that, provide a warning and move on.
- */
- if (matchcount != pool->def->source.ndevice)
- VIR_WARN("pool device list count doesn't match pvs device list count");
-
- ret = true;
-
- cleanup:
- for (i = 0; i < sourceList.nsources; i++)
- virStoragePoolSourceClear(&sourceList.sources[i]);
- VIR_FREE(sourceList.sources);
-
- return ret;
-}
-
-
static int
virStorageBackendLogicalCheckPool(virStoragePoolObjPtr pool,
bool *isActive)
{
- /* If we can find the target.path as well as ensure that the
- * pool's def source
- */
- *isActive = virFileExists(pool->def->target.path) &&
- virStorageBackendLogicalMatchPoolSource(pool);
+ *isActive = virFileExists(pool->def->target.path);
return 0;
}
@@ -666,11 +570,7 @@ static int
virStorageBackendLogicalStartPool(virConnectPtr conn ATTRIBUTE_UNUSED,
virStoragePoolObjPtr pool)
{
- /* Let's make sure that the pool's name matches the pvs output and
- * that the pool's source devices match the pvs output.
- */
- if (!virStorageBackendLogicalMatchPoolSource(pool) ||
- virStorageBackendLogicalSetActive(pool, 1) < 0)
+ if (virStorageBackendLogicalSetActive(pool, 1) < 0)
return -1;
return 0;
--
2.7.3
8 years, 4 months
[libvirt] [PATCH] logging: fixing log level initialization from cmdline
by Jaroslav Suchanek
Reorder code for setting default log level from cmdline prior
initialization of log outputs. Thus the --verbose option is reflected.
This resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1325072
---
src/logging/log_daemon.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/src/logging/log_daemon.c b/src/logging/log_daemon.c
index 8f1ccc2..9f71ca9 100644
--- a/src/logging/log_daemon.c
+++ b/src/logging/log_daemon.c
@@ -405,6 +405,12 @@ virLogDaemonSetupLogging(virLogDaemonConfigPtr config,
virLogParseOutputs(config->log_outputs);
/*
+ * Command line override for --verbose
+ */
+ if ((verbose) && (virLogGetDefaultPriority() > VIR_LOG_INFO))
+ virLogSetDefaultPriority(VIR_LOG_INFO);
+
+ /*
* If no defined outputs, and either running
* as daemon or not on a tty, then first try
* to direct it to the systemd journal
@@ -464,12 +470,6 @@ virLogDaemonSetupLogging(virLogDaemonConfigPtr config,
VIR_FREE(tmp);
}
- /*
- * Command line override for --verbose
- */
- if ((verbose) && (virLogGetDefaultPriority() > VIR_LOG_INFO))
- virLogSetDefaultPriority(VIR_LOG_INFO);
-
return 0;
error:
--
1.8.3.1
8 years, 4 months
[libvirt] [PATCH 0/2] virQEMUCapsFillDomainCaps: Drop redundant parameter
by Jiri Denemark
Jiri Denemark (2):
qemu: Remove redundant parameter in virQEMUCapsFillDomainCaps
domaincapstest: Don't read data from host
src/qemu/qemu_capabilities.c | 5 ++---
src/qemu/qemu_capabilities.h | 3 +--
src/qemu/qemu_driver.c | 2 +-
tests/Makefile.am | 7 +++++++
tests/domaincapsmock.c | 26 ++++++++++++++++++++++++++
tests/domaincapstest.c | 5 ++---
6 files changed, 39 insertions(+), 9 deletions(-)
create mode 100644 tests/domaincapsmock.c
--
2.9.0
8 years, 4 months
[libvirt] [PATCH 0/2] Fix FreeBSD build
by Andrea Bolognani
Pushed under the build-breaker rule.
Andrea Bolognani (2):
util: netdevip: Include vircommand.h
Clean up after virNetDevIP creation
src/util/virnetdev.h | 21 ---------------------
src/util/virnetdevip.c | 5 +++--
tests/qemuxml2argvmock.c | 9 +++++----
3 files changed, 8 insertions(+), 27 deletions(-)
--
2.7.4
8 years, 4 months
Re: [libvirt] [Bug] make check fails when LIBVIRT_DEBUG is defined
by Eric Blake
[moderator note: the mail server balked at 1.3 megabytes of attachments,
so I've stripped them in my reply]
On 12/31/1969 05:00 PM, wrote:
> Hello everybody,
>
> I set up a clean libvirt repo with:
> git clone
> ./autogen.sh
> make -j5
>
> and then executed tests with various values of LIBVIRT_DEBUG using
> the following command:
> LIBVIRT_DEBUG=0…5 VIR_TEST_DEBUG=1 make check
>
> The logs are in this mail's attachments.
>
>
> With LIBVIRT_DEBUG=0 (or =5 or probably any invalid value), the logs say:
> "Ignoring invalid log level setting”
> but still, 10 tests fail due to various reasons.
>
> With LIBVIRT_DEBUG=1, there is a slight difference. The number of tests
> that fail is also 10, but here, commandtest fails instead of eventtest.
>
> With LIBVIRT_DEBUG=2, only 9 tests fail, because commandtest passes.
>
> With LIBVIRT_DEBUG=3, only 1 test fails: qemuargv2xmltest. The
> reason is the same as in the previous tests.
>
> With LIBVIRT_DEBUG=4, it’s just qemuargv2xmltest that is failing,
> but for a different reason than before:
> "qemuParseCommandLineString should have logged a warning”.
>
>
> Perhaps it’s okay that these tests fail, but still there's no harm
> in letting people know.
>
> Thank you rbogorodskiy for guidance on the mailing list :)
>
> Have a nice day,
> Tomasz
>
I don't know that anyone ever expected the testsuite to work with
LIBVIRT_DEBUG set to anything (because turning on debug can change
output of libvirt itself). Things are different with VIR_TEST_DEBUG,
which explicitly exists to change the verbosity of the testsuite itself,
but not affect libvirt. If the testsuite passes without LIBVIRT_DEBUG
set, then that's the solution :) But if you still get failures with
LIBVIRT_DEBUG removed from the environment on your particular platform,
then it is worth investigating how we can fix those failures (it may be
a weakness in the testsuite, or an actual libvirt bug).
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
8 years, 4 months
[libvirt] [PATCH 0/2] util: Small cleanups
by Andrea Bolognani
What it says on the tin.
Andrea Bolognani (2):
util: Drop obsolete compatibility code
util: Only define /dev/kvm path once
src/util/virhostcpu.c | 18 +++---------------
1 file changed, 3 insertions(+), 15 deletions(-)
--
2.7.4
8 years, 4 months
[libvirt] [PATCH v2 0/3] Small cleanups and improvements
by Andrea Bolognani
Remove some obsolete code, and improve the behavior
of the 'virsh domcapabilities --virttype kvm' command when
running on non-Linux platform.
Andrea Bolognani (3):
util: hostcpu: Add virHostCPUGetKVMMaxVCPUs() stub
util: hostcpu: Drop obsolete compatibility code
qemu: capabilities: Make virHostCPUGetKVMMaxVCPUs() errors fatal
src/qemu/qemu_capabilities.c | 9 ++++++---
src/util/virhostcpu.c | 25 ++++++++++++-------------
2 files changed, 18 insertions(+), 16 deletions(-)
--
2.7.4
8 years, 4 months
[libvirt] [PATCH v2 00/15] Add support for LUKS encrypted devices
by John Ferlan
v1: http://www.redhat.com/archives/libvir-list/2016-June/msg00804.html
Differences since v1 (beyond those patches already pushed)
Patch 1: Adjust via recent comments for patch 8 of previous series
Patch 2: Already ACK'd, adjust slightly based on merge conflicts
Patch 3: Used to be patch 14
- Use VIR_SECRET_USAGE_TYPE_PASSPHRASE (instead of _KEY)
- Use "usage.id" (instead of "usage.key")
Patch 4: Used by be patch 11 (wasn't reviewed)
Patch 5: Split from patch 13 for separate endian code to read a 16 bit value
Patch 6: NEW - based slightly on former patch 12
- No longer use cryptType
- Use versionSize instead in order to decode verision data as 16 or 32 bits
Patch 7: Former patch 13 with adjustments based on previous patches
Patch 8-9: Former patch 15-16 w/ adjustments from review and to keep up with
other changes
Patch 10: NEW - Reaction to former patch 17 comments with respect to a
file name. Need a way to build a path to temporarily save the secret
where that path is not in the pool. Chose the "stateDir", but since
storage_driver is the only place that knows, added helper API to access.
Patch 11: Former patch 17 with adjustments from code review and to handle
other changes so far
Patches 12-14: NEW - Really a bug fix submitted as a separate patch
(although there are a few differences here), but I need it for patch 15
Patch 15: Former patch 19 plus adjustments for hotplug.
John Ferlan (15):
qemu: Change protocol parameter for secret setup
qemu: Remove authdef from secret setup
conf: Add new secret type "passphrase"
util: Add 'usage' for encryption
util: Introduce virReadBufInt16LE and virReadBufInt16BE
util: Modify the FileTypeInfo to add a version size
util: Add 'luks' to the FileTypeInfo
encryption: Add luks parsing for storageencryption
encryption: Add <cipher> and <ivgen> to encryption
storage: Introduce virStoragePoolObjBuildTempFilePath
storage: Add support to create a luks volume
qemu: Remove type from qemuBuildSecretInfoProps
qemu: Make qemuBuildSecretInfoProps global
qemu: Add secinfo for hotplug virtio disk
qemu: Add luks support for domain disk
docs/aclpolkit.html.in | 4 +
docs/formatsecret.html.in | 62 ++++-
docs/formatstorageencryption.html.in | 116 ++++++++-
docs/schemas/secret.rng | 10 +
docs/schemas/storagecommon.rng | 57 ++++-
include/libvirt/libvirt-secret.h | 3 +-
src/access/viraccessdriverpolkit.c | 13 +
src/conf/domain_conf.c | 11 +
src/conf/secret_conf.c | 26 +-
src/conf/secret_conf.h | 1 +
src/conf/virsecretobj.c | 5 +
src/libvirt_private.syms | 1 +
src/qemu/qemu_command.c | 23 +-
src/qemu/qemu_command.h | 4 +
src/qemu/qemu_domain.c | 126 +++++-----
src/qemu/qemu_hotplug.c | 107 ++++++++-
src/qemu/qemu_process.c | 19 +-
src/storage/storage_backend.c | 266 +++++++++++++++++++--
src/storage/storage_backend.h | 3 +-
src/storage/storage_backend_fs.c | 10 +-
src/storage/storage_backend_gluster.c | 2 +
src/storage/storage_driver.c | 24 ++
src/storage/storage_driver.h | 6 +-
src/util/virendian.h | 24 ++
src/util/virqemu.c | 23 ++
src/util/virqemu.h | 6 +
src/util/virstorageencryption.c | 152 ++++++++++--
src/util/virstorageencryption.h | 17 +-
src/util/virstoragefile.c | 84 +++++--
src/util/virstoragefile.h | 1 +
.../qemuxml2argv-encrypted-disk-usage.args | 24 ++
.../qemuxml2argv-encrypted-disk-usage.xml | 32 +++
.../qemuxml2argv-luks-disk-cipher.args | 36 +++
.../qemuxml2argv-luks-disk-cipher.xml | 41 ++++
.../qemuxml2argvdata/qemuxml2argv-luks-disks.args | 36 +++
tests/qemuxml2argvdata/qemuxml2argv-luks-disks.xml | 41 ++++
tests/qemuxml2argvtest.c | 12 +-
.../qemuxml2xmlout-encrypted-disk-usage.xml | 36 +++
.../qemuxml2xmlout-luks-disk-cipher.xml | 45 ++++
.../qemuxml2xmlout-luks-disks.xml | 45 ++++
tests/qemuxml2xmltest.c | 3 +
tests/secretxml2xmlin/usage-passphrase.xml | 7 +
tests/secretxml2xmltest.c | 1 +
tests/storagevolxml2argvtest.c | 3 +-
tests/storagevolxml2xmlin/vol-luks-cipher.xml | 23 ++
tests/storagevolxml2xmlin/vol-luks.xml | 21 ++
tests/storagevolxml2xmlout/vol-luks-cipher.xml | 23 ++
tests/storagevolxml2xmlout/vol-luks.xml | 21 ++
tests/storagevolxml2xmltest.c | 2 +
tests/virendiantest.c | 18 ++
50 files changed, 1495 insertions(+), 181 deletions(-)
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-encrypted-disk-usage.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-encrypted-disk-usage.xml
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-luks-disk-cipher.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-luks-disk-cipher.xml
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-luks-disks.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-luks-disks.xml
create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-encrypted-disk-usage.xml
create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-luks-disk-cipher.xml
create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-luks-disks.xml
create mode 100644 tests/secretxml2xmlin/usage-passphrase.xml
create mode 100644 tests/storagevolxml2xmlin/vol-luks-cipher.xml
create mode 100644 tests/storagevolxml2xmlin/vol-luks.xml
create mode 100644 tests/storagevolxml2xmlout/vol-luks-cipher.xml
create mode 100644 tests/storagevolxml2xmlout/vol-luks.xml
--
2.5.5
8 years, 4 months