[libvirt] [PATCH RFC 0/5] Remove usb address set caching
by Tomasz Flendrich
During my work on removing addresses caching, usb addresses were added :).
It should be applied on top of:
https://www.redhat.com/archives/libvir-list/2016-August/msg00945.html
or some small conflicts appear.
I took an approach where exactly the same function is used to both
calculate and recalculate the address set. It forces us to keep all
the usb address handling in such state that reusing that function
doesn't perform any changes that aren't needed.
It might even be possible to unify the handling of usb devices into
one function, "qemuDomainAssignUSBAddresses", and remove some code.
For example, virDomainUSBAddressEnsure looks almost exactly like
qemuDomainAssignUSBPorts plus virDomainUSBAddressReserve. The end goal
would be simply calling qemuDomainAssignUSBAddresses() as many times
as we want, for example when creating a new domain or after a hotplug.
To see what I mean, please take a look at qemuDomainAttachUSBMassStorageDevice.
If I remove the call to virDomainUSBAddressEnsure and move creating the
USB address set somewhere down (after virDomainDiskInsertPreAlloced),
it works - the address is assigned flawlessly.
Does it make any sense?
Is there any reason why we don't add new usb hubs when hotplugging
devices?
By the way please excuse me for resending an old patch series a few
minutes ago, it was an accident.
Tomasz Flendrich (5):
Add qemuDomainUSBAddrSetCreateFromDomain
qemu_hotplug: use a recalculated usb address set
remove qemuDomainReleaseDeviceAddress and its uses
remove unused virDomainUSBAddressRelease
Add a USB hotplug testcase for reattachment
src/conf/domain_addr.c | 30 -------------
src/conf/domain_addr.h | 5 ---
src/libvirt_private.syms | 1 -
src/qemu/qemu_domain.c | 3 +-
src/qemu/qemu_domain.h | 2 -
src/qemu/qemu_domain_address.c | 62 ++++++++++++---------------
src/qemu/qemu_domain_address.h | 8 ++--
src/qemu/qemu_hotplug.c | 95 +++++++++++-------------------------------
src/qemu/qemu_process.c | 6 +--
tests/qemuhotplugtest.c | 7 +++-
10 files changed, 62 insertions(+), 157 deletions(-)
--
1.9.1
8 years, 8 months
[libvirt] network ethernet - device not up and ip not assigned
by Vasiliy Tolstov
I'm install latest libvir and configure network to assign some ip to
ethernet device.
But after start tap device is down and no addresses assigned.
My investigation:
qemu_interface.c have functions:
qemuInterfaceStartDevice and qemuInterfaceStopDevice
In start device in case of ethernet device no action performed (this
is bug i think).
In stop device i see, that we try to assign ip address to device (why?)
I think we need to move assigning addresses from stop device, to start
device, also note, that for routes we need device to up (how we deal
in case of user in xml specify device is down and have route element
inside xml for this device?)
In case of stop device i think we does not need anything (in case of
linux) becaue when tap deleted routes and addresses dissapeared from
the kernel.
What do you think?
--
Vasiliy Tolstov,
e-mail: v.tolstov(a)selfip.ru
8 years, 8 months
[libvirt] [PATCH] lxc: don't try to reference NULL when mounting filesystems
by Daniel P. Berrange
<filesystem type='ram' accessmode='passthrough'>
<source usage='524288' units='KiB'/>
<target dir='/dev/shm'/>
</filesystem>
would lead to lxcContainerMountAllFS calling STRPREFIX
on a NLL pointer because it failed to check if fs->src->path
was non-NULL. This is a regression caused by
commit da665fbd4858890fbb3bbf5da2a7b6ca37bb3220
Author: Olga Krishtal <okrishtal(a)virtuozzo.com>
Date: Thu Jul 14 16:52:38 2016 +0300
filesystem: adds possibility to use storage pool as fs source
Signed-off-by: Olga Krishtal <okrishtal(a)virtuozzo.com>
Signed-off-by: Daniel P. Berrange <berrange(a)redhat.com>
---
src/lxc/lxc_container.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/src/lxc/lxc_container.c b/src/lxc/lxc_container.c
index e1eb434..5357df4 100644
--- a/src/lxc/lxc_container.c
+++ b/src/lxc/lxc_container.c
@@ -1627,8 +1627,7 @@ static int lxcContainerMountAllFS(virDomainDefPtr vmDef,
if (lxcContainerResolveSymlinks(vmDef->fss[i], false) < 0)
return -1;
-
- if (!(vmDef->fss[i]->src &&
+ if (!(vmDef->fss[i]->src && vmDef->fss[i]->src->path &&
STRPREFIX(vmDef->fss[i]->src->path, vmDef->fss[i]->dst)) &&
lxcContainerUnmountSubtree(vmDef->fss[i]->dst, false) < 0)
return -1;
--
2.7.4
8 years, 8 months
[libvirt] remove-the-dead
by JieWang
[PATCH] remove the dead code this patch is to remove the dead code Signed-off-by: JieWang <wangjie88(a)huawei.com>
8 years, 8 months
[libvirt] [PATCH] remove the dead code this patch is to remove the dead code Signed-off-by: JieWang <wangjie88@huawei.com>
by JieWang
Signed-off-by: JieWang <wangjie88(a)huawei.com>
---
src/qemu/qemu_migration.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
index 6a683f7..759e15a 100644
--- a/src/qemu/qemu_migration.c
+++ b/src/qemu/qemu_migration.c
@@ -1602,7 +1602,6 @@ qemuMigrationPrecreateDisk(virConnectPtr conn,
_("cannot precreate storage for disk type '%s'"),
virStorageTypeToString(disk->src->type));
goto cleanup;
- break;
}
if ((vol = virStorageVolLookupByName(pool, volName))) {
--
1.9.5.msysgit.1
8 years, 8 months
[libvirt] [PATCH] remove the dead code this patch is to remove the dead code Signed-off-by: JieWang <wangjie88@huawei.com>
by Jie Wang
From: JieWang <wangjie88(a)huawei.com>
Signed-off-by: JieWang <wangjie88(a)huawei.com>
---
src/qemu/qemu_migration.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
index 6a683f7..759e15a 100644
--- a/src/qemu/qemu_migration.c
+++ b/src/qemu/qemu_migration.c
@@ -1602,7 +1602,6 @@ qemuMigrationPrecreateDisk(virConnectPtr conn,
_("cannot precreate storage for disk type '%s'"),
virStorageTypeToString(disk->src->type));
goto cleanup;
- break;
}
if ((vol = virStorageVolLookupByName(pool, volName))) {
--
1.9.5.msysgit.1
8 years, 8 months
[libvirt] [PATCH] network: Need to free formatted addr in networkDnsmasqConfContents
by John Ferlan
Commit id '0b6336c2' formatted the 'addr', but didn't VIR_FREE it.
Found by Coverity.
Signed-off-by: John Ferlan <jferlan(a)redhat.com>
---
src/network/bridge_driver.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c
index 74f75d0..7b99aca 100644
--- a/src/network/bridge_driver.c
+++ b/src/network/bridge_driver.c
@@ -969,6 +969,7 @@ networkDnsmasqConfContents(virNetworkObjPtr network,
if (!addr)
goto cleanup;
virBufferAsprintf(&configbuf, "%s\n", addr);
+ VIR_FREE(addr);
} else {
/* "don't forward requests for this domain" */
virBufferAddLit(&configbuf, "#\n");
--
2.7.4
8 years, 8 months
[libvirt] [PATCH 0/3] Three new network features
by Laine Stump
The first two patches add settings that let you *disable* certain
functionality (iptables rules, and the DNS server), while the third
enhances the DNS <forwarder> element.
Laine Stump (3):
network: new network forward mode 'open'
network: allow disabling dnsmasq's DNS server
network: allow limiting a <forwarder> element to certain domains
docs/formatnetwork.html.in | 62 ++++++-
docs/schemas/network.rng | 14 +-
src/conf/network_conf.c | 110 +++++++++--
src/conf/network_conf.h | 10 +-
src/network/bridge_driver.c | 204 +++++++++++++--------
.../nat-network-dns-forwarders.conf | 2 +
.../nat-network-dns-forwarders.xml | 2 +
tests/networkxml2confdata/open-network.conf | 11 ++
tests/networkxml2confdata/open-network.xml | 9 +
.../networkxml2confdata/routed-network-no-dns.conf | 11 ++
.../networkxml2confdata/routed-network-no-dns.xml | 10 +
tests/networkxml2conftest.c | 2 +
.../nat-network-dns-forwarders.xml | 6 +-
.../open-network-with-forward-dev.xml | 9 +
tests/networkxml2xmlin/open-network.xml | 9 +
tests/networkxml2xmlin/routed-network-no-dns.xml | 10 +
.../nat-network-dns-forwarders.xml | 2 +
tests/networkxml2xmlout/open-network.xml | 9 +
tests/networkxml2xmlout/routed-network-no-dns.xml | 12 ++
tests/networkxml2xmltest.c | 3 +
20 files changed, 405 insertions(+), 102 deletions(-)
create mode 100644 tests/networkxml2confdata/open-network.conf
create mode 100644 tests/networkxml2confdata/open-network.xml
create mode 100644 tests/networkxml2confdata/routed-network-no-dns.conf
create mode 100644 tests/networkxml2confdata/routed-network-no-dns.xml
create mode 100644 tests/networkxml2xmlin/open-network-with-forward-dev.xml
create mode 100644 tests/networkxml2xmlin/open-network.xml
create mode 100644 tests/networkxml2xmlin/routed-network-no-dns.xml
create mode 100644 tests/networkxml2xmlout/open-network.xml
create mode 100644 tests/networkxml2xmlout/routed-network-no-dns.xml
--
2.7.4
8 years, 8 months
[libvirt] [PATCH v2 0/5] Implementation of QEMU vhost-scsi
by Eric Farman
This patch series provides a libvirt implementation of the vhost-scsi
interface in QEMU. As near as I can see, this was discussed upstream in
July 2014[1], and ended in a desire to replace a vhost-scsi controller
in favor of a hostdev element instead[2].
There is no capability check in this series for vhost-scsi in the underlying
QEMU. Using a recent QEMU built with --disable-vhost-scsi fails with "not a
valid device model name."
Host Filesystem Example:
# ls /sys/kernel/config/target/vhost/
discovery_auth naa.5001405df3e54061 version
# ls /sys/kernel/config/target/vhost/naa.5001405df3e54061/tpgt_1/lun/
lun_0
QEMU Example (snippet):
-device vhost-scsi-ccw,wwpn=naa.5001405df3e54061,devno=fe.0.1000
Libvirt Example (snippet):
<hostdev mode='subsystem' type='scsi_host'>
<source protocol='vhost' wwpn='naa.5001405df3e54061'/>
<address type='ccw' cssid='0xfe' ssid='0x0' devno='0x1000'/>
</hostdev>
Guest Viewpoint:
# lsscsi
[1:0:1:0] disk LIO-ORG disk0 4.0 /dev/sda
# dmesg | grep 1:
[ 6.065735] scsi host1: Virtio SCSI HBA
[ 6.093892] scsi 1:0:1:0: Direct-Access LIO-ORG disk0 4.0 PQ: 0 ANSI: 5
[ 6.313615] sd 1:0:1:0: Attached scsi generic sg0 type 0
[ 6.314981] sd 1:0:1:0: [sda] 29360128 512-byte logical blocks: (15.0 GB/14.0 GiB)
[ 6.317290] sd 1:0:1:0: [sda] Write Protect is off
[ 6.317566] sd 1:0:1:0: [sda] Mode Sense: 43 00 10 08
[ 6.317853] sd 1:0:1:0: [sda] Write cache: enabled, read cache: enabled, supports DPO and FUA
[ 6.352722] sd 1:0:1:0: [sda] Attached SCSI disk
Changelog:
v1->v2:
- Rebase
- Applies to current master (20 August)
- Added a capability check for QEMU 2.7
- Fixed the qemuxml2argv tests as the -smp options had changed
- Reworked ccwaddrs parameter in virDomainCCWAddressAssign call
- Comments
- Squashed documentation, XML schema, XML parsing, and infrastructure
patches into a single patch
- Switched from "hostdev type='scsi'" to "hostdev type='scsi_host'";
this removes the refactoring patches since we're not shoe-horning
a new SCSI protocol into the existing code
- Reworked the handling of the fd's such that we send them to qemu
after any possible errors could occur and cause us to back out
- s/qemuBuildSCSIVhostHostdevDevStr/qemuBuildHostHostdevDevStr/
- Added virBufferCheckError, and an error message for vhostfdSize > 1,
in qemuBuildHostHostdevDevStr
- Added qemuBuildDeviceAddressStr in qemuBuildHostHostdevDevStr, thus
superceding the last patch in the v1 series
- Other
- Simplified the vhostfd logic to just be a single int, rather than
an alloc'd array (left the vhostfdSize described above as an
identifier for if QEMU ever supports multiple vhostfds)
- Replaced "qemuMonitorAddDevice" with "qemuMonitorAddDeviceWithFd"
in hotplug routine
v1: https://www.redhat.com/archives/libvir-list/2016-July/msg01004.html
[1] http://www.redhat.com/archives/libvir-list/2014-July/msg01235.html
[2] http://www.redhat.com/archives/libvir-list/2014-July/msg01390.html
Eric Farman (5):
Introduce a "scsi_host" hostdev type
qemu: Introduce vhost-scsi capability
qemu: Add vhost-scsi string for -device parameter
qemu: Allow hotplug of vhost-scsi device
tests: Introduce basic vhost-scsi test
docs/formatdomain.html.in | 24 ++++
docs/schemas/domaincommon.rng | 23 ++++
src/conf/domain_audit.c | 2 +
src/conf/domain_conf.c | 62 ++++++++-
src/conf/domain_conf.h | 17 +++
src/libvirt_private.syms | 1 +
src/qemu/qemu_capabilities.c | 2 +
src/qemu/qemu_capabilities.h | 1 +
src/qemu/qemu_command.c | 80 +++++++++++
src/qemu/qemu_command.h | 6 +
src/qemu/qemu_domain_address.c | 10 ++
src/qemu/qemu_hotplug.c | 149 +++++++++++++++++++++
src/security/security_dac.c | 2 +
src/util/virscsi.c | 26 ++++
src/util/virscsi.h | 1 +
tests/domaincapsschemadata/full.xml | 1 +
tests/qemucapabilitiesdata/caps_1.5.3.x86_64.xml | 1 +
tests/qemucapabilitiesdata/caps_1.6.0.x86_64.xml | 1 +
tests/qemucapabilitiesdata/caps_1.7.0.x86_64.xml | 1 +
tests/qemucapabilitiesdata/caps_2.1.1.x86_64.xml | 1 +
tests/qemucapabilitiesdata/caps_2.4.0.x86_64.xml | 1 +
tests/qemucapabilitiesdata/caps_2.5.0.x86_64.xml | 1 +
.../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 +
.../qemuxml2argv-hostdev-scsi-vhost-scsi.args | 24 ++++
.../qemuxml2argv-hostdev-scsi-vhost-scsi.xml | 33 +++++
tests/qemuxml2argvmock.c | 12 ++
tests/qemuxml2argvtest.c | 3 +
31 files changed, 488 insertions(+), 2 deletions(-)
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-hostdev-scsi-vhost-scsi.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-hostdev-scsi-vhost-scsi.xml
--
1.9.1
8 years, 8 months
[libvirt] [PATCH v3 0/5] Remove caching of address sets
by Tomasz Flendrich
Link to last version (1-6 are already ACK'd)
https://www.redhat.com/archives/libvir-list/2016-July/msg00917.html
Changes:
* qemuDomainPCIAddressSetCreate is now expanded instead of creating
a completely new function. It now contains
qemuDomainValidateDevicePCISlotsChipsets.
* A parameter was added to qemuDomainValidateDevicePCISlotsChipsets
to make new address asignment optional. If it's false, then that
function doesn't assign any new addresses: it just validates the
current ones (and in some cases reserves addresses for the future)
By the way I'd be grateful if someone took a look at my other patches:
https://www.redhat.com/archives/libvir-list/2016-July/msg01205.html
https://www.redhat.com/archives/libvir-list/2016-August/msg00132.html
Kind regards,
Tomasz
Tomasz Flendrich (5):
Move validating chipset PCI slots to qemuDomainPCIAddressSetCreate
Make address assignment in qemuDomainPCIAddressSetCreate optional
Reduce number of parameters to qemuDomainPCIAddressSetCreate
qemu_hotplug: generate pci address set on demand
qemu: remove pciaddrs caching
src/qemu/qemu_domain.c | 1 -
src/qemu/qemu_domain.h | 1 -
src/qemu/qemu_domain_address.c | 222 +++++++++++++++++++++++------------------
src/qemu/qemu_domain_address.h | 6 ++
src/qemu/qemu_hotplug.c | 50 ++++++++--
5 files changed, 175 insertions(+), 105 deletions(-)
--
1.9.1
8 years, 8 months