[libvirt] [PATCH 0/4] Remove 'bootHash'
by Ján Tomko
An alternative to Peter's:
[PATCH 1/4] conf: domain: Remove code accessing 'bootHash' from the post-parse infrestructure
<8b4627fedd199117af1ab46f5562e3838679357e.1527500017.git.pkrempa(a)redhat.com>
Ján Tomko (3):
vmx: add VIR_DOMAIN_DEF_FEATURE_NO_BOOT_ORDER
conf: introduce virDomainDefCheckBootOrder
conf: remove 'bootHash' completely
Peter Krempa (1):
conf: remove 'bootHash' from the post-parse infrastructure
src/conf/domain_conf.c | 209 +++++++++++++++------------
src/conf/domain_conf.h | 1 +
src/vmx/vmx.c | 3 +-
tests/qemuargv2xmldata/nomachine-aarch64.xml | 1 +
tests/qemuargv2xmldata/nomachine-ppc64.xml | 1 +
tests/qemuargv2xmldata/nomachine-x86_64.xml | 1 +
tests/sexpr2xmldata/sexpr2xml-fv-kernel.xml | 1 +
7 files changed, 120 insertions(+), 97 deletions(-)
--
2.16.1
6 years, 6 months
[libvirt] [PATCH] qemu: Don't build cache= cmd line for scsi-block
by Michal Privoznik
Trying to set any cache for <disk device='lun'/> makes no sense.
Such disk translates into -device scsi-block on the command line
and the device lacks any cache setting because it's merely a
middle man between qemu and real SCSI device.
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
src/qemu/qemu_command.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 7408f6bc70..c7ff074e29 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -1824,6 +1824,11 @@ qemuBuildDriveDevCacheStr(virDomainDiskDefPtr disk,
if (disk->cachemode == VIR_DOMAIN_DISK_CACHE_DEFAULT)
return 0;
+ /* VIR_DOMAIN_DISK_DEVICE_LUN translates into 'scsi-block'
+ * where any caching setting makes no sense. */
+ if (disk->device == VIR_DOMAIN_DISK_DEVICE_LUN)
+ return 0;
+
if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_DISK_WRITE_CACHE))
return 0;
--
2.16.1
6 years, 6 months
[libvirt] [PATCH 0/4] conf: Invoke post-parse callbacks after parsing private XML
by Peter Krempa
This will allow the qemu post-parse callbacks to access 'qemuCaps' which
is stored in the status XML when we restore the status of VMs.
It will become useful in cases when we need to decide whether storage
authentication/encryption secret aliases will need to be regenerated.
Peter Krempa (4):
conf: domain: Remove code accessing 'bootHash' from the post-parse
infrestructure
conf: domain: Invoke post-parse callbacks after parsing private XML
parts
conf: domain: Allow passing in 'parseOpaque' for post-parse of status
XML
qemu: domain: Pass 'qemuCaps' to post parse callbacks when parsing
status XML
src/conf/domain_conf.c | 97 ++++++++++++++++++++++++++------------------------
src/conf/domain_conf.h | 5 +++
src/qemu/qemu_domain.c | 10 ++++++
3 files changed, 65 insertions(+), 47 deletions(-)
--
2.16.2
6 years, 6 months
[libvirt] [PATCHv2 0/3] Finish the conversion to virConfGetValue* functions
by Fabiano Fidêncio
This patchset finishes the conversion to virConfGetValue* functions,
started by Daniel Berrange a few months ago.
Please, mind that although we could make virConfGetValue* functions more
generic in order to support numbers and booleans as strings, that
doesn't seem the safest path to take. The side-effect of this is that we
will have to live with some specific code doing that as part of vmx and
xen_common.
Once this patchset gets merged,
https://wiki.libvirt.org/page/BiteSizedTasks#Finish_conversion_to_virConf...
can be removed.
- Changes since v1:
All the "values" from virConfGetValueString() are freed
Fabiano Fidêncio (3):
xen_vm: convert to typesafe virConf accessors
vmx: convert to typesafe virConf accessors
xen_common: convert to typesafe virConf accessors
src/vmx/vmx.c | 196 ++++++--------
src/xenconfig/xen_common.c | 637 ++++++++++++++++++++++-----------------------
src/xenconfig/xen_xm.c | 268 ++++++++++---------
3 files changed, 512 insertions(+), 589 deletions(-)
--
2.14.3
6 years, 6 months
[libvirt] [PATCH v2 00/12] Introduce virDomainDetachDeviceAlias
by Michal Privoznik
v2 of:
https://www.redhat.com/archives/libvir-list/2018-May/msg01530.html
diff to v1:
- The semantic is changed a bit. Now it's "send request" only, and users
have to listen for DEVICE_DELETED event. They would have to do that
anyway.
- Couple of more fixes related to asynchronous behaviour
Michal Privoznik (12):
Introduce virDomainDetachDeviceAlias API
remote: Implement virDomainDetachDeviceAlias
virsh: Expose virDomainDetachDeviceAlias
qemuDomainRemoveChrDevice: Release device address
qemuDomainDetachShmemDevice: Don't release shmem address twice
qemuDomainDetachWatchdog: Don't release watchdog address twice
qemu_hotplug: Use more gotos in qemuDomainDetach*Device
qemuDomainDetachDeviceLiveAndConfig: Don't use driver->caps directly
qemuDomainDetachDeviceLiveAndConfig: Avoid overwriting @ret
qemu_hotplug: Allow asynchronous detach
qemu: Implement virDomainDetachDeviceAlias
news: Document new API introduction
docs/news.xml | 8 ++
include/libvirt/libvirt-domain.h | 3 +
src/driver-hypervisor.h | 6 +
src/libvirt-domain.c | 53 ++++++++
src/libvirt_public.syms | 5 +
src/qemu/qemu_driver.c | 162 +++++++++++++++++++----
src/qemu/qemu_hotplug.c | 278 +++++++++++++++++++++++++--------------
src/qemu/qemu_hotplug.h | 33 +++--
src/remote/remote_driver.c | 1 +
src/remote/remote_protocol.x | 16 ++-
src/remote_protocol-structs | 6 +
tests/qemuhotplugtest.c | 13 +-
tools/virsh-domain.c | 72 ++++++++++
tools/virsh.pod | 12 ++
14 files changed, 525 insertions(+), 143 deletions(-)
--
2.16.1
6 years, 6 months
[libvirt] [PATCH] nwfilter: fix IP address learning
by Daniel P. Berrangé
In a previous commit:
commit d4bf8f415074759baf051644559e04fe78888f8b
Author: Daniel P. Berrangé <berrange(a)redhat.com>
Date: Wed Feb 14 09:43:59 2018 +0000
nwfilter: handle missing switch enum cases
Ensure all enum cases are listed in switch statements, or cast away
enum type in places where we don't wish to cover all cases.
Reviewed-by: John Ferlan <jferlan(a)redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange(a)redhat.com>
we changed a switch in the nwfilter learning thread so that it had
explict cases for all enum entries. Unfortunately the parameters in the
method had been declared with incorrect type. The "howDetect" parameter
does *not* accept "enum howDetect" values, rather it accepts a bitmask
of "enum howDetect" values, so it should have been an "int" type.
The caller always passes DETECT_STATIC|DETECT_DHCP, so essentially the
IP addressing learning was completely broken by the above change, as it
never matched any switch case, hitting the default leading to EINVAL.
Signed-off-by: Daniel P. Berrangé <berrange(a)redhat.com>
---
src/nwfilter/nwfilter_learnipaddr.c | 13 ++++++-------
src/nwfilter/nwfilter_learnipaddr.h | 2 +-
2 files changed, 7 insertions(+), 8 deletions(-)
diff --git a/src/nwfilter/nwfilter_learnipaddr.c b/src/nwfilter/nwfilter_learnipaddr.c
index cc3bfd971c..061b39d72b 100644
--- a/src/nwfilter/nwfilter_learnipaddr.c
+++ b/src/nwfilter/nwfilter_learnipaddr.c
@@ -144,7 +144,7 @@ struct _virNWFilterIPAddrLearnReq {
char *filtername;
virHashTablePtr filterparams;
virNWFilterDriverStatePtr driver;
- enum howDetect howDetect;
+ int howDetect; /* bitmask of enum howDetect */
int status;
volatile bool terminate;
@@ -442,23 +442,22 @@ learnIPAddressThread(void *arg)
if (techdriver->applyDHCPOnlyRules(req->ifname,
&req->macaddr,
NULL, false) < 0) {
+ VIR_DEBUG("Unable to apply DHCP only rules");
req->status = EINVAL;
goto done;
}
virBufferAddLit(&buf, "src port 67 and dst port 68");
break;
- case DETECT_STATIC:
+ default:
if (techdriver->applyBasicRules(req->ifname,
&req->macaddr) < 0) {
+ VIR_DEBUG("Unable to apply basic rules");
req->status = EINVAL;
goto done;
}
virBufferAsprintf(&buf, "ether host %s or ether dst ff:ff:ff:ff:ff:ff",
macaddr);
break;
- default:
- req->status = EINVAL;
- goto done;
}
if (virBufferError(&buf)) {
@@ -693,7 +692,7 @@ learnIPAddressThread(void *arg)
* once its IP address has been detected
* @driver : the network filter driver
* @howDetect : the method on how the thread is supposed to detect the
- * IP address; must choose any of the available flags
+ * IP address; bitmask of "enum howDetect" flags.
*
* Instruct to learn the IP address being used on a given interface (ifname).
* Unless there already is a thread attempting to learn the IP address
@@ -711,7 +710,7 @@ virNWFilterLearnIPAddress(virNWFilterTechDriverPtr techdriver,
const char *filtername,
virHashTablePtr filterparams,
virNWFilterDriverStatePtr driver,
- enum howDetect howDetect)
+ int howDetect)
{
int rc;
virThread thread;
diff --git a/src/nwfilter/nwfilter_learnipaddr.h b/src/nwfilter/nwfilter_learnipaddr.h
index 06fea5bff8..753aabc594 100644
--- a/src/nwfilter/nwfilter_learnipaddr.h
+++ b/src/nwfilter/nwfilter_learnipaddr.h
@@ -43,7 +43,7 @@ int virNWFilterLearnIPAddress(virNWFilterTechDriverPtr techdriver,
const char *filtername,
virHashTablePtr filterparams,
virNWFilterDriverStatePtr driver,
- enum howDetect howDetect);
+ int howDetect);
bool virNWFilterHasLearnReq(int ifindex);
int virNWFilterTerminateLearnReq(const char *ifname);
--
2.17.0
6 years, 6 months
[libvirt] [PATCH 0/3] Finish the conversion to virConfGetValue* functions
by Fabiano Fidêncio
This patchset finishes the conversion to virConfGetValue* functions,
started by Daniel Berrange a few months ago.
Please, mind that although we could make virConfGetValue* functions more
generic in order to support numbers and booleans as strings, that
doesn't seem the safest path to take. The side-effect of this is that we
will have to live with some specific code doing that as part of vmx and
xen_common.
Fabiano Fidêncio (3):
xen_vm: convert to typesafe virConf accessors
vmx: convert to typesafe virConf accessors
xen_common: convert to typesafe virConf accessors
src/vmx/vmx.c | 197 +++++-------
src/xenconfig/xen_common.c | 631 ++++++++++++++++++-------------------
src/xenconfig/xen_xm.c | 268 ++++++++--------
3 files changed, 504 insertions(+), 592 deletions(-)
--
2.17.0
6 years, 6 months
[libvirt] [PATCH] tools: virsh: Add virshCellnoCompleter.
by Roland Schulz
Signed-off-by: Roland Schulz <schullzroll(a)gmail.com>
---
tools/virsh-completer.c | 59 +++++++++++++++++++++++++++++++++++++++++
tools/virsh-completer.h | 3 +++
tools/virsh-host.c | 3 +++
3 files changed, 65 insertions(+)
diff --git a/tools/virsh-completer.c b/tools/virsh-completer.c
index 5713a887e..ce152226f 100644
--- a/tools/virsh-completer.c
+++ b/tools/virsh-completer.c
@@ -756,3 +756,62 @@ virshNodedevEventNameCompleter(vshControl *ctl ATTRIBUTE_UNUSED,
virStringListFree(ret);
return NULL;
}
+
+
+char **
+virshCellnoCompleter(vshControl *ctl,
+ const vshCmd *cmd ATTRIBUTE_UNUSED,
+ unsigned int flags)
+{
+ xmlXPathContextPtr ctxt = NULL;
+ virshControlPtr priv = ctl->privData;
+ unsigned int ncells = 0;
+ xmlNodePtr *cells = NULL;
+ xmlDocPtr doc = NULL;
+ size_t i = 0;
+ char *cap_xml = NULL;
+ char *cellid = NULL;
+ char **ret = NULL;
+
+ virCheckFlags(0, NULL);
+
+ if (!priv->conn || virConnectIsAlive(priv->conn) <= 0)
+ goto error;
+
+ if (!(cap_xml = virConnectGetCapabilities(priv->conn)))
+ goto error;
+
+ if (!(doc = virXMLParseStringCtxt(cap_xml, _("capabilities"), &ctxt)))
+ goto error;
+
+ ncells = virXPathNodeSet("/capabilities/host/topology/cells/cell", ctxt, &cells);
+ if (ncells <= 0)
+ goto error;
+
+ if (VIR_ALLOC_N(ret, ncells + 1))
+ goto error;
+
+ for (i = 0; i < ncells; i++) {
+ VIR_FREE(cellid);
+ cellid = virXMLPropString(cells[i], "id");
+ if (VIR_STRDUP(ret[i], cellid) < 0)
+ goto error;
+ }
+
+ cleanup:
+ xmlXPathFreeContext(ctxt);
+ VIR_FREE(cells);
+ xmlFreeDoc(doc);
+ VIR_FREE(cap_xml);
+ VIR_FREE(cellid);
+
+ return ret;
+
+ error:
+ if (ret) {
+ for (i = 0; i < ncells; i++)
+ VIR_FREE(ret[i]);
+ }
+ VIR_FREE(ret);
+ goto cleanup;
+}
diff --git a/tools/virsh-completer.h b/tools/virsh-completer.h
index 86632ee91..ee7eec68c 100644
--- a/tools/virsh-completer.h
+++ b/tools/virsh-completer.h
@@ -94,4 +94,7 @@ char ** virshNodedevEventNameCompleter(vshControl *ctl,
const vshCmd *cmd,
unsigned int flags);
+char ** virshCellnoCompleter(vshControl *ctl,
+ const vshCmd *cmd,
+ unsigned int flags);
#endif
diff --git a/tools/virsh-host.c b/tools/virsh-host.c
index 12c13f522..991c0f50a 100644
--- a/tools/virsh-host.c
+++ b/tools/virsh-host.c
@@ -149,6 +149,7 @@ static const vshCmdInfo info_freecell[] = {
static const vshCmdOptDef opts_freecell[] = {
{.name = "cellno",
.type = VSH_OT_INT,
+ .completer = virshCellnoCompleter,
.help = N_("NUMA cell number")
},
{.name = "all",
@@ -274,6 +275,7 @@ static const vshCmdInfo info_freepages[] = {
static const vshCmdOptDef opts_freepages[] = {
{.name = "cellno",
.type = VSH_OT_INT,
+ .completer = virshCellnoCompleter,
.help = N_("NUMA cell number")
},
{.name = "pagesize",
@@ -483,6 +485,7 @@ static const vshCmdOptDef opts_allocpages[] = {
},
{.name = "cellno",
.type = VSH_OT_INT,
+ .completer = virshCellnoCompleter,
.help = N_("NUMA cell number")
},
{.name = "add",
--
2.17.0
6 years, 6 months
[libvirt] [tck PATCH 0/3] Some misc fixes
by Daniel P. Berrangé
Just random things i found while testing the TCK against current git
Daniel P. Berrangé (3):
scripts: avoid using multicast MAC addresses
scripts: strip quotes from URI before checking it
scripts: fix block info test conditions
scripts/domain/121-block-info.t | 5 ++---
scripts/domain/215-nic-hotplug-many.t | 6 +++---
scripts/nwfilter/nwfilter2vmtest.sh | 2 +-
scripts/nwfilter/nwfilter_concurrent.sh | 2 +-
4 files changed, 7 insertions(+), 8 deletions(-)
--
2.17.0
6 years, 6 months