[libvirt] [PATCH v2 00/12] parallels: rewrite driver with parallels SDK
by Dmitry Guryanov
This patch series replaces all code, which used prlctl command
to interact with parallels cloud server with calls to
parallels sdk functions.
The model of this driver remain almost the same - in creates a
list of virDomainObj objects on connect and then functions, which
returns different information get info from this list.
Changes in v2:
* Rebase to latest libvirt sources
* Use only "parallels" prefix for functions in parallelsDriver,
so that make check will pass
* Update privconn->domains in case we change something from current
connection.
Alexander Burluka (4):
parallels: get domain info with SDK
parallels: handle events from parallels server
parallels: added function virDomainIsActive()
parallels: Add domainCreateWithFlags() function.
Dmitry Guryanov (8):
parallels: move IS_CT macro to parallels_utils.h
parallels: move parallelsDomNotFoundError to parallels_utils.h
parallels: reimplement functions, which change domain state
parallels: rewrite parallelsApplyConfig with SDK
parallels: create VMs and containers with sdk
parallels: refactor parallelsDomainDefineXML
parallels: add cdroms support
parallels: implement domainUndefine and domainUndefineFlags
src/parallels/parallels_driver.c | 2456 ++++++++------------------------------
src/parallels/parallels_sdk.c | 2451 +++++++++++++++++++++++++++++++++++++
src/parallels/parallels_sdk.h | 25 +
src/parallels/parallels_utils.h | 11 +
4 files changed, 2957 insertions(+), 1986 deletions(-)
--
1.9.3
10 years
[libvirt] [PATCH 00/12] parallels: use SDK in parallels_driver.c
by Dmitry Guryanov
This patch series replaces all code, which used prlctl command
to interact with parallels cloud server with calls to
parallels sdk functions.
The model of this driver remain almost the same - in creates a
list of virDomainObj objects on connect and then functions, which
returns different information get info from this list.
But functions, which modify domains (change state, define or undefine
domain) don't modify this list directly. On connect driver subscribes
to event from PCS and modify the list from that events handler.
So cached list of domains will be always up-to-date either after
modifications from currect connection or after modifications by
another tools (like prlctl) or libvirt connections.
Alexander Burluka (4):
parallels: get domain info with SDK
parallels: handle events from parallels server
parallels: added function virDomainIsActive()
parallels: Add domainCreateWithFlags() function.
Dmitry Guryanov (8):
parallels: move IS_CT macro to parallels_utils.h
parallels: move parallelsDomNotFoundError to parallels_utils.h
parallels: reimplement functions, which change domain state
parallels: rewrite parallelsApplyConfig with SDK
parallels: create VMs and containers with sdk
parallels: fix parallelsDomainDefineXML
parallels: add cdroms support
parallels: implement domainUndefine and domainUndefineFlags
src/parallels/parallels_driver.c | 2448 +++++++------------------------------
src/parallels/parallels_sdk.c | 2456 ++++++++++++++++++++++++++++++++++++++
src/parallels/parallels_sdk.h | 19 +
src/parallels/parallels_utils.h | 11 +
4 files changed, 2939 insertions(+), 1995 deletions(-)
--
1.9.3
10 years
[libvirt] [PowerPC Patch v3] Libvirt CPU enhancements for Power KVM
by Prerna Saxena
This patch series is a collection of enhancements for PowerPC CPUs on PowerKVM.
Series Summary:
==========
Patch 1/3 : Introduce a new architecture 'ppc64le' for libvirt.
Patch 2/3 : Add libvirt support for VMs running in 'compat' mode on Power KVM.
Patch 3/3 : Optimize PVR comparison for PowerPC CPUs.
Detail:
====
* PowerPC has traditionally been a Big-endian architecture. However, with PowerPC ISA version 2.07, it can run in Little-endian mode as well. IBM Power8 processors, compliant with ISA 2.07 allow launching VMs in little-endian mode. This is signified by 'ppc64le' architecture. Patch 1 adds this support to libvirt, to allow running VMs based on ppc64le architecture.
* Patch 2,3 tweak libvirt to correctly model PowerPC CPUs based on recent PowerKVM implementation.
PowerKVM permits VMs with vcpus in the following allowed modes :
i) Host native mode:
where the vcpu seen in the VM belongs to the same processor generation as the host.
Example: A POWER7 host, conforming to PowerISA version 2.06, will run VMs with "power7" vcpus.
ii) Binary Compatibility ("compat") mode:
PowerISA allows processors to run VMs in binary compatibility ("compat") mode supporting an older version of ISA.
As an example: In compatibility mode, a POWER7 host can run a "power6" VM, conforming to power ISA v2.05.
Similarly, a POWER8 host can run a "power7" VM conforming to PowerISA v2.06.
QEMU has recently added support to explicitly denote a VM running in compatibility mode through commits 6d9412ea & 8dfa3a5e85. Henceforth, VMs of type (i) will be invoked with the QEMU invocation "-cpu host", while VMs of type (ii) will be invoked using "-cpu host, compat=power6".
Now, an explicit cpu selection using "-cpu POWER6" is not valid. Instead, the recommended practice is to use the matching compat mode, if the requested cpu type differs from the host.
Patches 2-3 address various aspects of this change.
* Patch 2 : Adds support for generating the correct command line for QEMU. New xml semantics are introduced to signify this type.
* Patch 3 : PowerKVM vCPUs differ uniquely across generations ( such as power6, power7, power8). Each generation signifies a new PowerISA version that exhibits features unique to that generation. The higher order 16 bits of PVR denote the processor generation and the lower order 16 bits denote the cpu chip (sub)version.
For all practical purposes of launching a VM, we care about the generation the vCPU will belong to, and not specifically the chip version. In fact, PowerKVM does not seek out specification of a unique chip version(such as POWER7_v2.3) for running a vCPU. This patch updates the libvirt PVR check to reflect this relationship.
Changelog:
=========
v1 : https://www.redhat.com/archives/libvir-list/2014-June/msg01338.html
v2 : http://www.redhat.com/archives/libvir-list/2014-October/msg00351.html
Changes since v2:
i) CPU compat mode is now introduced under CPU mode 'host-model' as against the original proposal of using cpu mode'custom'. (Thanks for the tip, Dan.)
ii) Patch 4/4 that renamed models in cpu_map.xml is dropped. Instead, CPU generations are added to cpu_map.xml as new listings. The PVR check in patch 3 of this series takes care of making the right match happen for compat mode.
Regards,
--
Prerna Saxena
Linux Technology Centre,
IBM Systems and Technology Lab,
Bangalore, India
10 years
[libvirt] [python v2 PATCH] Add dict check for setTime and allow pass one valid parameter
by Luyao Huang
When pass None to time, it will set guest time to 0.
When pass an empty dictionary, it will report error.
Allow a one-element dictionary which contains 'seconds'
or 'nseconds', setting JUST seconds will do the sane
thing of passing 0 for nseconds, instead of erroring out.
Signed-off-by: Luyao Huang <lhuang(a)redhat.com>
---
libvirt-override-virDomain.py | 2 ++
libvirt-override.c | 26 +++++++++++++++++++++++---
2 files changed, 25 insertions(+), 3 deletions(-)
diff --git a/libvirt-override-virDomain.py b/libvirt-override-virDomain.py
index a50ec0d..d788657 100644
--- a/libvirt-override-virDomain.py
+++ b/libvirt-override-virDomain.py
@@ -69,6 +69,8 @@
def setTime(self, time=None, flags=0):
"""Set guest time to the given value. @time is a dict conatining
'seconds' field for seconds and 'nseconds' field for nanosecons """
+ if time is None:
+ time = {'nseconds': 0, 'seconds': 0L}
ret = libvirtmod.virDomainSetTime(self._o, time, flags)
if ret == -1: raise libvirtError ('virDomainSetTime() failed', dom=self)
return ret
diff --git a/libvirt-override.c b/libvirt-override.c
index a53b46f..5c016f9 100644
--- a/libvirt-override.c
+++ b/libvirt-override.c
@@ -7798,8 +7798,28 @@ libvirt_virDomainSetTime(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) {
domain = (virDomainPtr) PyvirDomain_Get(pyobj_domain);
py_dict_size = PyDict_Size(py_dict);
+
+ if (py_dict_size == 1) {
+ PyObject *pyobj_seconds, *pyobj_nseconds;
+
+ if ((pyobj_seconds = PyDict_GetItemString(py_dict, "seconds")) &&
+ (libvirt_longlongUnwrap(pyobj_seconds, &seconds) < 0)) {
+ PyErr_Format(PyExc_LookupError, "malformed 'seconds'");
+ goto cleanup;
+ }
- if (py_dict_size == 2) {
+ if ((pyobj_nseconds = PyDict_GetItemString(py_dict, "nseconds")) &&
+ (libvirt_uintUnwrap(pyobj_nseconds, &nseconds) < 0)) {
+ PyErr_Format(PyExc_LookupError, "malformed 'nseconds'");
+ goto cleanup;
+ }
+
+ if (!pyobj_nseconds && !pyobj_seconds) {
+ PyErr_Format(PyExc_LookupError, "Dictionary must contain "
+ "'seconds' or 'nseconds'");
+ goto cleanup;
+ }
+ } else if (py_dict_size == 2) {
PyObject *pyobj_seconds, *pyobj_nseconds;
if (!(pyobj_seconds = PyDict_GetItemString(py_dict, "seconds")) ||
@@ -7813,9 +7833,9 @@ libvirt_virDomainSetTime(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) {
PyErr_Format(PyExc_LookupError, "malformed or missing 'nseconds'");
goto cleanup;
}
- } else if (py_dict_size > 0) {
+ } else if (py_dict_size >= 0) {
PyErr_Format(PyExc_LookupError, "Dictionary must contain "
- "'seconds' and 'nseconds'");
+ "'seconds' or 'nseconds'");
goto cleanup;
}
--
1.8.3.1
10 years
[libvirt] [PATCH 0/5] Guest filesystem information API
by Tomoki Sekiyama
Hi,
This series implements a new virDomainGetFSInfo API, that returns a list of
mounted filesystems information in the guest, collected via the guest agent.
The returned info contains mountpoints and disk device alias named in
libvirt, so we can know which mountpoints should be frozen by
virDomainFSFreeze to take snapshots of a part of disks.
---
Tomoki Sekiyama (5):
Implement public API for virDomainGetFSInfo
remote: Implement the remote protocol for virDomainGetFSInfo
qemu: Implement the qemu driver for virDomainGetFSInfo
qemu: add test for qemuAgentGetFSInfo
virsh: expose virDomainGetFSInfo
daemon/remote.c | 117 +++++++++++++++++++++
include/libvirt/libvirt.h.in | 21 ++++
src/conf/domain_conf.c | 71 +++++++++++++
src/conf/domain_conf.h | 6 +
src/driver.h | 6 +
src/libvirt.c | 68 ++++++++++++
src/libvirt_private.syms | 1
src/libvirt_public.syms | 6 +
src/qemu/qemu_agent.c | 165 ++++++++++++++++++++++++++++++
src/qemu/qemu_agent.h | 2
src/qemu/qemu_driver.c | 48 +++++++++
src/remote/remote_driver.c | 87 ++++++++++++++++
src/remote/remote_protocol.x | 32 ++++++
src/remote_protocol-structs | 21 ++++
src/rpc/gendispatch.pl | 1
tests/Makefile.am | 1
tests/qemuagentdata/qemuagent-fsinfo.xml | 27 +++++
tests/qemuagenttest.c | 118 +++++++++++++++++++++
tools/virsh-domain.c | 70 +++++++++++++
19 files changed, 867 insertions(+), 1 deletion(-)
create mode 100644 tests/qemuagentdata/qemuagent-fsinfo.xml
--
Tomoki Sekiyama
10 years
[libvirt] [PATCH] qemu: forbid snapshot-delete --children-only on external snapshot
by Eric Blake
https://bugzilla.redhat.com/show_bug.cgi?id=956506 documents that
given a domain where an internal snapshot parent has an external
snapshot child, we lacked a safety check when trying to use the
--children-only option to snapshot-delete:
$ virsh start dom
$ virsh snapshot-create-as dom internal
$ virsh snapshot-create-as dom external --disk-only
$ virsh snapshot-delete dom external
error: Failed to delete snapshot external
error: unsupported configuration: deletion of 1 external disk snapshots not supported yet
$ virsh snapshot-delete dom internal --children
error: Failed to delete snapshot internal
error: unsupported configuration: deletion of 1 external disk snapshots not supported yet
$ virsh snapshot-delete dom internal --children-only
Domain snapshot internal children deleted
While I'd still like to see patches that actually do proper external
snapshot deletion, we should at least fix the inconsistency in the
meantime. With this patch:
$ virsh snapshot-delete dom internal --children-only
error: Failed to delete snapshot internal
error: unsupported configuration: deletion of 1 external disk snapshots not supported yet
* src/qemu/qemu_driver.c (qemuDomainSnapshotDelete): Fix condition.
Signed-off-by: Eric Blake <eblake(a)redhat.com>
---
src/qemu/qemu_driver.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index cd8d3c7..5eccacc 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -14812,7 +14812,8 @@ qemuDomainSnapshotDelete(virDomainSnapshotPtr snapshot,
if (!(flags & VIR_DOMAIN_SNAPSHOT_DELETE_CHILDREN_ONLY) &&
virDomainSnapshotIsExternal(snap))
external++;
- if (flags & VIR_DOMAIN_SNAPSHOT_DELETE_CHILDREN)
+ if (flags & (VIR_DOMAIN_SNAPSHOT_DELETE_CHILDREN |
+ VIR_DOMAIN_SNAPSHOT_DELETE_CHILDREN_ONLY))
virDomainSnapshotForEachDescendant(snap,
qemuDomainSnapshotCountExternal,
&external);
--
1.9.3
10 years
[libvirt] [PATCH v5 0/7] qemu: Introduce support for new the block_set_io_throttle parameters add in the version 1.7 of qemu.
by Matthias Gatto
This series of patches add support for bps_max, bps_rd_max, bps_wr_max,
bps_max, bps_rd_max, bps_wr_max, and iops_size in the functions qemuDomainSetBlockIoTune and qemuDomainGetBlockIoTune.
The last patch add support for these parameters to the virsh blkdeviotune command.
v2: spellfix
v3: Merge patch 1/9,2/9,5/9 together.
Change the capability detection.(patch 2/7 and 3/7).
Try to make the usage of QEMU_NB_BLOCK_IO_TUNE_PARAM_MAX more explicit(patch 3/7).
v4: Rebase on HEAD.
Update qemu_driver to comply with Pavel's patchs.(patch 3/6)
Remove the qemu_monitor_text modification.(remove old patch 5/7)
v5: Split patch 1/6 in two.
Add documentation for the new xml options (patch 2/7)
Change (void) to ATTRIBUTE_UNUSED (patch 4/7)
Capability detection of supportMaxOptions move before usage of supportMaxOptions
Matthias Gatto (7):
qemu: Add define for the news throttle options
qemu: Modify the structure _virDomainBlockIoTuneInfo.
qemu: Add the capability to detect if the qemu binary have the
capability to use bps_max and friends
qemu: Add bps_max and friends qemu driver
qemu: Add bps_max and friends QMP suport
qemu: add bps_max and friends to qemu command generation
virsh: Add bps_max and friends to virsh
docs/formatdomain.html.in | 25 ++++
docs/schemas/domaincommon.rng | 43 +++++++
include/libvirt/libvirt.h.in | 110 ++++++++++++++++
src/conf/domain_conf.c | 110 +++++++++++++++-
src/conf/domain_conf.h | 7 +
src/qemu/qemu_capabilities.c | 2 +
src/qemu/qemu_capabilities.h | 1 +
src/qemu/qemu_command.c | 57 +++++++-
src/qemu/qemu_driver.c | 186 ++++++++++++++++++++++++++-
src/qemu/qemu_monitor.c | 10 +-
src/qemu/qemu_monitor.h | 6 +-
src/qemu/qemu_monitor_json.c | 64 +++++++--
src/qemu/qemu_monitor_json.h | 6 +-
tests/qemucapabilitiesdata/caps_2.1.1-1.caps | 1 +
tests/qemumonitorjsontest.c | 6 +-
tools/virsh-domain.c | 119 +++++++++++++++++
tools/virsh.pod | 10 ++
17 files changed, 730 insertions(+), 33 deletions(-)
--
1.8.3.1
10 years
[libvirt] [libvirt-tck PATCH] Fix PCI device hotplug tests
by Jim Fehlig
This patch fixes a few issues noted while enabling the TCK PCI device
hotplug tests.
First, the call to node device dettach function misses parameters, resulting
in the following failure
Failed test 'detached device from host OS'
at /usr/share/libvirt-tck/tests/domain/250-pci-host-hotplug.t line 90.
died: Usage: Sys::Virt::NodeDevice::dettach(dev, driversv, flags=0)
at /usr/share/libvirt-tck/tests/domain/250-pci-host-hotplug.t line 90.
Trivally fixed by adding the missing parameters when calling node device
dettach function.
Second, it appears qemu needs to reach some state of initialization before
host device attach/detach works properly. Currently, the test fails when
detaching the device from the guest, resetting it, and reattaching it to
the host
Failed test 'reset the host PCI device'
at /usr/share/libvirt-tck/tests/domain/250-pci-host-hotplug.t line 110.
died: Sys::Virt::Error (libvirt error code: 1, message: internal error:
Not resetting active device 0000:03:00.1)
Failed test 'reattached device to host OS'
at /usr/share/libvirt-tck/tests/domain/250-pci-host-hotplug.t line 111.
died: Sys::Virt::Error (libvirt error code: 55, message: Requested operation
is not valid: PCI device 0000:03:00.1 is still in use by driver QEMU, domain
tck)
I've found that sleeping for a bit after creating the guest allows the
tests to pass.
While here, also fix a small typo from copy and paste of disk tests.
Signed-off-by: Jim Fehlig <jfehlig(a)suse.com>
---
scripts/domain/250-pci-host-hotplug.t | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/scripts/domain/250-pci-host-hotplug.t b/scripts/domain/250-pci-host-hotplug.t
index 4579477..e128de7 100644
--- a/scripts/domain/250-pci-host-hotplug.t
+++ b/scripts/domain/250-pci-host-hotplug.t
@@ -52,6 +52,8 @@ my $xml = $tck->generic_domain(name => "tck")->as_xml;
diag "Creating a new transient domain";
my $dom;
ok_domain(sub { $dom = $conn->create_domain($xml) }, "created transient domain object");
+diag "Waiting 10 seconds for guest to initialize";
+sleep(10);
my ($domain, $bus, $slot, $function) = $tck->get_host_pci_device();
@@ -86,7 +88,7 @@ SKIP: {
ok(defined $nodedev, "found PCI device $domain:$bus:$slot.$function on host");
- lives_ok(sub { $nodedev->dettach() }, "detached device from host OS");
+ lives_ok(sub { $nodedev->dettach(undef, 0) }, "detached device from host OS");
lives_ok(sub { $nodedev->reset() }, "reset the host PCI device");
my $devxml =
@@ -112,6 +114,6 @@ SKIP: {
my $finalxml = $dom->get_xml_description;
- is($initialxml, $finalxml, "final XML has removed the disk")
+ is($initialxml, $finalxml, "final XML has removed the PCI device")
}
--
1.8.4.5
10 years
[libvirt] [PATCH 01/21] Added missing virBufferFreeAndReset on the query buffer to free some memory
by Yves Vinter
From: yvinter <yves.vinter(a)bull.net>
---
src/hyperv/hyperv_driver.c | 13 +++++++++++++
src/hyperv/hyperv_wmi.c | 15 +++++++++++----
2 files changed, 24 insertions(+), 4 deletions(-)
diff --git a/src/hyperv/hyperv_driver.c b/src/hyperv/hyperv_driver.c
index aed9307..372ff39 100644
--- a/src/hyperv/hyperv_driver.c
+++ b/src/hyperv/hyperv_driver.c
@@ -201,6 +201,7 @@ hypervConnectOpen(virConnectPtr conn, virConnectAuthPtr auth, unsigned int flags
VIR_FREE(username);
VIR_FREE(password);
hypervFreeObject(priv, (hypervObject *)computerSystem);
+ virBufferFreeAndReset(&query);
return result;
}
@@ -254,6 +255,7 @@ hypervConnectGetHostname(virConnectPtr conn)
cleanup:
hypervFreeObject(priv, (hypervObject *)computerSystem);
+ virBufferFreeAndReset(&query);
return hostname;
}
@@ -352,6 +354,7 @@ hypervNodeGetInfo(virConnectPtr conn, virNodeInfoPtr info)
cleanup:
hypervFreeObject(priv, (hypervObject *)computerSystem);
hypervFreeObject(priv, (hypervObject *)processorList);
+ virBufferFreeAndReset(&query);
return result;
}
@@ -396,6 +399,7 @@ hypervConnectListDomains(virConnectPtr conn, int *ids, int maxids)
cleanup:
hypervFreeObject(priv, (hypervObject *)computerSystemList);
+ virBufferFreeAndReset(&query);
return success ? count : -1;
}
@@ -432,6 +436,7 @@ hypervConnectNumOfDomains(virConnectPtr conn)
cleanup:
hypervFreeObject(priv, (hypervObject *)computerSystemList);
+ virBufferFreeAndReset(&query);
return success ? count : -1;
}
@@ -464,6 +469,7 @@ hypervDomainLookupByID(virConnectPtr conn, int id)
cleanup:
hypervFreeObject(priv, (hypervObject *)computerSystem);
+ virBufferFreeAndReset(&query);
return domain;
}
@@ -500,6 +506,7 @@ hypervDomainLookupByUUID(virConnectPtr conn, const unsigned char *uuid)
cleanup:
hypervFreeObject(priv, (hypervObject *)computerSystem);
+ virBufferFreeAndReset(&query);
return domain;
}
@@ -533,6 +540,7 @@ hypervDomainLookupByName(virConnectPtr conn, const char *name)
cleanup:
hypervFreeObject(priv, (hypervObject *)computerSystem);
+ virBufferFreeAndReset(&query);
return domain;
}
@@ -748,6 +756,7 @@ hypervDomainGetInfo(virDomainPtr domain, virDomainInfoPtr info)
hypervFreeObject(priv, (hypervObject *)virtualSystemSettingData);
hypervFreeObject(priv, (hypervObject *)processorSettingData);
hypervFreeObject(priv, (hypervObject *)memorySettingData);
+ virBufferFreeAndReset(&query);
return result;
}
@@ -915,6 +924,7 @@ hypervDomainGetXMLDesc(virDomainPtr domain, unsigned int flags)
hypervFreeObject(priv, (hypervObject *)virtualSystemSettingData);
hypervFreeObject(priv, (hypervObject *)processorSettingData);
hypervFreeObject(priv, (hypervObject *)memorySettingData);
+ virBufferFreeAndReset(&query);
return xml;
}
@@ -971,6 +981,7 @@ hypervConnectListDefinedDomains(virConnectPtr conn, char **const names, int maxn
}
hypervFreeObject(priv, (hypervObject *)computerSystemList);
+ virBufferFreeAndReset(&query);
return count;
}
@@ -1007,6 +1018,7 @@ hypervConnectNumOfDefinedDomains(virConnectPtr conn)
cleanup:
hypervFreeObject(priv, (hypervObject *)computerSystemList);
+ virBufferFreeAndReset(&query);
return success ? count : -1;
}
@@ -1346,6 +1358,7 @@ hypervConnectListAllDomains(virConnectPtr conn,
}
hypervFreeObject(priv, (hypervObject *)computerSystemList);
+ virBufferFreeAndReset(&query);
return ret;
}
diff --git a/src/hyperv/hyperv_wmi.c b/src/hyperv/hyperv_wmi.c
index acb705c..d93abd9 100644
--- a/src/hyperv/hyperv_wmi.c
+++ b/src/hyperv/hyperv_wmi.c
@@ -526,6 +526,7 @@ hypervInvokeMsvmComputerSystemRequestStateChange(virDomainPtr domain,
VIR_FREE(returnValue);
VIR_FREE(instanceID);
hypervFreeObject(priv, (hypervObject *)concreteJob);
+ virBufferFreeAndReset(&query);
return result;
}
@@ -646,13 +647,14 @@ int
hypervMsvmComputerSystemFromDomain(virDomainPtr domain,
Msvm_ComputerSystem **computerSystem)
{
+ int result = -1;
hypervPrivate *priv = domain->conn->privateData;
char uuid_string[VIR_UUID_STRING_BUFLEN];
virBuffer query = VIR_BUFFER_INITIALIZER;
if (computerSystem == NULL || *computerSystem != NULL) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid argument"));
- return -1;
+ goto cleanup;
}
virUUIDFormat(domain->uuid, uuid_string);
@@ -663,16 +665,21 @@ hypervMsvmComputerSystemFromDomain(virDomainPtr domain,
virBufferAsprintf(&query, "and Name = \"%s\"", uuid_string);
if (hypervGetMsvmComputerSystemList(priv, &query, computerSystem) < 0) {
- return -1;
+ goto cleanup;
}
if (*computerSystem == NULL) {
virReportError(VIR_ERR_NO_DOMAIN,
_("No domain with UUID %s"), uuid_string);
- return -1;
+ goto cleanup;
}
- return 0;
+ result = 0;
+
+ cleanup:
+ virBufferFreeAndReset(&query);
+
+ return result;
}
--
1.9.1
10 years
[libvirt] [PATCHv3 0/2] Add non-FreeBSD guest support to Bhyve driver.
by Conrad Meyer
Drvbhyve hardcodes bhyveload(8) as the host bootloader for guests.
bhyveload(8) loader only supports FreeBSD guests.
This patch adds <bootloader> and <bootloader_args> handling to
bhyve_command, so libvirt can boot non-FreeBSD guests in Bhyve.
See patch logs for further details.
Thanks,
Conrad
Changelog:
v3:
- Based on latest git as of less than an hour ago; tested HDD booting a Linux
guest several times.
- Added first cut at CD booting. I'm not sure grub-bhyve supports this
(was not able to to test it).
- make 'syntax-check' clean
- Per Roman (off-list), split up virBhyveProcessBuildLoadCmd into a few
smaller functions.
- Also per Roman (off-list), use virCommandAddArgSet() for bootloader_args.
(Without the nasty cast, my compiler complains.)
v2:
- Dropped hvm -> xen change per Peter's feedback.
Conrad Meyer (2):
bhyve: Support /domain/bootloader configuration for non-FreeBSD
guests.
Generated PO files for 'bhyve: Support /domain/bootloader'
docs/drvbhyve.html.in | 28 ++++++-
docs/formatdomain.html.in | 4 +-
po/af.po | 5 ++
po/am.po | 5 ++
po/ar.po | 5 ++
po/as.po | 5 ++
po/be.po | 5 ++
po/bg.po | 5 ++
po/bn.po | 5 ++
po/bn_IN.po | 5 ++
po/bo.po | 5 ++
po/bs.po | 5 ++
po/ca.po | 5 ++
po/cs.po | 5 ++
po/cy.po | 5 ++
po/da.po | 5 ++
po/de.po | 5 ++
po/el.po | 5 ++
po/en_GB.po | 5 ++
po/es.po | 5 ++
po/et.po | 5 ++
po/eu_ES.po | 5 ++
po/fa.po | 5 ++
po/fi.po | 5 ++
po/fr.po | 5 ++
po/gl.po | 5 ++
po/gu.po | 5 ++
po/he.po | 5 ++
po/hi.po | 5 ++
po/hr.po | 5 ++
po/hu.po | 5 ++
po/hy.po | 5 ++
po/id.po | 5 ++
po/is.po | 5 ++
po/it.po | 5 ++
po/ja.po | 5 ++
po/ka.po | 5 ++
po/kn.po | 5 ++
po/ko.po | 5 ++
po/ku.po | 5 ++
po/libvirt.pot | 5 ++
po/lo.po | 5 ++
po/lt.po | 5 ++
po/lv.po | 5 ++
po/mk.po | 5 ++
po/ml.po | 5 ++
po/mr.po | 5 ++
po/ms.po | 5 ++
po/my.po | 5 ++
po/nb.po | 5 ++
po/nl.po | 5 ++
po/nn.po | 5 ++
po/nso.po | 5 ++
po/or.po | 5 ++
po/pa.po | 5 ++
po/pl.po | 5 ++
po/pt.po | 5 ++
po/pt_BR.po | 5 ++
po/ro.po | 5 ++
po/ru.po | 5 ++
po/si.po | 5 ++
po/sk.po | 5 ++
po/sl.po | 5 ++
po/sq.po | 5 ++
po/sr.po | 5 ++
po/sr(a)latin.po | 5 ++
po/sv.po | 5 ++
po/ta.po | 5 ++
po/te.po | 5 ++
po/th.po | 5 ++
po/tr.po | 5 ++
po/uk.po | 5 ++
po/ur.po | 5 ++
po/vi.po | 5 ++
po/vi_VN.po | 5 ++
po/zh_CN.po | 5 ++
po/zh_TW.po | 5 ++
po/zu.po | 5 ++
src/bhyve/bhyve_command.c | 204 ++++++++++++++++++++++++++++++++++++++++++----
src/bhyve/bhyve_driver.c | 5 ++
src/bhyve/bhyve_process.c | 5 ++
src/bhyve/bhyve_utils.h | 1 +
82 files changed, 604 insertions(+), 23 deletions(-)
--
1.9.3
10 years