Re: [libvirt] [PATCH] conf: don't format memtune with unlimited values
by Martin Kletzander
On Tue, Dec 10, 2013 at 09:12:25AM +0100, Martin Kletzander wrote:
> On Tue, Dec 10, 2013 at 09:08:43AM +0100, Michal Privoznik wrote:
> > On 10.12.2013 08:43, Martin Kletzander wrote:
> > > When changing memtune limits to unlimited with AFFECT_CONFIG, the
> > > values in virDomainDef are set to PARAM_UNLIMITED, which causes the
> > > whole <memtune> to be formatted. This can be changed in all drivers,
> > > but it also makes sense to use the default (0) as another value for
> > > "unlimited", since zero memory limit makes no sense.
> > >
> > > Signed-off-by: Martin Kletzander <mkletzan(a)redhat.com>
> > > ---
> > >
> > > Notes:
> > > This patch efectively completes my previous patch on PARAM_UNLIMITED
> > > [1], but I discovered it just now and found out that the behavior
> > > hasn't changed in between.
> > >
> > > [1] https://www.redhat.com/archives/libvir-list/2013-December/msg00434.html
> > >
> > > src/conf/domain_conf.c | 44 ++++++++++++----------
> > > .../qemuxml2argv-memtune-unlimited.args | 6 +++
> > > .../qemuxml2argv-memtune-unlimited.xml | 29 ++++++++++++++
> > > tests/qemuxml2argvtest.c | 1 +
> > > .../qemuxml2xmlout-memtune-unlimited.xml | 27 +++++++++++++
> > > tests/qemuxml2xmltest.c | 1 +
> > > 6 files changed, 88 insertions(+), 20 deletions(-)
> > > create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-memtune-unlimited.args
> > > create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-memtune-unlimited.xml
> > > create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-memtune-unlimited.xml
> >
> > ACK
> >
>
> Thanks, pushed.
>
> Martin
I just noticed you replied off-list, so I'm replying back on-list.
Martin
10 years, 11 months
[libvirt] Fwd: Re: [PATCH] conf: don't format memtune with unlimited values
by Michal Privoznik
-------- Original Message --------
Subject: Re: [libvirt] [PATCH] conf: don't format memtune with unlimited
values
Date: Tue, 10 Dec 2013 09:12:25 +0100
From: Martin Kletzander <mkletzan(a)redhat.com>
To: Michal Privoznik <mprivozn(a)redhat.com>
On Tue, Dec 10, 2013 at 09:08:43AM +0100, Michal Privoznik wrote:
> On 10.12.2013 08:43, Martin Kletzander wrote:
> > When changing memtune limits to unlimited with AFFECT_CONFIG, the
> > values in virDomainDef are set to PARAM_UNLIMITED, which causes the
> > whole <memtune> to be formatted. This can be changed in all drivers,
> > but it also makes sense to use the default (0) as another value for
> > "unlimited", since zero memory limit makes no sense.
> >
> > Signed-off-by: Martin Kletzander <mkletzan(a)redhat.com>
> > ---
> >
> > Notes:
> > This patch efectively completes my previous patch on PARAM_UNLIMITED
> > [1], but I discovered it just now and found out that the behavior
> > hasn't changed in between.
> >
> > [1] https://www.redhat.com/archives/libvir-list/2013-December/msg00434.html
> >
> > src/conf/domain_conf.c | 44 ++++++++++++----------
> > .../qemuxml2argv-memtune-unlimited.args | 6 +++
> > .../qemuxml2argv-memtune-unlimited.xml | 29 ++++++++++++++
> > tests/qemuxml2argvtest.c | 1 +
> > .../qemuxml2xmlout-memtune-unlimited.xml | 27 +++++++++++++
> > tests/qemuxml2xmltest.c | 1 +
> > 6 files changed, 88 insertions(+), 20 deletions(-)
> > create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-memtune-unlimited.args
> > create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-memtune-unlimited.xml
> > create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-memtune-unlimited.xml
>
> ACK
>
Thanks, pushed.
Martin
[For some reason I didn't hit 'Reply-All' but bare 'Reply' button]
10 years, 11 months
[libvirt] [PATCH] conf: don't format memtune with unlimited values
by Martin Kletzander
When changing memtune limits to unlimited with AFFECT_CONFIG, the
values in virDomainDef are set to PARAM_UNLIMITED, which causes the
whole <memtune> to be formatted. This can be changed in all drivers,
but it also makes sense to use the default (0) as another value for
"unlimited", since zero memory limit makes no sense.
Signed-off-by: Martin Kletzander <mkletzan(a)redhat.com>
---
Notes:
This patch efectively completes my previous patch on PARAM_UNLIMITED
[1], but I discovered it just now and found out that the behavior
hasn't changed in between.
[1] https://www.redhat.com/archives/libvir-list/2013-December/msg00434.html
src/conf/domain_conf.c | 44 ++++++++++++----------
.../qemuxml2argv-memtune-unlimited.args | 6 +++
.../qemuxml2argv-memtune-unlimited.xml | 29 ++++++++++++++
tests/qemuxml2argvtest.c | 1 +
.../qemuxml2xmlout-memtune-unlimited.xml | 27 +++++++++++++
tests/qemuxml2xmltest.c | 1 +
6 files changed, 88 insertions(+), 20 deletions(-)
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-memtune-unlimited.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-memtune-unlimited.xml
create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-memtune-unlimited.xml
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index b76cf26..e0ab4b1 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -16643,28 +16643,32 @@ virDomainDefFormatInternal(virDomainDefPtr def,
}
/* add memtune only if there are any */
- if (def->mem.hard_limit || def->mem.soft_limit || def->mem.min_guarantee ||
- def->mem.swap_hard_limit)
+ if ((def->mem.hard_limit &&
+ def->mem.hard_limit != VIR_DOMAIN_MEMORY_PARAM_UNLIMITED) ||
+ (def->mem.soft_limit &&
+ def->mem.hard_limit != VIR_DOMAIN_MEMORY_PARAM_UNLIMITED) ||
+ (def->mem.swap_hard_limit &&
+ def->mem.hard_limit != VIR_DOMAIN_MEMORY_PARAM_UNLIMITED) ||
+ def->mem.min_guarantee) {
virBufferAddLit(buf, " <memtune>\n");
- if (def->mem.hard_limit) {
- virBufferAsprintf(buf, " <hard_limit unit='KiB'>"
- "%llu</hard_limit>\n", def->mem.hard_limit);
- }
- if (def->mem.soft_limit) {
- virBufferAsprintf(buf, " <soft_limit unit='KiB'>"
- "%llu</soft_limit>\n", def->mem.soft_limit);
- }
- if (def->mem.min_guarantee) {
- virBufferAsprintf(buf, " <min_guarantee unit='KiB'>"
- "%llu</min_guarantee>\n", def->mem.min_guarantee);
- }
- if (def->mem.swap_hard_limit) {
- virBufferAsprintf(buf, " <swap_hard_limit unit='KiB'>"
- "%llu</swap_hard_limit>\n", def->mem.swap_hard_limit);
- }
- if (def->mem.hard_limit || def->mem.soft_limit || def->mem.min_guarantee ||
- def->mem.swap_hard_limit)
+ if (def->mem.hard_limit) {
+ virBufferAsprintf(buf, " <hard_limit unit='KiB'>"
+ "%llu</hard_limit>\n", def->mem.hard_limit);
+ }
+ if (def->mem.soft_limit) {
+ virBufferAsprintf(buf, " <soft_limit unit='KiB'>"
+ "%llu</soft_limit>\n", def->mem.soft_limit);
+ }
+ if (def->mem.min_guarantee) {
+ virBufferAsprintf(buf, " <min_guarantee unit='KiB'>"
+ "%llu</min_guarantee>\n", def->mem.min_guarantee);
+ }
+ if (def->mem.swap_hard_limit) {
+ virBufferAsprintf(buf, " <swap_hard_limit unit='KiB'>"
+ "%llu</swap_hard_limit>\n", def->mem.swap_hard_limit);
+ }
virBufferAddLit(buf, " </memtune>\n");
+ }
if (def->mem.hugepage_backed || def->mem.nosharepages || def->mem.locked) {
virBufferAddLit(buf, " <memoryBacking>\n");
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-memtune-unlimited.args b/tests/qemuxml2argvdata/qemuxml2argv-memtune-unlimited.args
new file mode 100644
index 0000000..8bef546
--- /dev/null
+++ b/tests/qemuxml2argvdata/qemuxml2argv-memtune-unlimited.args
@@ -0,0 +1,6 @@
+LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test QEMU_AUDIO_DRV=none \
+/usr/bin/qemu \
+-name QEMUGuest1 -S -M pc -m 214 -smp 1 -nographic -monitor \
+unix:/tmp/test-monitor,server,nowait -no-acpi -boot c -usb \
+-hda /dev/HostVG/QEMUGuest1 -net none -serial \
+none -parallel none
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-memtune-unlimited.xml b/tests/qemuxml2argvdata/qemuxml2argv-memtune-unlimited.xml
new file mode 100644
index 0000000..526129b
--- /dev/null
+++ b/tests/qemuxml2argvdata/qemuxml2argv-memtune-unlimited.xml
@@ -0,0 +1,29 @@
+<domain type='qemu'>
+ <name>QEMUGuest1</name>
+ <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+ <memory unit='MiB'>214</memory>
+ <currentMemory unit='KiB'>219136</currentMemory>
+ <memtune>
+ <hard_limit unit='KiB'>9007199254740991</hard_limit>
+ </memtune>
+ <vcpu placement='static'>1</vcpu>
+ <os>
+ <type arch='i686' machine='pc'>hvm</type>
+ <boot dev='hd'/>
+ </os>
+ <clock offset='utc'/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>destroy</on_crash>
+ <devices>
+ <emulator>/usr/bin/qemu</emulator>
+ <disk type='block' device='disk'>
+ <source dev='/dev/HostVG/QEMUGuest1'/>
+ <target dev='hda' bus='ide'/>
+ <address type='drive' controller='0' bus='0' target='0' unit='0'/>
+ </disk>
+ <controller type='usb' index='0'/>
+ <controller type='ide' index='0'/>
+ <memballoon model='virtio'/>
+ </devices>
+</domain>
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index f9abf1b..f75e457 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -1126,6 +1126,7 @@ mymain(void)
QEMU_CAPS_KVM, QEMU_CAPS_CPU_HOST);
DO_TEST("memtune", QEMU_CAPS_NAME);
+ DO_TEST("memtune-unlimited", QEMU_CAPS_NAME);
DO_TEST("blkiotune", QEMU_CAPS_NAME);
DO_TEST("blkiotune-device", QEMU_CAPS_NAME);
DO_TEST("cputune", QEMU_CAPS_NAME);
diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-memtune-unlimited.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-memtune-unlimited.xml
new file mode 100644
index 0000000..1d29fa7
--- /dev/null
+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-memtune-unlimited.xml
@@ -0,0 +1,27 @@
+<domain type='qemu'>
+ <name>QEMUGuest1</name>
+ <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+ <memory unit='KiB'>219136</memory>
+ <currentMemory unit='KiB'>219136</currentMemory>
+ <vcpu placement='static'>1</vcpu>
+ <os>
+ <type arch='i686' machine='pc'>hvm</type>
+ <boot dev='hd'/>
+ </os>
+ <clock offset='utc'/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>destroy</on_crash>
+ <devices>
+ <emulator>/usr/bin/qemu</emulator>
+ <disk type='block' device='disk'>
+ <source dev='/dev/HostVG/QEMUGuest1'/>
+ <target dev='hda' bus='ide'/>
+ <address type='drive' controller='0' bus='0' target='0' unit='0'/>
+ </disk>
+ <controller type='usb' index='0'/>
+ <controller type='ide' index='0'/>
+ <controller type='pci' index='0' model='pci-root'/>
+ <memballoon model='virtio'/>
+ </devices>
+</domain>
diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c
index ceaaf6a..2a9849c 100644
--- a/tests/qemuxml2xmltest.c
+++ b/tests/qemuxml2xmltest.c
@@ -247,6 +247,7 @@ mymain(void)
DO_TEST("encrypted-disk");
DO_TEST_DIFFERENT("memtune");
+ DO_TEST_DIFFERENT("memtune-unlimited");
DO_TEST("blkiotune");
DO_TEST("blkiotune-device");
DO_TEST("cputune");
--
1.8.5.1
10 years, 11 months
[libvirt] [PATCH 1/3] qemu: hotplug: Only label hostdev after checking device conflicts
by Cole Robinson
Similar to what Jiri did for cgroup setup/teardown in 05e149f94, push
it all into the device handler functions so we can do the necessary prep
work before claiming the device.
This also fixes hotplugging USB devices by product/vendor (virt-manager's
default behavior):
https://bugzilla.redhat.com/show_bug.cgi?id=1016511
---
src/qemu/qemu_hotplug.c | 42 ++++++++++++++++++++++++++++++++++--------
1 file changed, 34 insertions(+), 8 deletions(-)
diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
index f4fc723..bff9e23 100644
--- a/src/qemu/qemu_hotplug.c
+++ b/src/qemu/qemu_hotplug.c
@@ -1153,6 +1153,7 @@ qemuDomainAttachHostPciDevice(virQEMUDriverPtr driver,
char *configfd_name = NULL;
bool releaseaddr = false;
bool teardowncgroup = false;
+ bool teardownlabel = false;
int backend = hostdev->source.subsys.u.pci.backend;
if (VIR_REALLOC_N(vm->def->hostdevs, vm->def->nhostdevs + 1) < 0)
@@ -1193,6 +1194,11 @@ qemuDomainAttachHostPciDevice(virQEMUDriverPtr driver,
goto error;
teardowncgroup = true;
+ if (virSecurityManagerSetHostdevLabel(driver->securityManager,
+ vm->def, hostdev, NULL) < 0)
+ goto error;
+ teardownlabel = true;
+
if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_DEVICE)) {
if (qemuAssignDeviceHostdevAlias(vm->def, hostdev, -1) < 0)
goto error;
@@ -1250,6 +1256,10 @@ qemuDomainAttachHostPciDevice(virQEMUDriverPtr driver,
error:
if (teardowncgroup && qemuTeardownHostdevCgroup(vm, hostdev) < 0)
VIR_WARN("Unable to remove host device cgroup ACL on hotplug fail");
+ if (teardownlabel &&
+ virSecurityManagerRestoreHostdevLabel(driver->securityManager,
+ vm->def, hostdev, NULL) < 0)
+ VIR_WARN("Unable to restore host device labelling on hotplug fail");
if (releaseaddr)
qemuDomainReleaseDeviceAddress(vm, hostdev->info, NULL);
@@ -1445,6 +1455,7 @@ qemuDomainAttachHostUsbDevice(virQEMUDriverPtr driver,
char *devstr = NULL;
bool added = false;
bool teardowncgroup = false;
+ bool teardownlabel = false;
int ret = -1;
if (qemuFindHostdevUSBDevice(hostdev, true, &usb) < 0)
@@ -1466,6 +1477,11 @@ qemuDomainAttachHostUsbDevice(virQEMUDriverPtr driver,
goto cleanup;
teardowncgroup = true;
+ if (virSecurityManagerSetHostdevLabel(driver->securityManager,
+ vm->def, hostdev, NULL) < 0)
+ goto cleanup;
+ teardownlabel = true;
+
if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_DEVICE)) {
if (qemuAssignDeviceHostdevAlias(vm->def, hostdev, -1) < 0)
goto cleanup;
@@ -1492,10 +1508,14 @@ qemuDomainAttachHostUsbDevice(virQEMUDriverPtr driver,
ret = 0;
cleanup:
- if (ret < 0 &&
- teardowncgroup &&
- qemuTeardownHostdevCgroup(vm, hostdev) < 0)
- VIR_WARN("Unable to remove host device cgroup ACL on hotplug fail");
+ if (ret < 0) {
+ if (teardowncgroup && qemuTeardownHostdevCgroup(vm, hostdev) < 0)
+ VIR_WARN("Unable to remove host device cgroup ACL on hotplug fail");
+ if (teardownlabel &&
+ virSecurityManagerRestoreHostdevLabel(driver->securityManager,
+ vm->def, hostdev, NULL) < 0)
+ VIR_WARN("Unable to restore host device labelling on hotplug fail");
+ }
if (added)
virUSBDeviceListSteal(driver->activeUsbHostdevs, usb);
virUSBDeviceFree(usb);
@@ -1515,6 +1535,7 @@ qemuDomainAttachHostScsiDevice(virQEMUDriverPtr driver,
char *devstr = NULL;
char *drvstr = NULL;
bool teardowncgroup = false;
+ bool teardownlabel = false;
if (!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_DRIVE) ||
!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_DEVICE) ||
@@ -1543,6 +1564,11 @@ qemuDomainAttachHostScsiDevice(virQEMUDriverPtr driver,
goto cleanup;
teardowncgroup = true;
+ if (virSecurityManagerSetHostdevLabel(driver->securityManager,
+ vm->def, hostdev, NULL) < 0)
+ goto cleanup;
+ teardownlabel = true;
+
if (qemuAssignDeviceHostdevAlias(vm->def, hostdev, -1) < 0)
goto cleanup;
@@ -1584,6 +1610,10 @@ cleanup:
qemuDomainReAttachHostScsiDevices(driver, vm->def->name, &hostdev, 1);
if (teardowncgroup && qemuTeardownHostdevCgroup(vm, hostdev) < 0)
VIR_WARN("Unable to remove host device cgroup ACL on hotplug fail");
+ if (teardownlabel &&
+ virSecurityManagerRestoreHostdevLabel(driver->securityManager,
+ vm->def, hostdev, NULL) < 0)
+ VIR_WARN("Unable to restore host device labelling on hotplug fail");
}
VIR_FREE(drvstr);
VIR_FREE(devstr);
@@ -1601,10 +1631,6 @@ int qemuDomainAttachHostDevice(virQEMUDriverPtr driver,
return -1;
}
- if (virSecurityManagerSetHostdevLabel(driver->securityManager,
- vm->def, hostdev, NULL) < 0)
- return -1;
-
switch (hostdev->source.subsys.type) {
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI:
if (qemuDomainAttachHostPciDevice(driver, vm,
--
1.8.4.2
10 years, 11 months
[libvirt] [PATCH] Read PCI class from sysfs class file instead of config space.
by Thadeu Lima de Souza Cascardo
When determining if a device is behind a PCI bridge, the PCI device
class is checked by reading the config space. However, there are some
devices which have the wrong class on the config space, but the class is
initialized by Linux correctly as a PCI BRIDGE. This class can be read
by the sysfs file '/sys/bus/pci/devices/xxxx:xx:xx.x/class'.
One example of such bridge is IBM PCI Bridge 1014:03b9, which is
identified as a Host Bridge when reading the config space.
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo(a)linux.vnet.ibm.com>
---
src/util/virpci.c | 38 +++++++++++++++++++++++++++++++++++---
1 files changed, 35 insertions(+), 3 deletions(-)
diff --git a/src/util/virpci.c b/src/util/virpci.c
index 8ec642f..8353411 100644
--- a/src/util/virpci.c
+++ b/src/util/virpci.c
@@ -344,6 +344,34 @@ virPCIDeviceRead32(virPCIDevicePtr dev, int cfgfd, unsigned int pos)
}
static int
+virPCIDeviceReadClass(virPCIDevicePtr dev, uint16_t *device_class)
+{
+ char *path = NULL;
+ char *id_str;
+ int ret = 0;
+ unsigned int value;
+
+ if (virPCIFile(&path, dev->name, "class") < 0)
+ return -1;
+
+ /* class string is '0xNNNNNN\n' ... i.e. 9 bytes */
+ if (virFileReadAll(path, 9, &id_str) < 0) {
+ VIR_FREE(path);
+ return -1;
+ }
+
+ VIR_FREE(path);
+
+ id_str[8] = '\0';
+ ret = virStrToLong_ui(id_str, NULL, 16, &value);
+ if (ret == 0)
+ *device_class = (value >> 8) & 0xFFFF;
+
+ VIR_FREE(id_str);
+ return ret;
+}
+
+static int
virPCIDeviceWrite(virPCIDevicePtr dev,
int cfgfd,
unsigned int pos,
@@ -645,8 +673,8 @@ virPCIDeviceIsParent(virPCIDevicePtr dev, virPCIDevicePtr check, void *data)
return 0;
/* Is it a bridge? */
- device_class = virPCIDeviceRead16(check, fd, PCI_CLASS_DEVICE);
- if (device_class != PCI_CLASS_BRIDGE_PCI)
+ ret = virPCIDeviceReadClass(check, &device_class);
+ if (ret == -1 || device_class != PCI_CLASS_BRIDGE_PCI)
goto cleanup;
/* Is it a plane? */
@@ -2110,6 +2138,7 @@ virPCIDeviceDownstreamLacksACS(virPCIDevicePtr dev)
unsigned int pos;
int fd;
int ret = 0;
+ uint16_t device_class;
if ((fd = virPCIDeviceConfigOpen(dev, true)) < 0)
return -1;
@@ -2119,8 +2148,11 @@ virPCIDeviceDownstreamLacksACS(virPCIDevicePtr dev)
goto cleanup;
}
+ if (virPCIDeviceReadClass(dev, &device_class))
+ goto cleanup;
+
pos = dev->pcie_cap_pos;
- if (!pos || virPCIDeviceRead16(dev, fd, PCI_CLASS_DEVICE) != PCI_CLASS_BRIDGE_PCI)
+ if (!pos || device_class != PCI_CLASS_BRIDGE_PCI)
goto cleanup;
flags = virPCIDeviceRead16(dev, fd, pos + PCI_EXP_FLAGS);
--
1.7.1
10 years, 11 months
[libvirt] [libvirt-python 1/2] override: Fix exception handling syntax
by Doug Goldstein
Python 3 no longer accepts 'except Exception, e:' as valid while Python
2.4 does not accept the new syntax 'except Exception as e:' so this uses
a fall back method that is compatible with both.
---
libvirt-override-virStream.py | 3 ++-
libvirt-override.py | 8 ++++++--
2 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/libvirt-override-virStream.py b/libvirt-override-virStream.py
index 53000da..189d062 100644
--- a/libvirt-override-virStream.py
+++ b/libvirt-override-virStream.py
@@ -50,7 +50,8 @@
ret = handler(self, got, opaque)
if type(ret) is int and ret < 0:
raise RuntimeError("recvAll handler returned %d" % ret)
- except Exception, e:
+ except Exception:
+ e = sys.exc_info()[1]
try:
self.abort()
except:
diff --git a/libvirt-override.py b/libvirt-override.py
index 87996f8..63f8ecb 100644
--- a/libvirt-override.py
+++ b/libvirt-override.py
@@ -3,12 +3,16 @@
#
# On cygwin, the DLL is called cygvirtmod.dll
+import sys
+
try:
import libvirtmod
-except ImportError, lib_e:
+except ImportError:
+ lib_e = sys.exc_info()[1]
try:
import cygvirtmod as libvirtmod
- except ImportError, cyg_e:
+ except ImportError:
+ cyg_e = sys.exc_info()[1]
if str(cyg_e).count("No module named"):
raise lib_e
--
1.8.3.2
10 years, 11 months
[libvirt] [libvirt-python 0/3] Python 3 support mixed with Dan's patches
by Doug Goldstein
Turns out Dan and I both started working on Python 3 support and we
talked about some changes to his patchset and these are the result
of that conversation. This really belongs in the middle of his patchset
but he's pushed the first part already so this is on top of master.
Doug Goldstein (3):
setup: Drop unused exception variable
generator: Support exceptions in Python 2 and 3
Update exception catching in generated code
generator.py | 18 ++++++++++++------
setup.py | 2 +-
2 files changed, 13 insertions(+), 7 deletions(-)
--
1.8.3.2
10 years, 11 months
[libvirt] [PATCH] Workaround startup race condition
by Adam Walters
This patch works around a race condition on libvirt start. It feels a
little hackish to me, but I have a hard time letting go of problems, so
I had to at least try and implement something before going to sleep. I'd
love some comments on the workaround, and welcome any improvement
suggestions, as well.
Please note that I implemented this in qemu_conf.c because it is the only
place in the codebase I found VIR_DOMAIN_DISK_TYPE_VOLUME used, which tells
me that only qemu has storage pool support at this time (not to mention that
the qemu code is what I've become familiar with. It also doesn't hurt that I
only have qemu configured and ready to go for testing, too).
Adam Walters (1):
qemu: conf: Work around race condition on libvirt start
src/qemu/qemu_conf.c | 11 +++++++++++
1 file changed, 11 insertions(+)
--
1.8.4.2
10 years, 11 months
[libvirt] save-image-edit fails to change the memory configuration of the image
by Shivaprasad bhat
Hi,
I see the below error when i change the memory.
virsh save-image-edit /MANAS/rhel7VM1-running-save2 --running
error: unsupported configuration: Target domain max memory 4194304
does not match source 2097152
Failed. Try again? [y,n,f,?]: n
error: unsupported configuration: Target domain max memory 4194304
does not match source 2097152
Any idea why is this disallowed ?
Thanks,
Shiva
10 years, 11 months