[libvirt] [PATCH] qemu: fix remote port searching
by Martin Kletzander
After fixing the last review comments on remote port searching (commit
a14b4aea512d6c3a42af56207a65ef10ac4a12a1), the commit right after that
wasn't modified accordingly, therefore two values weren't changed as
they should and the configurable ports don't work as expected.
This simple commit changes last two values missed and fixes the issue.
---
This time I double checked that it does what it should!
src/qemu/qemu_process.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index 7f85aea..5c3b89e 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -3467,7 +3467,7 @@ int qemuProcessStart(virConnectPtr conn,
if (vm->def->graphics[0]->type == VIR_DOMAIN_GRAPHICS_TYPE_VNC &&
!vm->def->graphics[0]->data.vnc.socket &&
vm->def->graphics[0]->data.vnc.autoport) {
- int port = qemuProcessNextFreePort(driver, QEMU_REMOTE_PORT_MIN);
+ int port = qemuProcessNextFreePort(driver, driver->remotePortMin);
if (port < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
"%s", _("Unable to find an unused port for VNC"));
@@ -3478,7 +3478,7 @@ int qemuProcessStart(virConnectPtr conn,
int port = -1;
if (vm->def->graphics[0]->data.spice.autoport ||
vm->def->graphics[0]->data.spice.port == -1) {
- port = qemuProcessNextFreePort(driver, QEMU_REMOTE_PORT_MIN);
+ port = qemuProcessNextFreePort(driver, driver->remotePortMin);
if (port < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
--
1.7.12
12 years, 2 months
[libvirt] [PATCH 0/2] virsh: Check for connection usability before each command
by Peter Krempa
Some commands in virsh forgot to do this check before executing remote commands
and printed unexpected error messages. This series moves the connection check
to a central point so that these mistakes don't happen. Also it's a nice
cleanup :).
Peter Krempa (2):
virsh: Improve checking for connection when running commands
virsh: remove unneeded usage of vshConnectionUsability()
tools/virsh-domain-monitor.c | 36 --------
tools/virsh-domain.c | 215 -------------------------------------------
tools/virsh-host.c | 40 --------
tools/virsh-interface.c | 40 --------
tools/virsh-network.c | 35 -------
tools/virsh-nodedev.c | 18 ----
tools/virsh-nwfilter.c | 15 ---
tools/virsh-pool.c | 57 ------------
tools/virsh-secret.c | 18 ----
tools/virsh-snapshot.c | 30 ------
tools/virsh-volume.c | 50 ----------
tools/virsh.c | 46 +++++----
tools/virsh.h | 1 -
13 files changed, 28 insertions(+), 573 deletions(-)
--
1.7.12
12 years, 2 months
[libvirt] [PATCH] schemas: Fix wwn pattern
by Osier Yang
It should be [] instead of ().
---
docs/schemas/nodedev.rng | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/docs/schemas/nodedev.rng b/docs/schemas/nodedev.rng
index c07a97d..88a4e9d 100644
--- a/docs/schemas/nodedev.rng
+++ b/docs/schemas/nodedev.rng
@@ -247,7 +247,7 @@
<define name='wwn'>
<data type='string'>
- <param name='pattern'>(0-9a-fA-F){16}</param>
+ <param name='pattern'>[0-9a-fA-F]{16}</param>
</data>
</define>
--
1.7.7.3
12 years, 2 months
[libvirt] [PATCH] util: Update the inconsistent and outdated comments
by Osier Yang
The codes were updated to allow to reset the device as long as
there is no devices/functions behind the same bus. However, the
comments were kept without touched.
---
Pushed under trivial rule.
---
src/util/pci.c | 7 +++----
1 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/src/util/pci.c b/src/util/pci.c
index 137521b..0742d07 100644
--- a/src/util/pci.c
+++ b/src/util/pci.c
@@ -605,10 +605,9 @@ pciTrySecondaryBusReset(pciDevice *dev,
uint16_t ctl;
int ret = -1;
- /* For now, we just refuse to do a secondary bus reset
- * if there are other devices/functions behind the bus.
- * In future, we could allow it so long as those devices
- * are not in use by the host or other guests.
+ /* Refuse to do a secondary bus reset if there are other
+ * devices/functions behind the bus are used by the host
+ * or other guests.
*/
if ((conflict = pciBusContainsActiveDevices(dev, inactiveDevs))) {
virReportError(VIR_ERR_INTERNAL_ERROR,
--
1.7.7.3
12 years, 2 months
[libvirt] [PATCH 0/2] conf: Fix parsing and formatting of seclabels
by Jiri Denemark
This patchset contains updated patches from Marcelo with the changes I sent
previously as a WIP.
Marcelo Cerri (2):
conf: Fix parsing of seclabels without model
conf: Avoid formatting auto-generated DAC labels
src/conf/domain_conf.c | 78 ++++++++++++++++++++++++++++++++++----------------
src/conf/domain_conf.h | 1 +
2 files changed, 55 insertions(+), 24 deletions(-)
--
1.7.12
12 years, 2 months
[libvirt] [PATCH] virsh: fixed incorrect timing report
by Viktor Mihajlovski
When executing virsh -t <command> the reported timing was off
by 3 orders of magnitude if the command took more than one
second.
Signed-off-by: Viktor Mihajlovski <mihajlov(a)linux.vnet.ibm.com>
---
tools/virsh.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/tools/virsh.c b/tools/virsh.c
index 7a5b92c..04d1b52 100644
--- a/tools/virsh.c
+++ b/tools/virsh.c
@@ -1509,7 +1509,7 @@ vshCommandRun(vshControl *ctl, const vshCmd *cmd)
return ret;
if (enable_timing) {
- double diff_ms = (((after.tv_sec - before.tv_sec) * 1000000.0) +
+ double diff_ms = (((after.tv_sec - before.tv_sec) * 1000.0) +
((after.tv_usec - before.tv_usec) / 1000.0));
vshPrint(ctl, _("\n(Time: %.3f ms)\n\n"), diff_ms);
--
1.7.0.4
12 years, 2 months
[libvirt] [PATCH] virsh: Document subdriver option of attach-disk
by Jiri Denemark
---
tools/virsh.pod | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/tools/virsh.pod b/tools/virsh.pod
index cad5b1c..a26c420 100644
--- a/tools/virsh.pod
+++ b/tools/virsh.pod
@@ -1675,9 +1675,15 @@ I<source> is path for the files and devices. I<target> controls the bus or
device under which the disk is exposed to the guest OS. It indicates the
"logical" device name. I<driver> can be I<file>, I<tap> or I<phy> for the Xen
hypervisor depending on the kind of access; or I<qemu> for the QEMU emulator.
-I<type> can indicate I<lun>, I<cdrom> or I<floppy> as alternative to the disk default,
-although this use only replaces the media within the existing virtual cdrom or
-floppy device; consider using B<update-device> for this usage instead.
+Further details to the driver can be passed using I<subdriver>. For Xen
+I<subdriver> can be I<aio>, while for QEMU subdriver should match the format
+of the disk source, such as I<raw> or I<qcow2>. Hypervisor default will be
+used if I<subdriver> is not specified. However, the default may not be
+correct, esp. for QEMU as for security reasons it is configured not to detect
+disk formats. I<type> can indicate I<lun>, I<cdrom> or I<floppy> as
+alternative to the disk default, although this use only replaces the media
+within the existing virtual cdrom or floppy device; consider using
+B<update-device> for this usage instead.
I<mode> can specify the two specific mode I<readonly> or I<shareable>.
I<--config> indicates the changes will affect the next boot of the domain,
for compatibility purposes, I<--persistent> is alias of I<--config>.
--
1.7.12
12 years, 2 months
[libvirt] [PATCH] qemu: Don't ignore CPU tuning config if required cgroups are missing
by Jiri Denemark
---
src/qemu/qemu_cgroup.c | 29 ++++++++++++++++++++---------
1 file changed, 20 insertions(+), 9 deletions(-)
diff --git a/src/qemu/qemu_cgroup.c b/src/qemu/qemu_cgroup.c
index df67ff3..7298e28 100644
--- a/src/qemu/qemu_cgroup.c
+++ b/src/qemu/qemu_cgroup.c
@@ -546,16 +546,21 @@ int qemuSetupCgroupForVcpu(struct qemud_driver *driver, virDomainObjPtr vm)
unsigned long long period = vm->def->cputune.period;
long long quota = vm->def->cputune.quota;
- if (driver->cgroup == NULL)
- return 0; /* Not supported, so claim success */
-
if ((period || quota) &&
- !qemuCgroupControllerActive(driver, VIR_CGROUP_CONTROLLER_CPU)) {
- virReportError(VIR_ERR_SYSTEM_ERROR, "%s",
- _("cgroup cpu is not active"));
+ (!driver->cgroup ||
+ !qemuCgroupControllerActive(driver, VIR_CGROUP_CONTROLLER_CPU))) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+ _("cgroup cpu is required for scheduler tuning"));
return -1;
}
+ /* We are trying to setup cgroups for CPU pinning, which can also be done
+ * with virProcessInfoSetAffinity, thus the lack of cgroups is not fatal
+ * here.
+ */
+ if (driver->cgroup == NULL)
+ return 0;
+
rc = virCgroupForDomain(driver->cgroup, vm->def->name, &cgroup, 0);
if (rc != 0) {
virReportSystemError(-rc,
@@ -636,6 +641,14 @@ int qemuSetupCgroupForEmulator(struct qemud_driver *driver,
long long quota = vm->def->cputune.emulator_quota;
int rc, i;
+ if ((period || quota) &&
+ (!driver->cgroup ||
+ !qemuCgroupControllerActive(driver, VIR_CGROUP_CONTROLLER_CPU))) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+ _("cgroup cpu is required for scheduler tuning"));
+ return -1;
+ }
+
if (driver->cgroup == NULL)
return 0; /* Not supported, so claim success */
@@ -656,10 +669,8 @@ int qemuSetupCgroupForEmulator(struct qemud_driver *driver,
}
for (i = 0; i < VIR_CGROUP_CONTROLLER_LAST; i++) {
- if (!qemuCgroupControllerActive(driver, i)) {
- VIR_WARN("cgroup %d is not active", i);
+ if (!qemuCgroupControllerActive(driver, i))
continue;
- }
rc = virCgroupMoveTask(cgroup, cgroup_emulator, i);
if (rc < 0) {
virReportSystemError(-rc,
--
1.7.12
12 years, 2 months
[libvirt] [PATCH 0/2] WIP: additional fixes to the security driver
by Jiri Denemark
Hi,
these patches are a work in progress and apply on top of the two recent patches
from Marcelo.
Jiri Denemark (2):
Fix seclabels parsing
Format seclabels in a compatible way
src/conf/domain_conf.c | 41 +++++++++++++++++++++++++----------------
1 file changed, 25 insertions(+), 16 deletions(-)
--
1.7.12
12 years, 2 months
[libvirt] [PATCH V1 0/3] nwfilter: fixes for broadcasted DHCP reply messages
by Stefan Berger
The following set of patches fixes an issue I found today
while using the DHCP snooping code with VMs running in a different
infrastructure. Essentially the problem that occurs is that
the DHCP server there sends replies to the broadcast MAC address
while the code assumed all DHCP reply packets to be sent to
the VM's MAC address.
Stefan
12 years, 2 months