[libvirt] [PATCH] qemu: Fix depedency order in qemuRemoveDiskDevice
by John Ferlan
Need to remove the drive first, then the secobj and/or encobj if they exist.
This is because the drive has a dependency on secobj (or the secret for
the networked storage server) and/or the encobj (or the secret for the
LUKS encrypted volume). Deleting either object first leaves an drive
without it's respective objects.
Signed-off-by: John Ferlan <jferlan(a)redhat.com>
---
src/qemu/qemu_hotplug.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
index 7a21dc6..30565d5 100644
--- a/src/qemu/qemu_hotplug.c
+++ b/src/qemu/qemu_hotplug.c
@@ -3176,6 +3176,9 @@ qemuDomainRemoveDiskDevice(virQEMUDriverPtr driver,
qemuDomainObjEnterMonitor(driver, vm);
+ qemuMonitorDriveDel(priv->mon, drivestr);
+ VIR_FREE(drivestr);
+
/* If it fails, then so be it - it was a best shot */
if (objAlias)
ignore_value(qemuMonitorDelObject(priv->mon, objAlias));
@@ -3186,8 +3189,6 @@ qemuDomainRemoveDiskDevice(virQEMUDriverPtr driver,
ignore_value(qemuMonitorDelObject(priv->mon, encAlias));
VIR_FREE(encAlias);
- qemuMonitorDriveDel(priv->mon, drivestr);
- VIR_FREE(drivestr);
if (qemuDomainObjExitMonitor(driver, vm) < 0)
return -1;
--
2.7.4
8 years, 1 month
[libvirt] [PATCH v2 00/12] Add length (duration) params for iotune throttling
by John Ferlan
v1: http://www.redhat.com/archives/libvir-list/2016-September/msg01090.html
Differences since v1:
Patches 1-5 are new...
Patch 1 is essentially the former patch 8.5 added after initial review
based on a review comment. Erik Skultety and I went back and forth
on this one a few times and this is the result
Patch 2 is a result of being frustrated by a generic error message when
I know we could return whatever qemu gives us
Patch 3 is simple code motion - the conf_disk is closer to usage now
Patch 4 & 5 create and use the same algorithm to set the default values
that weren't provided.
Patches 6-7 have already been ACK'd... I've been waiting to push because
they will interfere with libvirt-perl builds and since the 2.3.0 hasn't
been published yet, I'm still holding onto them.
Patch 8 is the former patch 8, but reworked mostly in qemu_driver.c, but
also a change in qemu_monitor_json.c to use "P:" instead of "U:" for
then length values. For _length a 0 is an invalid value, so we'll use
it to mean "nothing changed"
Patch 9 is the former patch 11 and is mostly intact, with major difference
being the removal of the CHECK_IOTUNE_MAX_LENGTH macro (it was causing
domain disappearance)
Patch 10 is the former patch 12 and is unchanged. It also has been ACKd
Patch 11-12 are new - it's the virsh code.
John Ferlan (12):
qemu: Create a macro to handle setting bytes/iops iotune values
qemu: Return real error message for block_set_io_throttle
qemu: Move setting of conf_disk in qemuDomainSetBlockIoTune
qemu: Introduce qemuDomainSetBlockIoTuneSetDefaults
qemu: Use qemuDomainsetBlockIoTuneSetDefaults for config
include: Add new definitions for duration for bps/iops throttling
caps: Add new capability for the bps/iops throttling length
qemu: Add length for bps/iops throttling parameters to driver
conf: Add support for blkiotune "_length" options
qemu: Add the length options to the iotune command line
virsh: Create a macro to add IOTUNE values
virsh: Add _length parameters to virsh output
docs/formatdomain.html.in | 40 ++-
docs/schemas/domaincommon.rng | 38 +++
include/libvirt/libvirt-domain.h | 102 ++++++
src/conf/domain_conf.c | 24 +-
src/conf/domain_conf.h | 6 +
src/qemu/qemu_capabilities.c | 2 +
src/qemu/qemu_capabilities.h | 1 +
src/qemu/qemu_command.c | 21 ++
src/qemu/qemu_driver.c | 341 +++++++++++----------
src/qemu/qemu_monitor.c | 7 +-
src/qemu/qemu_monitor.h | 3 +-
src/qemu/qemu_monitor_json.c | 39 ++-
src/qemu/qemu_monitor_json.h | 3 +-
.../caps_2.6.0-gicv2.aarch64.xml | 1 +
.../caps_2.6.0-gicv3.aarch64.xml | 1 +
tests/qemucapabilitiesdata/caps_2.6.0.ppc64le.xml | 1 +
tests/qemucapabilitiesdata/caps_2.6.0.x86_64.xml | 1 +
tests/qemucapabilitiesdata/caps_2.7.0.x86_64.xml | 1 +
tests/qemumonitorjsontest.c | 17 +-
.../qemuxml2argv-blkdeviotune-max-length.args | 34 ++
.../qemuxml2argv-blkdeviotune-max-length.xml | 65 ++++
tests/qemuxml2argvtest.c | 4 +
.../qemuxml2xmlout-blkdeviotune-max-length.xml | 1 +
tests/qemuxml2xmltest.c | 1 +
tools/virsh-domain.c | 196 +++++-------
tools/virsh.pod | 21 ++
26 files changed, 673 insertions(+), 298 deletions(-)
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-blkdeviotune-max-length.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-blkdeviotune-max-length.xml
create mode 120000 tests/qemuxml2xmloutdata/qemuxml2xmlout-blkdeviotune-max-length.xml
--
2.7.4
8 years, 1 month
Re: [libvirt] question about rdma migration
by Michael R. Hines
Hi Roy,
On 02/09/2016 03:57 AM, Roy Shterman wrote:
> Hi,
>
> I tried to understand the rdma-migration in qemu code and i have two
> questions about it:
>
> 1. I'm working with qemu-kvm using libvirt and i'm getting
>
> MEMLOCK max locked-in-memory address space 65536 65536 bytes
>
> in qemu process so I don't understand how can you use rdma-pin-all
> with such low MEMLOCK.
>
> I found a solution in libvirt to lock all vm memory in advance and to
> enlarge MEMLOCK.
> It uses memoryBacking locking and memory tuning hard_limit of vm
> memory but I couldn't find a usage of this in rdma-migration code.
>
You're absolutey right, the RDMA migration code itself doesn't set this
lock limit explicitly because there are system-wide restrictions in both
appArmour,
/etc/security, as well as SELINUX that restrict applications from
arbitrarily setting their maximum memory lock limits.
The other problem is CGROUPS: If someone sets a cgroup control for
maximum memory and forgets about that mlock() limits, then
there will be a conflict.
So, libvirt must have a policy to deal with all of these possibilities,
not just handle a special case for RDMA migration.
The only way "simple" way (without patching the problems above) to apply
a higher lock limit to QEMU is to set the ulimit for libvirt
(or for QEMU if starting QEMU manually) in your environment or the
command line with $ ulimit # before attempting the migration,
then the RDMA subsystem will be able to lock the memory successfully.
The other option is to use /etc/security/limits.conf and set the option
for a specific libvirt process user and make sure your libvirt/qemu
are not running as root.
QEMU itself also has a "mlock" option built into the command line, but
it also suffers from the same problem --- you have to find
a way (currently) to increase the limit before using the option.
> 2. Do you have any comparison of IOPS and bandwidth between TCP
> migration and rdma migration?
>
Yes, lots of comparisons.
http://wiki.qemu.org/Features/RDMALiveMigration
http://www.canturkisci.com/ETC/papers/IBMJRD2011/preprint.pdf
> Regards,
> Roy
>
>
8 years, 1 month
[libvirt] [PATCH] qemu_driver: unlink new domain cfg file when rollbak
by Chen Hanxiao
From: Chen Hanxiao <chenhanxiao(a)gmail.com>
If we failed to unlink old dom cfg file, we goto rollback.
But inside rollback, we fogot to unlink the new dom cfg file.
This patch fixes this issue.
Signed-off-by: Chen Hanxiao <chenhanxiao(a)gmail.com>
---
src/qemu/qemu_driver.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index e6f845d..3f4a2fb 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -19869,6 +19869,7 @@ qemuDomainRenameCallback(virDomainObjPtr vm,
char *new_dom_name = NULL;
char *old_dom_name = NULL;
char *old_dom_cfg_file = NULL;
+ char *new_dom_cfg_file = NULL;
virCheckFlags(0, ret);
@@ -19882,6 +19883,11 @@ qemuDomainRenameCallback(virDomainObjPtr vm,
goto cleanup;
}
+ if (!(new_dom_cfg_file = virDomainConfigFile(cfg->configDir,
+ new_dom_name))) {
+ goto cleanup;
+ }
+
event_old = virDomainEventLifecycleNewFromObj(vm,
VIR_DOMAIN_EVENT_UNDEFINED,
VIR_DOMAIN_EVENT_UNDEFINED_RENAMED);
@@ -19909,6 +19915,7 @@ qemuDomainRenameCallback(virDomainObjPtr vm,
cleanup:
VIR_FREE(old_dom_cfg_file);
+ VIR_FREE(new_dom_cfg_file);
VIR_FREE(old_dom_name);
VIR_FREE(new_dom_name);
qemuDomainEventQueue(driver, event_old);
@@ -19922,6 +19929,10 @@ qemuDomainRenameCallback(virDomainObjPtr vm,
vm->def->name = old_dom_name;
old_dom_name = NULL;
}
+
+ if (virFileExists(new_dom_cfg_file))
+ unlink(new_dom_cfg_file);
+
goto cleanup;
}
--
1.8.3.1
8 years, 1 month
[libvirt] [PATCH python 1/1] fix crash in libvirt_virDomainPin*
by Konstantin Neumoin
If we pass large(more than cpunum) cpu mask to any libvirt_virDomainPin*
methods, it could leads to crash. So we have to check tuple size and
ignore extra tuple members.
Signed-off-by: Konstantin Neumoin <kneumoin(a)virtuozzo.com>
---
libvirt-override.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/libvirt-override.c b/libvirt-override.c
index fa3e2ca..83b760b 100644
--- a/libvirt-override.c
+++ b/libvirt-override.c
@@ -1327,7 +1327,7 @@ libvirt_virDomainPinVcpu(PyObject *self ATTRIBUTE_UNUSED,
if (VIR_ALLOC_N(cpumap, cpumaplen) < 0)
return PyErr_NoMemory();
- for (i = 0; i < tuple_size; i++) {
+ for (i = 0; i < MIN(cpunum, tuple_size); i++) {
PyObject *flag = PyTuple_GetItem(pycpumap, i);
bool b;
@@ -1392,7 +1392,7 @@ libvirt_virDomainPinVcpuFlags(PyObject *self ATTRIBUTE_UNUSED,
if (VIR_ALLOC_N(cpumap, cpumaplen) < 0)
return PyErr_NoMemory();
- for (i = 0; i < tuple_size; i++) {
+ for (i = 0; i < MIN(cpunum, tuple_size); i++) {
PyObject *flag = PyTuple_GetItem(pycpumap, i);
bool b;
@@ -1532,7 +1532,7 @@ libvirt_virDomainPinEmulator(PyObject *self ATTRIBUTE_UNUSED,
if (VIR_ALLOC_N(cpumap, cpumaplen) < 0)
return PyErr_NoMemory();
- for (i = 0; i < tuple_size; i++) {
+ for (i = 0; i < MIN(cpunum, tuple_size); i++) {
PyObject *flag = PyTuple_GetItem(pycpumap, i);
bool b;
@@ -1738,7 +1738,7 @@ libvirt_virDomainPinIOThread(PyObject *self ATTRIBUTE_UNUSED,
if (VIR_ALLOC_N(cpumap, cpumaplen) < 0)
return PyErr_NoMemory();
- for (i = 0; i < tuple_size; i++) {
+ for (i = 0; i < MIN(cpunum, tuple_size); i++) {
PyObject *flag = PyTuple_GetItem(pycpumap, i);
bool b;
--
2.5.5
8 years, 1 month
[libvirt] [PATCH v4 00/25] Use more PCIe less legacy PCI
by Laine Stump
The latest version of patches to auto-assign appropriate devices in
PCIe-capable domains to PCIe slots rather than legacy PCI, and to also
auto-add pcie-root-ports as necessary to make this easier.
I *think* I've dealt with all of Andrea's great critiques of V3,
either in my email responses or in these revised patches. Aside from
fixing typos and formatting problems, I also moved several "little
cosmetic fixes" out of the bigger functionality-changing patches, and
also split out the most confusing part of patch 20 (previously patch
15 - the one that auto-adds pcie-root-port and dmi-to-pci-bridge
controllers) into its own patch (doubly useful since the value of that
part of the patch is dubious - it is now the [RFC] patch 21)
As many of the simple costmetic patches as possible were pushed up to
the front of the series (if they weren't already there). If those are
ACKed on this round but others aren't, I'll push them immediately so I
don't need to resubmit the whole series again.
Some of these patches were ACKed last time, but I either had to change
them further due to changes in other patches, or I couldn't push them
because they have prerequisites that weren't ACKed. I've marked those
in the subject line (I've also marked entirely new patches in the
subject line).
Laine Stump (25):
qemu: new functions qemuDomainMachineHasPCI[e]Root()
qemu: replace a lot of "def->controllers[i]" with equivalent "cont"
qemu: replace "def->nets[i]" with "net" and "def->sounds[i]" with
"sound"
conf: add typedef for anonymous enum used for memballoon device model
qemu: remove superfluous setting of addrs->nbuses
qemu: make error message in qemuDomainPCIAddressSetCreate more clear.
qemu: change first arg of qemuDomainAttachChrDeviceAssignAddr()
conf: new function virDomainPCIAddressReserveNextAddr()
qemu: use virDomainPCIAddressReserveNextAddr in
qemuDomainAssignDevicePCISlots
conf: make virDomainPCIAddressGetNextSlot() a local static function
qemu: replace calls to virDomainPCIAddressReserveNext*() with static
function
qemu: new functions to calculate/set device pciConnectFlags
qemu: set/use info->pciConnectFlags when validating/assigning PCI
addresses
qemu: set/use proper pciConnectFlags during hotplug
qemu: set pciConnectFlags to 0 instead of PCI|HOTPLUGGABLE if device
isn't PCI
qemu: assign virtio devices to PCIe slot when appropriate
qemu: assign e1000e network devices to PCIe slots when appropriate
qemu: assign nec-xhci (USB3) controller to a PCIe address when
appropriate
qemu: only force an available legacy-PCI slot on domains with pci-root
qemu: auto-add pcie-root-port/dmi-to-pci-bridge controllers as needed
[RFC] qemu: if pci-bridge is in PCIe config w/o dmi-to-pci-bridge, add
it
qemu: don't force-add a dmi-to-pci-bridge just on principle
qemu: add a USB3 controller to Q35 domains by default
qemu: try to put ich9 sound device at 00:1B.0
qemu: initially reserve one open pcie-root-port for hotplug
src/conf/device_conf.h | 5 +
src/conf/domain_addr.c | 163 ++-
src/conf/domain_addr.h | 11 +-
src/conf/domain_conf.h | 4 +-
src/libvirt_private.syms | 2 +-
src/qemu/qemu_domain.c | 52 +-
src/qemu/qemu_domain.h | 2 +
src/qemu/qemu_domain_address.c | 1097 +++++++++++++++-----
src/qemu/qemu_domain_address.h | 4 +
src/qemu/qemu_hotplug.c | 27 +-
tests/qemuxml2argvdata/qemuxml2argv-autoindex.args | 10 +-
.../qemuxml2argv-bios-nvram-secure.args | 1 +
.../qemuxml2argv-machine-smm-opt.args | 1 +
tests/qemuxml2argvdata/qemuxml2argv-pcie-root.args | 3 +-
.../qemuxml2argv-q35-default-devices-only.args | 23 +
.../qemuxml2argv-q35-default-devices-only.xml | 18 +
.../qemuxml2argv-q35-pcie-autoadd.args | 57 +
.../qemuxml2argv-q35-pcie-autoadd.xml | 51 +
tests/qemuxml2argvdata/qemuxml2argv-q35-pcie.args | 58 ++
tests/qemuxml2argvdata/qemuxml2argv-q35-pcie.xml | 67 ++
.../qemuxml2argv-q35-pm-disable-fallback.args | 1 +
.../qemuxml2argv-q35-pm-disable.args | 1 +
.../qemuxml2argv-q35-virt-manager-basic.args | 56 +
.../qemuxml2argv-q35-virt-manager-basic.xml | 76 ++
.../qemuxml2argv-q35-virtio-pci.args | 58 ++
.../qemuxml2argv-q35-virtio-pci.xml | 1 +
tests/qemuxml2argvtest.c | 164 ++-
.../qemuxml2xmlout-autoindex.xml | 10 +-
.../qemuxml2xmlout-pcie-root.xml | 4 -
.../qemuxml2xmlout-q35-default-devices-only.xml | 45 +
.../qemuxml2xmlout-q35-pcie-autoadd.xml | 148 +++
.../qemuxml2xmloutdata/qemuxml2xmlout-q35-pcie.xml | 152 +++
.../qemuxml2xmlout-q35-virt-manager-basic.xml | 121 +++
.../qemuxml2xmlout-q35-virtio-pci.xml | 152 +++
tests/qemuxml2xmltest.c | 136 ++-
35 files changed, 2417 insertions(+), 364 deletions(-)
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-q35-default-devices-only.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-q35-default-devices-only.xml
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-q35-pcie-autoadd.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-q35-pcie-autoadd.xml
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-q35-pcie.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-q35-pcie.xml
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-q35-virt-manager-basic.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-q35-virt-manager-basic.xml
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-q35-virtio-pci.args
create mode 120000 tests/qemuxml2argvdata/qemuxml2argv-q35-virtio-pci.xml
create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-q35-default-devices-only.xml
create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-q35-pcie-autoadd.xml
create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-q35-pcie.xml
create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-q35-virt-manager-basic.xml
create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-q35-virtio-pci.xml
--
2.7.4
8 years, 1 month
[libvirt] [RFC] qemu: Use virtio-pci by default for mach-virt guests
by Andrea Bolognani
virtio-pci is the way forward for aarch64 guests: it's faster
and less alien to people coming from other architectures.
Now that guest support is finally getting there, we'd like to
start using it by default instead of virtio-mmio.
Users and applications can already opt-in by explicitly using
<address type='pci'/>
inside the relevant elements, but that's kinda cumbersome and
requires all users and management applications to adapt, which
we'd really like to avoid.
What we can do instead is use virtio-mmio only if the guest
already has at least one virtio-mmio device, and use virtio-pci
in all other situations.
That means existing virtio-mmio guests will keep using the old
addressing scheme, and new guests will automatically be created
using virtio-pci instead. Users can still override the default
in either direction.
---
Sending this as an RFC for the time being because it clearly
needs some more polish, but I wanted to get the idea out
there sooner rather than later.
It needs to be applied on top of Laine's PCI series[1].
[1] https://www.redhat.com/archives/libvir-list/2016-October/msg00699.html
src/qemu/qemu_domain_address.c | 128 ++++++++++++++++++++-
...l2argv-aarch64-virt-2.6-virtio-pci-default.args | 14 ++-
.../qemuxml2argv-aarch64-virtio-pci-default.args | 14 ++-
.../qemuxml2xmlout-aarch64-virtio-pci-default.xml | 24 +++-
4 files changed, 162 insertions(+), 18 deletions(-)
diff --git a/src/qemu/qemu_domain_address.c b/src/qemu/qemu_domain_address.c
index f27d1e3..7f07764 100644
--- a/src/qemu/qemu_domain_address.c
+++ b/src/qemu/qemu_domain_address.c
@@ -265,6 +265,118 @@ qemuDomainAssignSpaprVIOAddresses(virDomainDefPtr def,
}
+static bool
+qemuDomainAnyDeviceHasAddressOfType(virDomainDefPtr def,
+ virDomainDeviceAddressType type)
+{
+ size_t i;
+
+ for (i = 0; i < def->ndisks; i++) {
+ if (def->disks[i]->info.type == type)
+ return true;
+ }
+
+ for (i = 0; i < def->ncontrollers; i++) {
+ if (def->controllers[i]->info.type == type)
+ return true;
+ }
+
+ for (i = 0; i < def->nfss; i++) {
+ if (def->fss[i]->info.type == type)
+ return true;
+ }
+
+ for (i = 0; i < def->nnets; i++) {
+ if (def->nets[i]->info.type == type)
+ return true;
+ }
+
+ for (i = 0; i < def->ninputs; i++) {
+ if (def->inputs[i]->info.type == type)
+ return true;
+ }
+
+ for (i = 0; i < def->nsounds; i++) {
+ if (def->sounds[i]->info.type == type)
+ return true;
+ }
+
+ for (i = 0; i < def->nvideos; i++) {
+ if (def->videos[i]->info.type == type)
+ return true;
+ }
+
+ for (i = 0; i < def->nhostdevs; i++) {
+ if (def->hostdevs[i]->info->type == type)
+ return true;
+ }
+
+ for (i = 0; i < def->nredirdevs; i++) {
+ if (def->redirdevs[i]->info.type == type)
+ return true;
+ }
+
+ for (i = 0; i < def->nsmartcards; i++) {
+ if (def->smartcards[i]->info.type == type)
+ return true;
+ }
+
+ for (i = 0; i < def->nserials; i++) {
+ if (def->serials[i]->info.type == type)
+ return true;
+ }
+
+ for (i = 0; i < def->nparallels; i++) {
+ if (def->parallels[i]->info.type == type)
+ return true;
+ }
+
+ for (i = 0; i < def->nchannels; i++) {
+ if (def->channels[i]->info.type == type)
+ return true;
+ }
+
+ for (i = 0; i < def->nconsoles; i++) {
+ if (def->consoles[i]->info.type == type)
+ return true;
+ }
+
+ for (i = 0; i < def->nhubs; i++) {
+ if (def->hubs[i]->info.type == type)
+ return true;
+ }
+
+ for (i = 0; i < def->nrngs; i++) {
+ if (def->rngs[i]->info.type == type)
+ return true;
+ }
+
+ for (i = 0; i < def->nshmems; i++) {
+ if (def->shmems[i]->info.type == type)
+ return true;
+ }
+
+ for (i = 0; i < def->nmems; i++) {
+ if (def->mems[i]->info.type == type)
+ return true;
+ }
+
+ if (def->memballoon && def->memballoon->info.type == type)
+ return true;
+
+ if (def->watchdog && def->watchdog->info.type == type)
+ return true;
+
+ if (def->nvram && def->nvram->info.type == type)
+ return true;
+
+ if (def->tpm && def->tpm->info.type == type)
+ return true;
+
+ return false;
+}
+
+
static void
qemuDomainPrimeVirtioDeviceAddresses(virDomainDefPtr def,
virDomainDeviceAddressType type)
@@ -390,6 +502,8 @@ static void
qemuDomainAssignARMVirtioMMIOAddresses(virDomainDefPtr def,
virQEMUCapsPtr qemuCaps)
{
+ bool usesMMIO;
+
if (def->os.arch != VIR_ARCH_ARMV7L &&
def->os.arch != VIR_ARCH_AARCH64)
return;
@@ -398,9 +512,17 @@ qemuDomainAssignARMVirtioMMIOAddresses(virDomainDefPtr def,
qemuDomainMachineIsVirt(def)))
return;
- if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VIRTIO_MMIO)) {
- qemuDomainPrimeVirtioDeviceAddresses(
- def, VIR_DOMAIN_DEVICE_ADDRESS_TYPE_VIRTIO_MMIO);
+ /* We use virtio-mmio by default on mach-virt guests only if they already
+ * have at least one virtio-mmio device: in all other cases, we prefer
+ * virtio-pci */
+ usesMMIO = qemuDomainAnyDeviceHasAddressOfType(def,
+ VIR_DOMAIN_DEVICE_ADDRESS_TYPE_VIRTIO_MMIO);
+ if (qemuDomainMachineHasPCIeRoot(def) && !usesMMIO) {
+ qemuDomainPrimeVirtioDeviceAddresses(def,
+ VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI);
+ } else if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VIRTIO_MMIO)) {
+ qemuDomainPrimeVirtioDeviceAddresses(def,
+ VIR_DOMAIN_DEVICE_ADDRESS_TYPE_VIRTIO_MMIO);
}
}
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-virt-2.6-virtio-pci-default.args b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-virt-2.6-virtio-pci-default.args
index 75db1a4..df03c6e 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-virt-2.6-virtio-pci-default.args
+++ b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-virt-2.6-virtio-pci-default.args
@@ -21,14 +21,18 @@ QEMU_AUDIO_DRV=none \
-initrd /aarch64.initrd \
-append 'earlyprintk console=ttyAMA0,115200n8 rw root=/dev/vda rootwait' \
-dtb /aarch64.dtb \
--device virtio-serial-device,id=virtio-serial0 \
+-device i82801b11-bridge,id=pci.1,bus=pcie.0,addr=0x1 \
+-device pci-bridge,chassis_nr=2,id=pci.2,bus=pci.1,addr=0x0 \
+-device ioh3420,port=0x10,chassis=3,id=pci.3,bus=pcie.0,addr=0x2 \
+-device virtio-serial-pci,id=virtio-serial0,bus=pci.2,addr=0x2 \
-drive file=/aarch64.raw,format=raw,if=none,id=drive-virtio-disk0 \
--device virtio-blk-device,drive=drive-virtio-disk0,id=virtio-disk0 \
--device virtio-net-device,vlan=0,id=net0,mac=52:54:00:09:a4:37 \
+-device virtio-blk-pci,bus=pci.2,addr=0x3,drive=drive-virtio-disk0,\
+id=virtio-disk0 \
+-device virtio-net-pci,vlan=0,id=net0,mac=52:54:00:09:a4:37,bus=pci.2,addr=0x1 \
-net user,vlan=0,name=hostnet0 \
-serial pty \
-chardev pty,id=charconsole1 \
-device virtconsole,chardev=charconsole1,id=console1 \
--device virtio-balloon-device,id=balloon0 \
+-device virtio-balloon-pci,id=balloon0,bus=pci.2,addr=0x4 \
-object rng-random,id=objrng0,filename=/dev/random \
--device virtio-rng-device,rng=objrng0,id=rng0
+-device virtio-rng-pci,rng=objrng0,id=rng0,bus=pci.2,addr=0x5
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-virtio-pci-default.args b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-virtio-pci-default.args
index b5b010c..f205d9a 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-virtio-pci-default.args
+++ b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-virtio-pci-default.args
@@ -21,14 +21,18 @@ QEMU_AUDIO_DRV=none \
-initrd /aarch64.initrd \
-append 'earlyprintk console=ttyAMA0,115200n8 rw root=/dev/vda rootwait' \
-dtb /aarch64.dtb \
--device virtio-serial-device,id=virtio-serial0 \
+-device i82801b11-bridge,id=pci.1,bus=pcie.0,addr=0x1 \
+-device pci-bridge,chassis_nr=2,id=pci.2,bus=pci.1,addr=0x0 \
+-device ioh3420,port=0x10,chassis=3,id=pci.3,bus=pcie.0,addr=0x2 \
+-device virtio-serial-pci,id=virtio-serial0,bus=pci.2,addr=0x2 \
-drive file=/aarch64.raw,format=raw,if=none,id=drive-virtio-disk0 \
--device virtio-blk-device,drive=drive-virtio-disk0,id=virtio-disk0 \
--device virtio-net-device,vlan=0,id=net0,mac=52:54:00:09:a4:37 \
+-device virtio-blk-pci,bus=pci.2,addr=0x3,drive=drive-virtio-disk0,\
+id=virtio-disk0 \
+-device virtio-net-pci,vlan=0,id=net0,mac=52:54:00:09:a4:37,bus=pci.2,addr=0x1 \
-net user,vlan=0,name=hostnet0 \
-serial pty \
-chardev pty,id=charconsole1 \
-device virtconsole,chardev=charconsole1,id=console1 \
--device virtio-balloon-device,id=balloon0 \
+-device virtio-balloon-pci,id=balloon0,bus=pci.2,addr=0x4 \
-object rng-random,id=objrng0,filename=/dev/random \
--device virtio-rng-device,rng=objrng0,id=rng0
+-device virtio-rng-pci,rng=objrng0,id=rng0,bus=pci.2,addr=0x5
diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-aarch64-virtio-pci-default.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-aarch64-virtio-pci-default.xml
index 7c3fc19..90659a1 100644
--- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-aarch64-virtio-pci-default.xml
+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-aarch64-virtio-pci-default.xml
@@ -30,16 +30,30 @@
<disk type='file' device='disk'>
<source file='/aarch64.raw'/>
<target dev='vda' bus='virtio'/>
- <address type='virtio-mmio'/>
+ <address type='pci' domain='0x0000' bus='0x02' slot='0x03' function='0x0'/>
</disk>
<controller type='pci' index='0' model='pcie-root'/>
<controller type='virtio-serial' index='0'>
- <address type='virtio-mmio'/>
+ <address type='pci' domain='0x0000' bus='0x02' slot='0x02' function='0x0'/>
+ </controller>
+ <controller type='pci' index='1' model='dmi-to-pci-bridge'>
+ <model name='i82801b11-bridge'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/>
+ </controller>
+ <controller type='pci' index='2' model='pci-bridge'>
+ <model name='pci-bridge'/>
+ <target chassisNr='2'/>
+ <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/>
+ </controller>
+ <controller type='pci' index='3' model='pcie-root-port'>
+ <model name='ioh3420'/>
+ <target chassis='3' port='0x10'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
</controller>
<interface type='user'>
<mac address='52:54:00:09:a4:37'/>
<model type='virtio'/>
- <address type='virtio-mmio'/>
+ <address type='pci' domain='0x0000' bus='0x02' slot='0x01' function='0x0'/>
</interface>
<serial type='pty'>
<target port='0'/>
@@ -51,11 +65,11 @@
<target type='virtio' port='1'/>
</console>
<memballoon model='virtio'>
- <address type='virtio-mmio'/>
+ <address type='pci' domain='0x0000' bus='0x02' slot='0x04' function='0x0'/>
</memballoon>
<rng model='virtio'>
<backend model='random'>/dev/random</backend>
- <address type='virtio-mmio'/>
+ <address type='pci' domain='0x0000' bus='0x02' slot='0x05' function='0x0'/>
</rng>
</devices>
</domain>
--
2.7.4
8 years, 1 month
[libvirt] how to install and remove Libvirt cleanly
by zhunxun@gmail.com
I just want to know how to uninstall Libvirt which installed by source code cleanly.because I found make uninstall can not remove all the installed file.so that I install it later failed.
zhunxun(a)gmail.com
8 years, 1 month
[libvirt] [PATCH 0/4] Add VCPU halted to domain statistics
by Viktor Mihajlovski
As a result of the discussions on
https://www.redhat.com/archives/libvir-list/2016-October/msg00531.html:
In order to be able to report the per VCPU halted condition as returned
by the QEMU monitor this series extends the VCPU-specific domain
statistics with a vcpu.n.halted value.
This is done by
- extending the monitor to pass back the halted condition for the vcpus
- adding a new field to the private domain vcpu object reflecting the
halted condition for the vcpu
- modifying the driver code to report the new VCPU domain statistics value
The halted condition is however not recorded in the internal XML format, since
the state can change asynchronously (without notification).
Patches 1/4 and 2/4 are taken without modifications from the original
posting. In 4/4 I've only updated virsh.pod as I didn't want to
touch libvirt-domain.c in this context just for documentation purposes.
Viktor Mihajlovski (4):
qemu: Add monitor support for CPU halted state
qemu: Add domain support for VCPU halted state
qemu: add vcpu.n.halted to vcpu domain stats
doc: update virsh domstats documentation for vcpu statistics
src/qemu/qemu_domain.c | 66 ++++++++++++++++++++++++++++++++++++++++++++
src/qemu/qemu_domain.h | 5 ++++
src/qemu/qemu_driver.c | 34 ++++++++++++++++++++---
src/qemu/qemu_monitor.c | 6 +++-
src/qemu/qemu_monitor.h | 3 ++
src/qemu/qemu_monitor_json.c | 3 ++
src/qemu/qemu_monitor_text.c | 8 +++++-
tests/qemumonitorjsontest.c | 8 +++---
tools/virsh.pod | 7 +++++
9 files changed, 130 insertions(+), 10 deletions(-)
--
1.9.1
8 years, 1 month
[libvirt] [jenkins-ci PATCH] jobs: change maintainer email address
by Pavel Hrdina
Signed-off-by: Pavel Hrdina <phrdina(a)redhat.com>
---
Pushed as trivial.
jobs/defaults.yaml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/jobs/defaults.yaml b/jobs/defaults.yaml
index 23d9ae7..b21bff3 100644
--- a/jobs/defaults.yaml
+++ b/jobs/defaults.yaml
@@ -9,4 +9,4 @@
MAKE='gmake'
fi
smp: 3
- spam: shajyan(a)redhat.com libvirt-ci(a)redhat.com
+ spam: ymankad(a)redhat.com libvirt-ci(a)redhat.com
--
2.10.1
8 years, 1 month