[libvirt] [PATCH v2 0/2] bhyve: add volumes support
by Roman Bogorodskiy
Changes from v1:
- Add volume support for the bhyveload command as
well to allow booting from a volume
Roman Bogorodskiy (2):
conf: make disk source pool translation generic
bhyve: add volumes support
src/bhyve/bhyve_command.c | 16 ++-
src/bhyve/bhyve_command.h | 7 +-
src/bhyve/bhyve_driver.c | 4 +-
src/bhyve/bhyve_process.c | 4 +-
src/conf/domain_conf.c | 245 ++++++++++++++++++++++++++++++++++++++++++++++
src/conf/domain_conf.h | 3 +
src/libvirt_private.syms | 1 +
src/qemu/qemu_conf.c | 243 ---------------------------------------------
src/qemu/qemu_conf.h | 3 -
src/qemu/qemu_driver.c | 6 +-
src/qemu/qemu_hotplug.c | 2 +-
src/qemu/qemu_process.c | 4 +-
tests/bhyvexml2argvtest.c | 5 +-
tests/qemuxml2argvtest.c | 2 +-
14 files changed, 280 insertions(+), 265 deletions(-)
--
1.9.0
10 years, 4 months
[libvirt] [PATCH 00/66] vbox: Rewrite vbox domain driver
by Taowei
This series of patches rewrite the vbox's domain
driver. The driver is separated into two parts: the version
specified and the common part. The common driver use
vboxUniformedAPI to build a general driver for all vbox
versions. The vboxUniformedAPI take the responsiblity to
communicate with virtualbox. Since there are some incompatible
changes in virtualbox, vboxUniformedAPI should be aware of
these changes and provide a uniformed api for the upper layer.
The significant result of this patch is that we replace all
vir${vbox_version}Driver into one virCommonDriver. So, we will
have only one vbox driver implementation for all vbox versions
in libvirt.
PS: I have send part of my patches before:
https://www.redhat.com/archives/libvir-list/2014-July/msg00937.html
But I have to resend it beacuse I did some improvement on previous
patches:
*Remove the test case for vboxUniformedAPI, because it would raise
"break strict-aliasing rules" warning in some distibutions
*Merged the flag fdWatchNeedInitialize into domainEventCallbacks,
So, we use one flag to indicate whether vbox support callbacks
as well as we need to initialize variables for it.
Taowei (66):
vbox: Begin to rewrite, vboxConnectOpen
vbox: Rewrite vboxConnectClose
vbox: Rewrite vboxDomainSave
vbox: Rewrite vboxConnectGetVersion
vbox: Rewrite vboxConnectGetHostname
vbox: Rewrite vboxConnectIsSecure
vbox: Rewrite vboxConnectIsEncrypted
vbox: Rewrite vboxConnectIsAlive
vbox: Rewrite vboxConnectGetMaxVcpus
vbox: Rewrite vboxConnectGetCapabilities
vbox: Rewrite vboxConnectListDomains
vbox: Rewrite vboxConnectNumOfDomains
vbox: Rewrite vboxDomainLookupById
vbox: Rewrite vboxDomainLookupByUUID
vbox: Rewrite vboxDomainUndefineFlags
vbox: Rewrite vboxDomainDefineXML
vbox: Rewrite vboxDomainCreateWithFlags
vbox: Rewrite vboxDomainCreate
vbox: Rewrite vboxDomainCreateXML
vbox: Rewrite vboxDomainLookupByName
vbox: Rewrite vboxDomainIsActive
vbox: Rewrite vboxDomainIsPersistent
vbox: Rewrite vboxDomainIsUpdated
vbox: Rewrite vboxDomainSuspend
vbox: Rewrite vboxDomainResume
vbox: Rewrite vboxDomainShutdownFlags
vbox: Rewrite vboxDomainShutdown
vbox: Rewrite vboxDomainReboot
vbox: Rewrite vboxDomainDestroyFlags
vbox: Rewrite vboxDomainDestroy
vbox: Rewrite vboxDomainGetOSType
vbox: Rewrite vboxDomainSetMemory
vbox: Rewrite vboxDomainGetInfo
vbox: Rewrite vboxDomainGetState
vbox: Rewrite vboxDomainSetVcpusFlags
vbox: Rewrite vboxDomainSetVcpus
vbox: Rewrite vboxDomainGetVcpusFlags
vbox: Rewrite vboxDomainGetMaxVcpus
vbox: Add API for vboxDomainGetXMLDesc
vbox: Rewrite vboxDomainGetXMLDesc
vbox: Rewrite vboxConnectListDefinedDomains
vbox: Rewrite vboxConnectNumOfDefinedDomains
vbox: Rewrite vboxDomainUndefine
vbox: Rewrite vboxDomainAttachDevice
vbox: Rewrite vboxDomainAttachDeviceFlags
vbox: Rewrite vboxDomainUpdateDeviceFlags
vbox: Rewrite vboxDomainDetachDevice
vbox: Rewrite vboxDomainDetachDeviceFlags
vbox: Add API for vboxDomainSnapshotCreateXML
vbox: Rewrite vboxDomainSnapshotCreateXML
vbox: Rewrite vboxDomainSnapshotGetXMLDesc
vbox: Rewrite vboxDomainSnapshotNum
vbox: Rewrite vboxDomainSnapshotListNames
vbox: Rewrite vboxSnapshotLookupByName
vbox: Rewrite vboxDomainHasCurrentSnapshot
vbox: Rewrite vboxDomainSnapshotGetParent
vbox: Rewrite vboxDomainSnapshotCurrent
vbox: Rewrite vboxDomainSnapshotIsCurrent
vbox: Rewrite vboxDomainSnapshotHasMetadata
vbox: Rewrite vboxDomainRevertToSnapshot
vbox: Rewrite vboxDomainSnapshotDelete
vbox: Rewrite vboxDomainScreenshot
vbox: Rewrite vboxConnectListAllDomains
vbox: Rewrite vboxNode functions
vbox: Add registerDomainEvent
vbox: Introducing vboxCommonDriver
po/POTFILES.in | 1 +
src/Makefile.am | 5 +-
src/vbox/README | 7 +-
src/vbox/vbox_common.c | 7550 +++++++++++++++++++++
src/vbox/vbox_common.h | 306 +
src/vbox/vbox_driver.c | 40 +-
src/vbox/vbox_install_api.h | 26 +
src/vbox/vbox_tmpl.c |14557 +++++++++++++----------------------------
src/vbox/vbox_uniformed_api.h | 551 ++
9 files changed, 13186 insertions(+), 9857 deletions(-)
create mode 100644 src/vbox/vbox_common.c
create mode 100644 src/vbox/vbox_common.h
create mode 100644 src/vbox/vbox_install_api.h
create mode 100644 src/vbox/vbox_uniformed_api.h
--
1.7.9.5
10 years, 4 months
[libvirt] [PATCH] build: force configure failed when perl is missing
by Jincheng Miao
Perl is necessary to our build processing, it will invoke a lot of
generating script, like: gendispatch.pl. If perl is missing, it's
ok for build from git checkout, because autogen.sh will tell you.
But for compiling from a release tarball, configure will just record
a missing message, and continue, then build failed, like:
https://www.redhat.com/archives/libvirt-users/2014-August/msg00050.html
So need to enhance configure script to handle this negative case.
Reported-by: Hongbin Lu <hongbin(a)savinetwork.ca>
Signed-off-by: Jincheng Miao <jmiao(a)redhat.com>
---
configure.ac | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/configure.ac b/configure.ac
index 081f298..af3fe28 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2173,6 +2173,9 @@ AM_CONDITIONAL([WITH_HYPERV], [test "$with_hyperv" = "yes"])
dnl Allow perl/python overrides
AC_PATH_PROGS([PYTHON], [python2 python])
AC_PATH_PROG([PERL], [perl])
+if test -z "$PERL"; then
+ AC_MSG_ERROR([Failed to find perl.])
+fi
AC_ARG_WITH([test-suite],
[AS_HELP_STRING([--with-test-suite],
--
1.7.1
10 years, 4 months
[libvirt] [PATCH V5 00/12] xen_xm.c code refactor
by Kiarie Kahurani
Kiarie Kahurani (12):
src/xenxs: Export code for reuse
src/xenxs: Refactor code formating general VM config
src/xenxs: Refactor code formating memory config
src/xenxs: Refactor code formating virtual time config
src/xenxs: Refactor code formating event actions config
src/xenxs: Refactor code formating Char devices config
src/xenxs: Refactor code formating xm disk config
src/xenxs: Refactor code formating CPU features config
src/xenxs: Refactor code formating OS config
src/xenxs: Refactor code formating Vfb config
src/xenxs: Refactor code formating emulated devices config
src/xenxs: Export code
src/xenxs/xen_xm.c | 858 +++++++++++++--------
src/xenxs/xen_xm.h | 4 +
tests/xmconfigdata/test-escape-paths.cfg | 12 +-
tests/xmconfigdata/test-fullvirt-force-hpet.cfg | 10 +-
tests/xmconfigdata/test-fullvirt-force-nohpet.cfg | 10 +-
tests/xmconfigdata/test-fullvirt-localtime.cfg | 10 +-
tests/xmconfigdata/test-fullvirt-net-ioemu.cfg | 10 +-
tests/xmconfigdata/test-fullvirt-net-netfront.cfg | 10 +-
tests/xmconfigdata/test-fullvirt-new-cdrom.cfg | 10 +-
tests/xmconfigdata/test-fullvirt-old-cdrom.cfg | 10 +-
tests/xmconfigdata/test-fullvirt-parallel-tcp.cfg | 10 +-
.../test-fullvirt-serial-dev-2-ports.cfg | 10 +-
.../test-fullvirt-serial-dev-2nd-port.cfg | 10 +-
tests/xmconfigdata/test-fullvirt-serial-file.cfg | 10 +-
tests/xmconfigdata/test-fullvirt-serial-null.cfg | 10 +-
tests/xmconfigdata/test-fullvirt-serial-pipe.cfg | 10 +-
tests/xmconfigdata/test-fullvirt-serial-pty.cfg | 10 +-
tests/xmconfigdata/test-fullvirt-serial-stdio.cfg | 10 +-
.../test-fullvirt-serial-tcp-telnet.cfg | 10 +-
tests/xmconfigdata/test-fullvirt-serial-tcp.cfg | 10 +-
tests/xmconfigdata/test-fullvirt-serial-udp.cfg | 10 +-
tests/xmconfigdata/test-fullvirt-serial-unix.cfg | 10 +-
tests/xmconfigdata/test-fullvirt-sound.cfg | 12 +-
tests/xmconfigdata/test-fullvirt-usbmouse.cfg | 10 +-
tests/xmconfigdata/test-fullvirt-usbtablet.cfg | 10 +-
tests/xmconfigdata/test-fullvirt-utc.cfg | 10 +-
tests/xmconfigdata/test-no-source-cdrom.cfg | 10 +-
tests/xmconfigdata/test-paravirt-net-e1000.cfg | 2 +-
tests/xmconfigdata/test-paravirt-net-vifname.cfg | 2 +-
.../test-paravirt-new-pvfb-vncdisplay.cfg | 2 +-
tests/xmconfigdata/test-paravirt-new-pvfb.cfg | 2 +-
.../test-paravirt-old-pvfb-vncdisplay.cfg | 2 +-
tests/xmconfigdata/test-paravirt-old-pvfb.cfg | 2 +-
tests/xmconfigdata/test-paravirt-vcpu.cfg | 2 +-
tests/xmconfigdata/test-pci-devs.cfg | 10 +-
35 files changed, 663 insertions(+), 477 deletions(-)
This series refactor xen_xm.c code into functions for reuse
when writing a xen-xl parser.
Changes since V4
fixed SOB issue.
--
1.8.4.5
10 years, 4 months
[libvirt] [PATCH] qemu_process: fix memleak found by coverity
by Pavel Hrdina
Signed-off-by: Pavel Hrdina <phrdina(a)redhat.com>
---
Pushed as trivial
src/qemu/qemu_process.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index 13c396f..52d9052 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -2323,8 +2323,10 @@ qemuProcessInitPasswords(virConnectPtr conn,
goto cleanup;
alias = vm->def->disks[i]->info.alias;
- if (qemuDomainObjEnterMonitorAsync(driver, vm, asyncJob) < 0)
+ if (qemuDomainObjEnterMonitorAsync(driver, vm, asyncJob) < 0) {
+ VIR_FREE(secret);
goto cleanup;
+ }
ret = qemuMonitorSetDrivePassphrase(priv->mon, alias, secret);
VIR_FREE(secret);
qemuDomainObjExitMonitor(driver, vm);
--
1.8.5.5
10 years, 4 months
[libvirt] questions on backing chain file, block lun, active commit
by Eric Blake
While investigating active commit, I noticed that our code for probing
backing chains currently guesses at type="file" vs. type="block" solely
based on stat results (regular file vs. block device). Is a block
device allowed to be used as <disk type='block' device='lun'> at the
same time it has qcow2 format, or does use of device='lun' enforce that
the block device is used with raw format? My worry is that if a lun
device can be used with qcow2 format, then it can have a non-block
backing file, and an active commit would convert <disk type='block'
device='lun'> into <disk type='file' device='lun'> which is not valid.
On a related vein, that means that an active commit currently auto-picks
whether the <disk> will be listed as type='file' or type='block' solely
on the stat results. Elsewhere, we allow type='file' even for block
devices, where a noticeable difference is how virDomainGetBlockInfo()
reports allocation (for type='file', allocation is based on how sparse
the file is, but a block device is not sparse; for type='block',
allocation is based on asking qemu the maximum used cluster). Should we
be auto-converting to type='block' in other cases where we have stat
results? For example, I posted a patch today to let the user explicitly
request that virsh blockcopy to a block device will use type='block'
because the existing code has always used type='file', but if we were
doing things automatically, then the user would automatically get
type='block' for block device destinations instead of having to request
it; but has no way to forcefully list a file even when the destination
is a block (at least, not until I implement virDomainBlockCopy() that
takes an XML <disk> description).
One drawback of autoconversion is the XML changes - with type='file',
the host resource is located at xpath disk/source/@file, but with
type='block', it is at xpath disk/source/@dev. If we ever convert a
user's type='file' into a block device, but the user isn't expecting the
conversion, then they won't be able to find the source file name in the
output XML. So on that ground, autoprobing type='block' for active
commit is fishy; we really should be honoring the user's input for
<backingStore> rather than probing it ourselves every time. Until that
point, and given that I just proposed a patch to turn on type='block'
for blockcopy, where type='file' is used in all other cases, should we
have the same sort of flag for active commit?
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
10 years, 4 months
[libvirt] [PATCH] [RFC] net: don't segfault on Martin's setup
by Martin Kletzander
No, don't worry, this is not a real commit message, this is more like
an RFC about how to fix it. I'm not sure about this part of libvirt
codebase, so I'm rather asking for help. Apparently, I have a network
with netdef->forward.pfs == NULL, I suspect this is a network I have,
that doesn't have any <forward/> element.
With the following fix, everything works as expected, but I'm almost
certain this is not enough.
Signed-off-by: Martin Kletzander <mkletzan(a)redhat.com>
---
src/network/bridge_driver.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c
index 1ba4c3d..3a40124 100644
--- a/src/network/bridge_driver.c
+++ b/src/network/bridge_driver.c
@@ -2196,6 +2196,9 @@ networkCreateInterfacePool(virNetworkDefPtr netdef)
int ret = -1;
size_t i;
+ if (!netdef->forward.pfs)
+ return 0;
+
if ((virNetDevGetVirtualFunctions(netdef->forward.pfs->dev,
&vfNames, &virtFns, &numVirtFns)) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
--
2.0.4
10 years, 4 months
[libvirt] [PATCH] Maximum vlanid should be 4095 in interface.rng
by Jianwei Hu
The correct vlanid range is 0~4095.
After merging this patch, we can not validate a interface xml with vlanid >= 4096.
[root@localhost ~]# cat vlan.xml
<interface type='vlan' name='eno1.4096'>
<start mode='onboot'/>
<protocol family='ipv4'>
<dhcp/>
</protocol>
<vlan tag='4096'>
<interface name='eno1'/>
</vlan>
</interface>
[root@localhost ~]# virt-xml-validate vlan.xml
vlan.xml:1: element interface: Relax-NG validity error : Invalid sequence in interleave
vlan.xml:6: element vlan: Relax-NG validity error : Element interface failed to validate content
vlan.xml:6: element vlan: Relax-NG validity error : Element vlan failed to validate attributes
vlan.xml fails to validate
[root@localhost ~]#
Here is a ip command help on this.
[root@localhost /]# ip link add link eno1 name eno1.90 type vlan help
Usage: ... vlan [ protocol VLANPROTO ] id VLANID [ FLAG-LIST ]
[ ingress-qos-map QOS-MAP ] [ egress-qos-map QOS-MAP ]
VLANPROTO: [ 802.1Q / 802.1ad ]
VLANID := 0-4095
FLAG-LIST := [ FLAG-LIST ] FLAG
FLAG := [ reorder_hdr { on | off } ] [ gvrp { on | off } ] [ mvrp { on | off } ]
[ loose_binding { on | off } ]
QOS-MAP := [ QOS-MAP ] QOS-MAPPING
QOS-MAPPING := FROM:TO
---
docs/schemas/interface.rng | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/schemas/interface.rng b/docs/schemas/interface.rng
index 80962d4..0f577d6 100644
--- a/docs/schemas/interface.rng
+++ b/docs/schemas/interface.rng
@@ -440,7 +440,7 @@
<define name='vlan-id'>
<data type="unsignedInt">
- <param name="maxInclusive">4096</param>
+ <param name="maxInclusive">4095</param>
</data>
</define>
</grammar>
--
1.8.3.1
10 years, 4 months
[libvirt] [PATCH] LXC: Fix virLXCControllerSetupDevPTS() wrt user namespaces
by Richard Weinberger
The gid value passed to devpts has to be translated by hand as
virLXCControllerSetupDevPTS() is called before setting up the user
and group mappings.
Otherwise devpts will use an unmapped gid and openpty()
will fail within containers.
Linux commit commit 23adbe12
("fs,userns: Change inode_capable to capable_wrt_inode_uidgid")
uncovered that issue.
Signed-off-by: Richard Weinberger <richard(a)nod.at>
---
src/lxc/lxc_controller.c | 25 +++++++++++++++++++++++--
1 file changed, 23 insertions(+), 2 deletions(-)
diff --git a/src/lxc/lxc_controller.c b/src/lxc/lxc_controller.c
index 2d220eb..82ecf12 100644
--- a/src/lxc/lxc_controller.c
+++ b/src/lxc/lxc_controller.c
@@ -1164,6 +1164,19 @@ static int virLXCControllerMain(virLXCControllerPtr ctrl)
return rc;
}
+static uint32_t
+virLXCControllerLookupUsernsMap(virDomainIdMapEntryPtr map, int num,
+ uint32_t src)
+{
+ int i;
+
+ for (i = 0; i < num; i++) {
+ if (src > map[i].start && src < map[i].start + map[i].count)
+ return map[i].target + (src - map[i].start);
+ }
+
+ return src;
+}
static int
virLXCControllerSetupUsernsMap(virDomainIdMapEntryPtr map,
@@ -1930,6 +1943,7 @@ virLXCControllerSetupDevPTS(virLXCControllerPtr ctrl)
char *opts = NULL;
char *devpts = NULL;
int ret = -1;
+ gid_t ptsgid = 5;
VIR_DEBUG("Setting up private /dev/pts");
@@ -1949,10 +1963,17 @@ virLXCControllerSetupDevPTS(virLXCControllerPtr ctrl)
goto cleanup;
}
+ if (ctrl->def->idmap.ngidmap)
+ ptsgid =
+ virLXCControllerLookupUsernsMap(ctrl->def->idmap.gidmap,
+ ctrl->def->idmap.ngidmap,
+ ptsgid);
+
/* XXX should we support gid=X for X!=5 for distros which use
* a different gid for tty? */
- if (virAsprintf(&opts, "newinstance,ptmxmode=0666,mode=0620,gid=5%s",
- (mount_options ? mount_options : "")) < 0)
+ if (virAsprintf
+ (&opts, "newinstance,ptmxmode=0666,mode=0620,gid=%u%s", ptsgid,
+ (mount_options ? mount_options : "")) < 0)
goto cleanup;
VIR_DEBUG("Mount devpts on %s type=tmpfs flags=%x, opts=%s",
--
2.0.1
10 years, 4 months