[libvirt] [PATCH 0/2] lxc: allow using 802.11 wireless interfaces in LXC domains
by Lubomir Rintel
Hi,
I'm using libvirt-lxc with mac80211_hwsim to construct virtual wireless network
for NetworkManager testing. Currently, I have to move the interfaces to the
domains manually, as sharing wan 802.11 wireless link with a LXC namespace does
not work:
<hostdev mode='capabilities' type='net'>
<source><interface>wlan0</interface></source>
</hostdev>
The wireless links can only be associated to namespaces by moving the
underlying PHY instead of the network interface.
I'm following up with patches that fix the problem for me; please take a look.
Thank you
Lubo
9 years, 6 months
[libvirt] [PATCH 0/8 v3] parallels: add vz driver
by Maxim Nestratov
v2-v3 change:
* Patch "parallels: set virtType depending on driver name" reworked.
Implemented ability to set virtType depending on driver name.
v1-v2 change:
* Only "parallels: accept vz as a driver uri and name" patch
is changed. Fixed ability to connect to 'parallels' driver
and deal with 'Paralells' domain virt type.
Maxim Nestratov (8):
parallels: introduce vz driver constant and string
parallels: use newly introduced VIR_DOMAIN_VIRT_VZ
parallels: add new guest capabilities assigned to vz driver
parallels: accept vz as a driver uri and name
parallels: add a new vz connection driver and hypervisor structures
parallels: increment the number of connection drivers
parallels: recommend to connect to vz:///system when connection fails
parallels: set virtType depending on driver name
src/conf/domain_conf.c | 19 ++++++++----
src/conf/domain_conf.h | 1 +
src/libvirt.c | 2 +-
src/parallels/parallels_driver.c | 63 +++++++++++++++++++++++++++++++++++----
src/parallels/parallels_network.c | 3 +-
src/parallels/parallels_sdk.c | 6 +++-
src/parallels/parallels_storage.c | 3 +-
src/parallels/parallels_utils.h | 1 +
8 files changed, 82 insertions(+), 16 deletions(-)
--
2.1.0
9 years, 6 months
[libvirt] [PATCH] conf:audit: fix no audit log when start a vm with iothread
by Luyao Huang
Signed-off-by: Luyao Huang <lhuang(a)redhat.com>
---
src/conf/domain_audit.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/conf/domain_audit.c b/src/conf/domain_audit.c
index 4ea10d2..1900039 100644
--- a/src/conf/domain_audit.c
+++ b/src/conf/domain_audit.c
@@ -885,6 +885,8 @@ virDomainAuditStart(virDomainObjPtr vm, const char *reason, bool success)
virDomainAuditMemory(vm, 0, vm->def->mem.cur_balloon, "start", true);
virDomainAuditVcpu(vm, 0, vm->def->vcpus, "start", true);
+ if (vm->def->iothreads)
+ virDomainAuditIOThread(vm, 0, vm->def->iothreads, "start", true);
virDomainAuditLifecycle(vm, "start", reason, success);
}
--
1.8.3.1
9 years, 6 months
[libvirt] [PATCH] qemu: fix forget pass the return value to variable @ret
by Luyao Huang
If we do not pass the return value from qemuDomainRemoveRNGDevice()
function to variable @ret, qemuDomainRemoveDevice() functiuon will
always fail when recive rng device unplug event from qemu monitor.
Signed-off-by: Luyao Huang <lhuang(a)redhat.com>
---
src/qemu/qemu_hotplug.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
index 170768b..f596730 100644
--- a/src/qemu/qemu_hotplug.c
+++ b/src/qemu/qemu_hotplug.c
@@ -3271,7 +3271,7 @@ qemuDomainRemoveDevice(virQEMUDriverPtr driver,
ret = qemuDomainRemoveChrDevice(driver, vm, dev->data.chr);
break;
case VIR_DOMAIN_DEVICE_RNG:
- qemuDomainRemoveRNGDevice(driver, vm, dev->data.rng);
+ ret = qemuDomainRemoveRNGDevice(driver, vm, dev->data.rng);
break;
case VIR_DOMAIN_DEVICE_MEMORY:
--
1.8.3.1
9 years, 6 months
[libvirt] [PATCH] qemu: fix wrong call addressrelease function when attach RNG device success
by Luyao Huang
Add a return value check to avoid the wrong address release.
Signed-off-by: Luyao Huang <lhuang(a)redhat.com>
---
src/qemu/qemu_hotplug.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
index 170768b..f70e3d8 100644
--- a/src/qemu/qemu_hotplug.c
+++ b/src/qemu/qemu_hotplug.c
@@ -1695,7 +1695,7 @@ qemuDomainAttachRNGDevice(virQEMUDriverPtr driver,
audit:
virDomainAuditRNG(vm, NULL, rng, "attach", ret == 0);
cleanup:
- if (vm)
+ if (ret < 0 && vm)
qemuDomainReleaseDeviceAddress(vm, &rng->info, NULL);
VIR_FREE(charAlias);
VIR_FREE(objAlias);
--
1.8.3.1
9 years, 6 months
[libvirt] [PATCHv2] Always add 'console' matching the 'serial' device
by Ján Tomko
We have been formatting the first serial device also
as a console device, but only if there were no other consoles.
If there is a <serial> device present in the XML, but no serial
<console>, or if there isn't any <console> at all but the domain
definition hasn't gone through a parse->format->parse round-trip,
the <console> device would not be formatted.
Change the code to always add the stub device for the first
serial device.
Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1089914
---
src/conf/domain_conf.c | 23 +++++++++++++
.../qemuxml2argv-console-compat2.xml | 35 ++++++++++++++++++++
.../qemuxml2xmlout-console-compat2.xml | 38 ++++++++++++++++++++++
tests/qemuxml2xmltest.c | 1 +
4 files changed, 97 insertions(+)
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-console-compat2.xml
create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-console-compat2.xml
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 6e57425..ec8f9fa 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -3587,6 +3587,25 @@ virDomainDefPostParseInternal(virDomainDefPtr def,
def->consoles[0]->deviceType = VIR_DOMAIN_CHR_DEVICE_TYPE_CONSOLE;
def->consoles[0]->targetType = VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_SERIAL;
}
+ } else if (def->os.type == VIR_DOMAIN_OSTYPE_HVM && def->nserials > 0 &&
+ def->serials[0]->deviceType == VIR_DOMAIN_CHR_DEVICE_TYPE_SERIAL &&
+ def->serials[0]->targetType == VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_ISA) {
+ /* Create a stub console to match the serial port.
+ * console[0] either does not exist
+ * or has a different type than SERIAL or NONE.
+ */
+ virDomainChrDefPtr chr;
+ if (VIR_ALLOC(chr) < 0)
+ return -1;
+
+ if (VIR_INSERT_ELEMENT(def->consoles,
+ 0,
+ def->nconsoles,
+ chr) < 0)
+ return -1;
+
+ def->consoles[0]->deviceType = VIR_DOMAIN_CHR_DEVICE_TYPE_CONSOLE;
+ def->consoles[0]->targetType = VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_SERIAL;
}
if (virDomainDefRejectDuplicateControllers(def) < 0)
@@ -21588,6 +21607,10 @@ virDomainDefFormatInternal(virDomainDefPtr def,
if (virDomainChrDefFormat(buf, &console, flags) < 0)
goto error;
}
+ /* The back-compat console device stub is added when parsing the domain XML
+ * and handled above, this is for formatting definitions created via other
+ * means.
+ */
if (def->os.type == VIR_DOMAIN_OSTYPE_HVM &&
def->nconsoles == 0 &&
def->nserials > 0) {
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-console-compat2.xml b/tests/qemuxml2argvdata/qemuxml2argv-console-compat2.xml
new file mode 100644
index 0000000..ded204a
--- /dev/null
+++ b/tests/qemuxml2argvdata/qemuxml2argv-console-compat2.xml
@@ -0,0 +1,35 @@
+<domain type='qemu'>
+ <name>QEMUGuest1</name>
+ <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+ <memory unit='KiB'>219100</memory>
+ <currentMemory unit='KiB'>219100</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'>
+ <driver name='qemu' type='raw'/>
+ <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'/>
+ <controller type='virtio-serial' index='0'/>
+ <serial type='pty'>
+ <target port='0'/>
+ </serial>
+ <console type='pty'>
+ <target type='virtio' port='0'/>
+ </console>
+ <memballoon model='none'/>
+ </devices>
+</domain>
diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-console-compat2.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-console-compat2.xml
new file mode 100644
index 0000000..636e984
--- /dev/null
+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-console-compat2.xml
@@ -0,0 +1,38 @@
+<domain type='qemu'>
+ <name>QEMUGuest1</name>
+ <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+ <memory unit='KiB'>219100</memory>
+ <currentMemory unit='KiB'>219100</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'>
+ <driver name='qemu' type='raw'/>
+ <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'/>
+ <controller type='virtio-serial' index='0'/>
+ <serial type='pty'>
+ <target port='0'/>
+ </serial>
+ <console type='pty'>
+ <target type='serial' port='0'/>
+ </console>
+ <console type='pty'>
+ <target type='virtio' port='0'/>
+ </console>
+ <memballoon model='none'/>
+ </devices>
+</domain>
diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c
index 53bcc9f..d405e71 100644
--- a/tests/qemuxml2xmltest.c
+++ b/tests/qemuxml2xmltest.c
@@ -472,6 +472,7 @@ mymain(void)
DO_TEST("serial-spiceport-nospice");
DO_TEST("parallel-tcp");
DO_TEST("console-compat");
+ DO_TEST_DIFFERENT("console-compat2");
DO_TEST("console-virtio-many");
DO_TEST("channel-guestfwd");
DO_TEST("channel-virtio");
--
2.3.6
9 years, 6 months
[libvirt] [PATCH v2 0/2] storage: Fix error when deleting non-existent volumes
by Erik Skultety
Erik Skultety (2):
storage: Don't update volume objs list before we successfully create
one
storage: RBD: do not return error when deleting non-existent volume
src/storage/storage_backend_rbd.c | 6 +++---
src/storage/storage_driver.c | 31 +++++++++++++------------------
2 files changed, 16 insertions(+), 21 deletions(-)
--
1.9.3
9 years, 7 months
[libvirt] [PATCH v3 0/5] virsh: Further improve handling of integer options
by Andrea Bolognani
As suggested by Michal: now that we have a generic error message for
failures related to the parsing of integer options, it makes sense to
perform the corresponding check in a single spot instead of replicating
it every time vshCommandOpt*() is used.
Andrea Bolognani (5):
virsh: Use standard error message in vshCommandOptTimeoutToMs().
virsh: Improve vshCommandOptTimeoutToMs().
virsh: Make vshCommandOptScaledInt() use vshCommandOpt().
virsh: Pass vshControl to all vshCommandOpt*() calls.
virsh: Move error messages inside vshCommandOpt*() functions.
tests/vcpupin | 4 +-
tools/virsh-domain-monitor.c | 17 +--
tools/virsh-domain.c | 226 ++++++++++++---------------------------
tools/virsh-host.c | 67 +++---------
tools/virsh-interface.c | 6 +-
tools/virsh-network.c | 10 +-
tools/virsh-nodedev.c | 4 +-
tools/virsh-snapshot.c | 2 +-
tools/virsh-volume.c | 26 +----
tools/virsh.c | 248 +++++++++++++++++++++++++------------------
tools/virsh.h | 66 ++++++------
11 files changed, 278 insertions(+), 398 deletions(-)
--
2.1.0
9 years, 7 months
[libvirt] [PATCH] qemu: fix unsuitable error report when get memory stats
by Wang Yufei
From: Zhang Bo <oscar.zhangbo(a)huawei.com>
when we run the command 'virsh dommemstat xxx',
althrough memballoon's model is set 'none' in vm's XML,
it still reports an error in libvirtd.log.
error : qemuMonitorFindBalloonObjectPath:1042 : internal error: Cannot determine balloon device path
Apparently, if we don't set memballoon, we don't need to
set balloon device path.
Signed-off-by: Wang Yufei <james.wangyufei(a)huawei.com>
Signed-off-by: Zhang Bo <oscar.zhangbo(a)huawei.com>
---
.gnulib | 2 +-
src/qemu/qemu_monitor.c | 4 +++-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/.gnulib b/.gnulib
index 875ec93..106a386 160000
--- a/.gnulib
+++ b/.gnulib
@@ -1 +1 @@
-Subproject commit 875ec93e1501d2d2a8bab1b64fa66b8ceb51dc67
+Subproject commit 106a3866d01f9dd57ab4f10dbeb0d5a8db73a9f7
diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c
index f959b74..c72702d 100644
--- a/src/qemu/qemu_monitor.c
+++ b/src/qemu/qemu_monitor.c
@@ -1711,7 +1711,9 @@ qemuMonitorGetMemoryStats(qemuMonitorPtr mon,
QEMU_CHECK_MONITOR(mon);
if (mon->json) {
- ignore_value(qemuMonitorFindBalloonObjectPath(mon, "/"));
+ if (mon->vm->def->memballoon &&
+ mon->vm->def->memballoon->model != VIR_DOMAIN_MEMBALLOON_MODEL_NONE)
+ ignore_value(qemuMonitorFindBalloonObjectPath(mon, "/"));
mon->ballooninit = true;
return qemuMonitorJSONGetMemoryStats(mon, mon->balloonpath,
stats, nr_stats);
--
1.7.12.4
9 years, 7 months
[libvirt] [libvirt-test-api][PATCH] fix imperfect cleanup cause the case will always fail
by Luyao Huang
Remove call undefined function.
Signed-off-by: Luyao Huang <lhuang(a)redhat.com>
---
repos/virconn/connection_getMemoryParameters.py | 4 ----
1 file changed, 4 deletions(-)
diff --git a/repos/virconn/connection_getMemoryParameters.py b/repos/virconn/connection_getMemoryParameters.py
index 9b88fc3..d110b35 100644
--- a/repos/virconn/connection_getMemoryParameters.py
+++ b/repos/virconn/connection_getMemoryParameters.py
@@ -16,7 +16,6 @@ node_memory = ['full_scans',
'sleep_millisecs']
SYSFS_MEMORY_SHARED_PATH = '/sys/kernel/mm/ksm/'
-LIBVIRT_API_PATH = '/usr/share/libvirt/api/libvirt-api.xml'
flags=0
def check_memory_parameter(libvirt_dict, parameter_name):
@@ -47,9 +46,6 @@ def connection_getMemoryParameters(params):
logger.info("get connection to libvirtd")
- if utils.check_flags('getMemoryParameters', LIBVIRT_API_PATH) == 1:
- return 1
-
param_dict=conn.getMemoryParameters()
for n in node_memory:
--
1.8.3.1
9 years, 7 months