[libvirt] [python PATCH 0/4] followup fixes for virPyDictToTypedParams
by Pavel Hrdina
Pavel Hrdina (4):
Use static variables to store virPyDictToTypedParams hints
Fix order of virPyDictToTypedParams hints
Add missing virPyDictToTypedParams hint for migration params
Fix virPyDictToTypedParams type hint for block copy params
libvirt-override.c | 150 ++++++++++++-----------------------------------------
libvirt-utils.h | 2 +
2 files changed, 35 insertions(+), 117 deletions(-)
--
2.14.3
6 years, 10 months
[libvirt] [PATCH python 1/1] Set hints for virPyDictToTypedParams
by Edgar Kaziakhmedov
Predefine hints for all parameters possible to avoid wrong type
convert.
Signed-off-by: Edgar Kaziakhmedov <edgar.kaziakhmedov(a)virtuozzo.com>
---
libvirt-override.c | 128 +++++++++++++++++++++++++++++++++++++++++++++++++++--
1 file changed, 124 insertions(+), 4 deletions(-)
diff --git a/libvirt-override.c b/libvirt-override.c
index 78a7f08..dba42d4 100644
--- a/libvirt-override.c
+++ b/libvirt-override.c
@@ -7750,7 +7750,9 @@ libvirt_virDomainMigrate3(PyObject *self ATTRIBUTE_UNUSED,
PyObject *dict;
unsigned int flags;
virTypedParameterPtr params;
- int nparams;
+ virPyTypedParamsHintPtr hparams;
+ int nparams = 0;
+ int nhparams = 15;
virDomainPtr ddom = NULL;
if (!PyArg_ParseTuple(args, (char *) "OOOI:virDomainMigrate3",
@@ -7760,14 +7762,64 @@ libvirt_virDomainMigrate3(PyObject *self ATTRIBUTE_UNUSED,
domain = (virDomainPtr) PyvirDomain_Get(pyobj_domain);
dconn = (virConnectPtr) PyvirConnect_Get(pyobj_dconn);
- if (virPyDictToTypedParams(dict, ¶ms, &nparams, NULL, 0) < 0)
+ hparams = malloc(sizeof(virPyTypedParamsHint) * nhparams);
+ hparams[0].name = VIR_MIGRATE_PARAM_URI;
+ hparams[0].type = VIR_TYPED_PARAM_STRING;
+
+ hparams[1].name = VIR_MIGRATE_PARAM_DEST_NAME;
+ hparams[1].type = VIR_TYPED_PARAM_STRING;
+
+ hparams[2].name = VIR_MIGRATE_PARAM_DEST_XML;
+ hparams[2].type = VIR_TYPED_PARAM_STRING;
+
+ hparams[3].name = VIR_MIGRATE_PARAM_GRAPHICS_URI;
+ hparams[3].type = VIR_TYPED_PARAM_STRING;
+
+ hparams[4].name = VIR_MIGRATE_PARAM_BANDWIDTH;
+ hparams[4].type = VIR_TYPED_PARAM_ULLONG;
+
+ hparams[5].name = VIR_MIGRATE_PARAM_LISTEN_ADDRESS;
+ hparams[5].type = VIR_TYPED_PARAM_STRING;
+
+ hparams[6].name = VIR_MIGRATE_PARAM_DISKS_PORT;
+ hparams[6].type = VIR_TYPED_PARAM_INT;
+
+ hparams[7].name = VIR_MIGRATE_PARAM_COMPRESSION;
+ hparams[7].type = VIR_TYPED_PARAM_STRING;
+
+ hparams[8].name = VIR_MIGRATE_PARAM_COMPRESSION_MT_DTHREADS;
+ hparams[8].type = VIR_TYPED_PARAM_INT;
+
+ hparams[9].name = VIR_MIGRATE_PARAM_COMPRESSION_MT_LEVEL;
+ hparams[9].type = VIR_TYPED_PARAM_INT;
+
+ hparams[10].name = VIR_MIGRATE_PARAM_COMPRESSION_MT_THREADS;
+ hparams[10].type = VIR_TYPED_PARAM_INT;
+
+ hparams[11].name = VIR_MIGRATE_PARAM_COMPRESSION_XBZRLE_CACHE;
+ hparams[11].type = VIR_TYPED_PARAM_ULLONG;
+
+ hparams[12].name = VIR_MIGRATE_PARAM_PERSIST_XML;
+ hparams[12].type = VIR_TYPED_PARAM_STRING;
+
+ hparams[13].name = VIR_MIGRATE_PARAM_AUTO_CONVERGE_INITIAL;
+ hparams[13].type = VIR_TYPED_PARAM_INT;
+
+ hparams[14].name = VIR_MIGRATE_PARAM_AUTO_CONVERGE_INCREMENT;
+ hparams[14].type = VIR_TYPED_PARAM_INT;
+
+ if (virPyDictToTypedParams(dict, ¶ms, &nparams,
+ hparams, nhparams) < 0) {
+ free(hparams);
return NULL;
+ }
LIBVIRT_BEGIN_ALLOW_THREADS;
ddom = virDomainMigrate3(domain, dconn, params, nparams, flags);
LIBVIRT_END_ALLOW_THREADS;
virTypedParamsFree(params, nparams);
+ free(hparams);
return libvirt_virDomainPtrWrap(ddom);
}
@@ -7781,7 +7833,9 @@ libvirt_virDomainMigrateToURI3(PyObject *self ATTRIBUTE_UNUSED,
PyObject *dict;
unsigned int flags;
virTypedParameterPtr params;
+ virPyTypedParamsHintPtr hparams;
int nparams;
+ int nhparams = 15;
int ret = -1;
if (!PyArg_ParseTuple(args, (char *) "OzOI:virDomainMigrate3",
@@ -7790,14 +7844,64 @@ libvirt_virDomainMigrateToURI3(PyObject *self ATTRIBUTE_UNUSED,
domain = (virDomainPtr) PyvirDomain_Get(pyobj_domain);
- if (virPyDictToTypedParams(dict, ¶ms, &nparams, NULL, 0) < 0)
+ hparams = malloc(sizeof(virPyTypedParamsHint) * nhparams);
+ hparams[0].name = VIR_MIGRATE_PARAM_URI;
+ hparams[0].type = VIR_TYPED_PARAM_STRING;
+
+ hparams[1].name = VIR_MIGRATE_PARAM_DEST_NAME;
+ hparams[1].type = VIR_TYPED_PARAM_STRING;
+
+ hparams[2].name = VIR_MIGRATE_PARAM_DEST_XML;
+ hparams[2].type = VIR_TYPED_PARAM_STRING;
+
+ hparams[3].name = VIR_MIGRATE_PARAM_GRAPHICS_URI;
+ hparams[3].type = VIR_TYPED_PARAM_STRING;
+
+ hparams[4].name = VIR_MIGRATE_PARAM_BANDWIDTH;
+ hparams[4].type = VIR_TYPED_PARAM_ULLONG;
+
+ hparams[5].name = VIR_MIGRATE_PARAM_LISTEN_ADDRESS;
+ hparams[5].type = VIR_TYPED_PARAM_STRING;
+
+ hparams[6].name = VIR_MIGRATE_PARAM_DISKS_PORT;
+ hparams[6].type = VIR_TYPED_PARAM_INT;
+
+ hparams[7].name = VIR_MIGRATE_PARAM_COMPRESSION;
+ hparams[7].type = VIR_TYPED_PARAM_STRING;
+
+ hparams[8].name = VIR_MIGRATE_PARAM_COMPRESSION_MT_DTHREADS;
+ hparams[8].type = VIR_TYPED_PARAM_INT;
+
+ hparams[9].name = VIR_MIGRATE_PARAM_COMPRESSION_MT_LEVEL;
+ hparams[9].type = VIR_TYPED_PARAM_INT;
+
+ hparams[10].name = VIR_MIGRATE_PARAM_COMPRESSION_MT_THREADS;
+ hparams[10].type = VIR_TYPED_PARAM_INT;
+
+ hparams[11].name = VIR_MIGRATE_PARAM_COMPRESSION_XBZRLE_CACHE;
+ hparams[11].type = VIR_TYPED_PARAM_ULLONG;
+
+ hparams[12].name = VIR_MIGRATE_PARAM_PERSIST_XML;
+ hparams[12].type = VIR_TYPED_PARAM_STRING;
+
+ hparams[13].name = VIR_MIGRATE_PARAM_AUTO_CONVERGE_INITIAL;
+ hparams[13].type = VIR_TYPED_PARAM_INT;
+
+ hparams[14].name = VIR_MIGRATE_PARAM_AUTO_CONVERGE_INCREMENT;
+ hparams[14].type = VIR_TYPED_PARAM_INT;
+
+ if (virPyDictToTypedParams(dict, ¶ms, &nparams,
+ hparams, nhparams) < 0) {
+ free(hparams);
return NULL;
+ }
LIBVIRT_BEGIN_ALLOW_THREADS;
ret = virDomainMigrateToURI3(domain, dconnuri, params, nparams, flags);
LIBVIRT_END_ALLOW_THREADS;
virTypedParamsFree(params, nparams);
+ free(hparams);
return libvirt_intWrap(ret);
}
#endif /* LIBVIR_CHECK_VERSION(1, 1, 0) */
@@ -8650,7 +8754,9 @@ libvirt_virDomainBlockCopy(PyObject *self ATTRIBUTE_UNUSED,
char *disk = NULL;
char *destxml = NULL;
virTypedParameterPtr params = NULL;
+ virPyTypedParamsHintPtr hparams;
int nparams = 0;
+ int nhparams = 3;
unsigned int flags = 0;
int c_retval;
@@ -8659,8 +8765,22 @@ libvirt_virDomainBlockCopy(PyObject *self ATTRIBUTE_UNUSED,
return NULL;
if (PyDict_Check(pyobj_dict)) {
- if (virPyDictToTypedParams(pyobj_dict, ¶ms, &nparams, NULL, 0) < 0)
+ hparams = malloc(sizeof(virPyTypedParamsHint) * nhparams);
+ hparams[0].name = VIR_DOMAIN_BLOCK_COPY_BANDWIDTH;
+ hparams[0].type = VIR_TYPED_PARAM_ULLONG;
+
+ hparams[1].name = VIR_DOMAIN_BLOCK_COPY_GRANULARITY;
+ hparams[1].type = VIR_TYPED_PARAM_UINT;
+
+ hparams[2].name = VIR_DOMAIN_BLOCK_COPY_BUF_SIZE;
+ hparams[2].type = VIR_TYPED_PARAM_UINT;
+
+ if (virPyDictToTypedParams(pyobj_dict, ¶ms, &nparams,
+ hparams, nhparams) < 0) {
+ free(hparams);
return NULL;
+ }
+ free(hparams);
}
dom = (virDomainPtr) PyvirDomain_Get(pyobj_dom);
--
2.11.0
6 years, 10 months
[libvirt] [PATCH] bhyve: Fix build
by Andrea Bolognani
Commit 2d43f0a2dcfd dropped virDomainDiskTranslateSourcePool()'s
first argument but failed to update callers in the bhyve driver.
Signed-off-by: Andrea Bolognani <abologna(a)redhat.com>
---
Pushed under the build breaker rule.
src/bhyve/bhyve_command.c | 21 ++++++++++-----------
1 file changed, 10 insertions(+), 11 deletions(-)
diff --git a/src/bhyve/bhyve_command.c b/src/bhyve/bhyve_command.c
index c1241b811..fd738b42c 100644
--- a/src/bhyve/bhyve_command.c
+++ b/src/bhyve/bhyve_command.c
@@ -198,7 +198,7 @@ bhyveBuildAHCIControllerArgStr(const virDomainDef *def,
goto error;
}
- if (virDomainDiskTranslateSourcePool(conn, disk) < 0)
+ if (virDomainDiskTranslateSourcePool(disk) < 0)
goto error;
disk_source = virDomainDiskGetSource(disk);
@@ -289,12 +289,11 @@ bhyveBuildUSBControllerArgStr(const virDomainDef *def,
static int
bhyveBuildVirtIODiskArgStr(const virDomainDef *def ATTRIBUTE_UNUSED,
virDomainDiskDefPtr disk,
- virConnectPtr conn,
virCommandPtr cmd)
{
const char *disk_source;
- if (virDomainDiskTranslateSourcePool(conn, disk) < 0)
+ if (virDomainDiskTranslateSourcePool(disk) < 0)
return -1;
if (disk->device != VIR_DOMAIN_DISK_DEVICE_DISK) {
@@ -562,7 +561,7 @@ virBhyveProcessBuildBhyveCmd(virConnectPtr conn,
/* Handled by bhyveBuildAHCIControllerArgStr() */
break;
case VIR_DOMAIN_DISK_BUS_VIRTIO:
- if (bhyveBuildVirtIODiskArgStr(def, disk, conn, cmd) < 0)
+ if (bhyveBuildVirtIODiskArgStr(def, disk, cmd) < 0)
goto error;
break;
default:
@@ -672,10 +671,10 @@ virBhyveProcessBuildCustomLoaderCmd(virDomainDefPtr def)
}
static bool
-virBhyveUsableDisk(virConnectPtr conn, virDomainDiskDefPtr disk)
+virBhyveUsableDisk(virDomainDiskDefPtr disk)
{
- if (virDomainDiskTranslateSourcePool(conn, disk) < 0)
+ if (virDomainDiskTranslateSourcePool(disk) < 0)
return false;
if ((disk->device != VIR_DOMAIN_DISK_DEVICE_DISK) &&
@@ -729,7 +728,7 @@ virBhyveProcessBuildGrubbhyveCmd(virDomainDefPtr def,
* across. */
cd = hdd = userdef = NULL;
for (i = 0; i < def->ndisks; i++) {
- if (!virBhyveUsableDisk(conn, def->disks[i]))
+ if (!virBhyveUsableDisk(def->disks[i]))
continue;
diskdef = def->disks[i];
@@ -815,7 +814,7 @@ virBhyveProcessBuildGrubbhyveCmd(virDomainDefPtr def,
}
static virDomainDiskDefPtr
-virBhyveGetBootDisk(virConnectPtr conn, virDomainDefPtr def)
+virBhyveGetBootDisk(virDomainDefPtr def)
{
size_t i;
virDomainDiskDefPtr match = NULL;
@@ -851,7 +850,7 @@ virBhyveGetBootDisk(virConnectPtr conn, virDomainDefPtr def)
/* If boot_dev is set, we return the first device of
* the request type */
for (i = 0; i < def->ndisks; i++) {
- if (!virBhyveUsableDisk(conn, def->disks[i]))
+ if (!virBhyveUsableDisk(def->disks[i]))
continue;
if (def->disks[i]->device == boot_dev) {
@@ -875,7 +874,7 @@ virBhyveGetBootDisk(virConnectPtr conn, virDomainDefPtr def)
int first_usable_disk_index = -1;
for (i = 0; i < def->ndisks; i++) {
- if (!virBhyveUsableDisk(conn, def->disks[i]))
+ if (!virBhyveUsableDisk(def->disks[i]))
continue;
else
first_usable_disk_index = i;
@@ -907,7 +906,7 @@ virBhyveProcessBuildLoadCmd(virConnectPtr conn, virDomainDefPtr def,
virDomainDiskDefPtr disk = NULL;
if (def->os.bootloader == NULL) {
- disk = virBhyveGetBootDisk(conn, def);
+ disk = virBhyveGetBootDisk(def);
if (disk == NULL)
return NULL;
--
2.14.3
6 years, 10 months
[libvirt] [PATCH] tests: drop linkage to libvirt_driver_network_impl.la
by Daniel P. Berrangé
The qemuxml2argvtest does not need to link to the network driver
after this commit:
commit 0c63c117a2d17f66b05dd83e50aa36ac0b0c9843
Author: Daniel P. Berrangé <berrange(a)redhat.com>
Date: Fri Feb 9 15:08:53 2018 +0000
conf: reimplement virDomainNetResolveActualType in terms of public API
Signed-off-by: Daniel P. Berrangé <berrange(a)redhat.com>
---
Pushed as a CI build fix for OS-X
tests/Makefile.am | 1 -
1 file changed, 1 deletion(-)
diff --git a/tests/Makefile.am b/tests/Makefile.am
index d9b3a99477..09647a959d 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -583,7 +583,6 @@ qemuxml2argvtest_SOURCES = \
qemuxml2argvtest.c testutilsqemu.c testutilsqemu.h \
testutils.c testutils.h
qemuxml2argvtest_LDADD = libqemutestdriver.la \
- ../src/libvirt_driver_network_impl.la \
$(LDADDS) $(LIBXML_LIBS)
qemuxml2argvmock_la_SOURCES = \
--
2.14.3
6 years, 10 months
[libvirt] [PATCH] conf: move 'generated' member from virMacAddr to virDomainNetDef
by Laine Stump
Commit 7e62c4cd26d (first appearing in libvirt-3.9.0 as a resolution
to rhbz #1343919) added a "generated" attribute to virMacAddr that was
set whenever a mac address was auto-generated by libvirt. This
knowledge was used in a single place - when trying to match a NetDef
from the domain to delete with user-provided XML. Since the XML parser
always auto-generates a MAC address for NetDefs when none is provided,
it was previously impossible to make a search where the MAC address
wasn't significant, but the addition of the "generated" attribute made
it possible for the search function to ignore auto-generated MACs.
This implementation had a problem though - it was adding a field to a
"low level" struct - virMacAddr - which is used in other places with
the assumption that it contains exactly a 6 byte MAC address and
nothing else. In particular, virNWFilterSnoopEthHdr uses virMacAddr as
part of the definition of an ethernet packet header, whose layout must
of course match an actual ethernet packet. Adding the extra bools into
virNWFilterSnoopEthHdr caused the nwfilter driver's "IP discovery via
DHCP packet snooping" functionality to mysteriously stop working.
In order to fix that behavior, and prevent potential future similar
odd behavior, this patch moves the "generated" member out of
virMacAddr (so that it is again really just a MAC address) and into
virDomainNetDef, and sets it only when virDomainNetGenerateMAC() is
called from virDomainNetDefParseXML() (which is the only time we care
about it).
Resolves: https://bugzilla.redhat.com/1529338
(It should also be applied to any maintenance branch that applies
commit 7e62c4cd26 and friends to resolve
https://bugzilla.redhat.com/1343919)
Signed-off-by: Laine Stump <laine(a)laine.org>
---
src/conf/domain_conf.c | 3 ++-
src/conf/domain_conf.h | 1 +
src/util/virmacaddr.c | 5 -----
src/util/virmacaddr.h | 2 --
tests/bhyveargv2xmlmock.c | 1 -
5 files changed, 3 insertions(+), 9 deletions(-)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 3cfd6de5e0..7783a3dbef 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -11064,6 +11064,7 @@ virDomainNetDefParseXML(virDomainXMLOptionPtr xmlopt,
}
} else {
virDomainNetGenerateMAC(xmlopt, &def->mac);
+ def->mac_generated = true;
}
if (devaddr) {
@@ -16283,7 +16284,7 @@ virDomainNetFindIdx(virDomainDefPtr def, virDomainNetDefPtr net)
size_t i;
int matchidx = -1;
char mac[VIR_MAC_STRING_BUFLEN];
- bool MACAddrSpecified = !net->mac.generated;
+ bool MACAddrSpecified = !net->mac_generated;
bool PCIAddrSpecified = virDomainDeviceAddressIsValid(&net->info,
VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI);
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index e6212818aa..b0a175b4a4 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -966,6 +966,7 @@ struct _virDomainActualNetDef {
struct _virDomainNetDef {
virDomainNetType type;
virMacAddr mac;
+ bool mac_generated; /* true if mac was *just now* auto-generated by libvirt */
char *model;
union {
struct {
diff --git a/src/util/virmacaddr.c b/src/util/virmacaddr.c
index 409fdc34d5..7afe032b9c 100644
--- a/src/util/virmacaddr.c
+++ b/src/util/virmacaddr.c
@@ -107,7 +107,6 @@ void
virMacAddrSet(virMacAddrPtr dst, const virMacAddr *src)
{
memcpy(dst, src, sizeof(*src));
- dst->generated = false;
}
/**
@@ -121,7 +120,6 @@ void
virMacAddrSetRaw(virMacAddrPtr dst, const unsigned char src[VIR_MAC_BUFLEN])
{
memcpy(dst->addr, src, VIR_MAC_BUFLEN);
- dst->generated = false;
}
/**
@@ -151,7 +149,6 @@ virMacAddrParse(const char* str, virMacAddrPtr addr)
{
size_t i;
- addr->generated = false;
errno = 0;
for (i = 0; i < VIR_MAC_BUFLEN; i++) {
char *end_ptr;
@@ -220,7 +217,6 @@ virMacAddrParseHex(const char *str, virMacAddrPtr addr)
str[VIR_MAC_HEXLEN])
return -1;
- addr->generated = false;
for (i = 0; i < VIR_MAC_BUFLEN; i++)
addr->addr[i] = (virHexToBin(str[2 * i]) << 4 |
virHexToBin(str[2 * i + 1]));
@@ -236,7 +232,6 @@ void virMacAddrGenerate(const unsigned char prefix[VIR_MAC_PREFIX_BUFLEN],
addr->addr[3] = virRandomBits(8);
addr->addr[4] = virRandomBits(8);
addr->addr[5] = virRandomBits(8);
- addr->generated = true;
}
/* The low order bit of the first byte is the "multicast" bit. */
diff --git a/src/util/virmacaddr.h b/src/util/virmacaddr.h
index ef4285d639..f4f5e2ce11 100644
--- a/src/util/virmacaddr.h
+++ b/src/util/virmacaddr.h
@@ -36,8 +36,6 @@ typedef virMacAddr *virMacAddrPtr;
struct _virMacAddr {
unsigned char addr[VIR_MAC_BUFLEN];
- bool generated; /* True if MAC address was autogenerated,
- false otherwise. */
};
int virMacAddrCompare(const char *mac1, const char *mac2);
diff --git a/tests/bhyveargv2xmlmock.c b/tests/bhyveargv2xmlmock.c
index dd25f4e13a..1f08bebb7b 100644
--- a/tests/bhyveargv2xmlmock.c
+++ b/tests/bhyveargv2xmlmock.c
@@ -16,7 +16,6 @@ virMacAddrGenerate(const unsigned char prefix[VIR_MAC_PREFIX_BUFLEN],
addr->addr[3] = 0;
addr->addr[4] = 0;
addr->addr[5] = 0;
- addr->generated = true;
}
int
--
2.14.3
6 years, 10 months
[libvirt] [PATCH v3 00/10] Cleanups in QEMU driver wrt virConnectPtr
by Daniel P. Berrangé
There are many places we can stop passing around virConnectPtr now
and directly open secondary drivers where required instead.
v3:
- More migration function renames
- Style fixes
v2:
- Now with working tests !
Daniel P. Berrangé (10):
driver: allow override of connection for secondary drivers
conf: reimplement virDomainNetResolveActualType in terms of public API
qemu: stop passing virConnectPtr into qemuMonitorStartCPUs
conf: stop passing virConnectPtr into virDomainDiskTranslateSourcePool
qemu: don't pass virConnectPtr around for secrets
qemu: stop passing in virConnectPtr for looking up networks
qemu: remove virConnectPtr from some more startup code paths
qemu: remove virConnectPtr in some migration methods
qemu: don't export migration job APIs
qemu: rename migration APIs to include Src or Dst in their name
src/conf/domain_conf.c | 90 ++-
src/conf/domain_conf.h | 14 +-
src/driver.c | 184 ++++-
src/driver.h | 7 +
src/libvirt_private.syms | 6 +
src/network/bridge_driver.c | 76 +--
src/qemu/qemu_conf.c | 3 +-
src/qemu/qemu_conf.h | 3 +-
src/qemu/qemu_domain.c | 111 ++-
src/qemu/qemu_domain.h | 21 +-
src/qemu/qemu_driver.c | 324 ++++-----
src/qemu/qemu_hotplug.c | 66 +-
src/qemu/qemu_hotplug.h | 15 +-
src/qemu/qemu_migration.c | 1522 +++++++++++++++++++++---------------------
src/qemu/qemu_migration.h | 301 ++++-----
src/qemu/qemu_monitor.c | 10 +-
src/qemu/qemu_monitor.h | 11 +-
src/qemu/qemu_monitor_json.c | 3 +-
src/qemu/qemu_monitor_json.h | 3 +-
src/qemu/qemu_monitor_text.c | 9 +-
src/qemu/qemu_monitor_text.h | 3 +-
src/qemu/qemu_process.c | 154 ++---
src/qemu/qemu_process.h | 12 +-
tests/Makefile.am | 7 +-
tests/qemuhotplugtest.c | 4 +-
tests/qemumonitorjsontest.c | 2 +-
tests/qemuxml2argvtest.c | 11 +-
27 files changed, 1517 insertions(+), 1455 deletions(-)
--
2.14.3
6 years, 10 months
Re: [libvirt] Regarding libvirt patchset "Keep original security label"
by Michal Privoznik
[Adding libvirt-list as others might chime in or when somebody is
solving similar issue they can find answers in the archive.]
On 02/19/2018 10:09 AM, Toni Peltonen wrote:
> Hi,
>
> Sorry to bother you with ages old stuff like this (https://www.redhat.com/archives/libvir-list/2014-September/msg00551.html) patch set.
>
> I did some proof of concept work on my laptop during the weekend with a couple of CentOS 7 virtual machines running shared GFS2 mount (with working dlm locking) and libvirtd + QEMU guests on top of that. I am running the latest libvirtd packages from CentOS upstream.
>
> While I managed to get dlm and global POSIX locking working as expected when I added virtlockd to the picture to actually hold locks for the VM images I ended up getting some gray hair realizing that this ages old security label issue is still present. The situation is basically still the same:
>
> - On a shared filesystem (like GFS2), despite virtlockd locks working as expected, libvirtd still (as expected with current code) tries to change the ownership and security labels of the target file (QCOW2 image)
>
> - This sudden change causes the virtual machine running on the other host to drop as read-only since SELinux starts preventing all write operations for it
>
> - With SELinux in Permissive mode on the host that runs the virtual machine everything work as expected
So you have a disk that is shared between two domains? One way to avoid
the problem is to have <shareable/> in disk definition so that libvirt
doesn't restore disk labels. However, that still might not work for you
because it means that libvirt still changes labels on domain start.
So far the only way to prevent this from happening is using custom
labels https://libvirt.org/formatdomain.html#elementsDisks .
>
>
> I saw that the only code available (that I could easily find and understand) to really tackle this issue was your patch set from as early as 2014. It seems it never hit upstream though, at least I can't find any of the relevant parts in the upstream code.
>
> I am just reaching out to ask whether this patch set was left out intentionally (https://www.redhat.com/archives/libvir-list/2014-September/msg00551.html), just lost in time or if you are aware of any other work that might be in progress to tackle this issue in the upstream?
Unfortunately, the patches were abandoned and the issue is even worse. I
remember having a discussion on this topic lately (although can't recall
where). Turns out, we firstly relabel the disks and only after that we
try to obtain disk locks. So if the latter fails (e.g. because another
domain holds the locks) the lables are changed anyway. The suggested
solution was to have two locks: one for disk contents the other for disk
metadata (like security labels).
Anyway, I don't think there's anybody working on this actively. Sorry.
Michal
6 years, 10 months
[libvirt] [PATCH 0/2] Two blockjob fixes
by Peter Krempa
Peter Krempa (2):
virsh: Fix internal naming of some blockjob commands
qemu: blockcopy: Add check for bandwidth
src/qemu/qemu_driver.c | 8 +++++++
tools/virsh-domain.c | 60 +++++++++++++++++++++++++-------------------------
2 files changed, 38 insertions(+), 30 deletions(-)
--
2.15.0
6 years, 10 months
[libvirt] [jenkins-ci PATCH] projects: Don't run virt-manager's test suite on FreeBSD
by Andrea Bolognani
The libxml2 bindings are broken under Python 3.6, so we have
to disable this for the time being.
Signed-off-by: Andrea Bolognani <abologna(a)redhat.com>
---
projects/virt-manager.yaml | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/projects/virt-manager.yaml b/projects/virt-manager.yaml
index 8f3112e..e626cb0 100644
--- a/projects/virt-manager.yaml
+++ b/projects/virt-manager.yaml
@@ -20,6 +20,14 @@
- python-distutils-check-job:
pyver: 3
parent_jobs: 'virt-manager-master-py{pyver}-build'
+ # libxml2's Python 3 bindings don't work properly on FreeBSD,
+ # so skip the test suite there for the time being. See
+ # https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=224902
+ machines:
+ - libvirt-debian-9
+ - libvirt-fedora-26
+ - libvirt-fedora-27
+ - libvirt-fedora-rawhide
- python-distutils-rpm-job:
pyver: 3
parent_jobs: 'virt-manager-master-py{pyver}-check'
--
2.14.3
6 years, 10 months