[libvirt] [PATCH v7 0/6] libvirt supports Guest Panicked
by Chen Fan
Changes:
v6-v7: implement the rename-restart behavior.
v5-v6: Refactor the patches, and fix the incorrect indentation and name.
v4-v5: 1. fix the incorrect indentation and explanation (of some reasons).
v3-v4: 1. Supports the dumpcore options of the oncrash element in the XML.
2. Move the previous code to processWatchdogEvent().
v2-v3: 1. split into 3 patches
v1-v2: 1. fix the incorrect domain state: paused -> crashed, when crash
the guest while libvirt isn't running, then restart libvirtd.
Chen Fan (6):
libvirt: Define domain crash event types
qemu: Refactor the processwatchdogEvent code that can make the driver
workpool more generalized
qemu: Need to use qemuProcessShutdownOrReboot(), so we defined it at
qemu_process.h
qemu: Implement 'oncrash' events when guest panicked
qemu: Implement 'oncrash' coredump events when guest panicked
qemu: Implement oncrash 'rename-resart' event when guest panicked
examples/domain-events/events-c/event-test.c | 10 +
include/libvirt/libvirt.h.in | 16 ++
src/conf/domain_conf.c | 12 +-
src/qemu/qemu_domain.h | 11 +-
src/qemu/qemu_driver.c | 289 ++++++++++++++++++++++++---
src/qemu/qemu_monitor.c | 14 +-
src/qemu/qemu_monitor.h | 4 +
src/qemu/qemu_monitor_json.c | 7 +
src/qemu/qemu_process.c | 60 +++++-
src/qemu/qemu_process.h | 3 +
tools/virsh-domain-monitor.c | 8 +
11 files changed, 395 insertions(+), 39 deletions(-)
--
1.8.1.4
11 years, 4 months
[libvirt] [PATCH v5 0/5] Add qcow2 extensions support
by Ján Tomko
Since QEMU 1.1 qcow2 supports a features bitfield, allowing
to implement additional features without breaking compatibility
with older QEMU versions.
The version header on-disk is bumped to 3, however the format name
is still 'qcow2', not 'qcow3' (which is what I used in v2).
v5:
Use [0-9]+.[0-9]+ for compat value and enforce it in XML.
Fix broken rebase (error vs. cleanup labels).
Check if the specified feature is available with the current compat level.
v4: rebased
https://www.redhat.com/archives/libvir-list/2013-June/msg00427.html
v3: https://www.redhat.com/archives/libvir-list/2013-May/msg01179.html
v2: https://www.redhat.com/archives/libvir-list/2013-February/msg00212.html
qcow2 vs. qcow3 discussion:
https://www.redhat.com/archives/libvir-list/2013-March/msg00094.html
Ján Tomko (5):
util: add support for qcow2v3 image detection
conf: add features to volume target XML
storage: add support for creating qcow2 images with extensions
conf: add features to snapshot disk XML
qemu: add qcow2 extension support to inactive external snapshots
docs/formatsnapshot.html.in | 5 +
docs/formatstorage.html.in | 20 +++
docs/schemas/Makefile.am | 1 +
docs/schemas/domainsnapshot.rng | 7 +
docs/schemas/storagefilefeatures.rng | 24 ++++
docs/schemas/storagevol.rng | 7 +
libvirt.spec.in | 1 +
mingw-libvirt.spec.in | 2 +
src/conf/snapshot_conf.c | 84 +++++++++++
src/conf/snapshot_conf.h | 2 +
src/conf/storage_conf.c | 78 +++++++++++
src/conf/storage_conf.h | 7 +-
src/libvirt_private.syms | 2 +
src/qemu/qemu_driver.c | 88 ++++++++++--
src/storage/storage_backend.c | 62 ++++++++-
src/storage/storage_backend_fs.c | 10 ++
src/util/virstoragefile.c | 169 ++++++++++++++++++-----
src/util/virstoragefile.h | 12 ++
tests/domainsnapshotxml2xmlin/disk_snapshot.xml | 5 +
tests/domainsnapshotxml2xmlout/disk_snapshot.xml | 4 +
tests/storagevolxml2argvdata/qcow2-1.1.argv | 1 +
tests/storagevolxml2argvdata/qcow2-lazy.argv | 1 +
tests/storagevolxml2argvdata/vol-qcow2-1.1.xml | 32 +++++
tests/storagevolxml2argvdata/vol-qcow2-lazy.xml | 35 +++++
tests/storagevolxml2argvtest.c | 2 +
tests/storagevolxml2xmlin/vol-qcow2-1.1.xml | 32 +++++
tests/storagevolxml2xmlin/vol-qcow2-lazy.xml | 35 +++++
tests/storagevolxml2xmlout/vol-qcow2-1.1.xml | 33 +++++
tests/storagevolxml2xmlout/vol-qcow2-lazy.xml | 35 +++++
tests/storagevolxml2xmltest.c | 2 +
30 files changed, 737 insertions(+), 61 deletions(-)
create mode 100644 docs/schemas/storagefilefeatures.rng
create mode 100644 tests/storagevolxml2argvdata/qcow2-1.1.argv
create mode 100644 tests/storagevolxml2argvdata/qcow2-lazy.argv
create mode 100644 tests/storagevolxml2argvdata/vol-qcow2-1.1.xml
create mode 100644 tests/storagevolxml2argvdata/vol-qcow2-lazy.xml
create mode 100644 tests/storagevolxml2xmlin/vol-qcow2-1.1.xml
create mode 100644 tests/storagevolxml2xmlin/vol-qcow2-lazy.xml
create mode 100644 tests/storagevolxml2xmlout/vol-qcow2-1.1.xml
create mode 100644 tests/storagevolxml2xmlout/vol-qcow2-lazy.xml
--
1.8.1.5
11 years, 4 months
[libvirt] [PATCH] Get rid of useless VIR_STORAGE_FILE_FEATURE_NONE
by Ján Tomko
It's not used anywhere except for the switch in
virStorageBackendCreateQemuImgOpts, where leaving it in causes
a dead code coverity warning and omitting it breaks compilation
because of unhandled enum value.
Introduced by 6298f74.
---
Pushed as trivial.
src/storage/storage_backend.c | 2 +-
src/util/virstoragefile.h | 3 +--
2 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/src/storage/storage_backend.c b/src/storage/storage_backend.c
index 27a0a4f..ae25c89 100644
--- a/src/storage/storage_backend.c
+++ b/src/storage/storage_backend.c
@@ -666,7 +666,7 @@ virStorageBackendCreateQemuImgOpts(char **opts,
goto error;
}
break;
- case VIR_STORAGE_FILE_FEATURE_NONE:
+
case VIR_STORAGE_FILE_FEATURE_LAST:
;
}
diff --git a/src/util/virstoragefile.h b/src/util/virstoragefile.h
index a848fd0..4cb47e6 100644
--- a/src/util/virstoragefile.h
+++ b/src/util/virstoragefile.h
@@ -53,8 +53,7 @@ enum virStorageFileFormat {
VIR_ENUM_DECL(virStorageFileFormat);
enum virStorageFileFeature {
- VIR_STORAGE_FILE_FEATURE_NONE = -1,
- VIR_STORAGE_FILE_FEATURE_LAZY_REFCOUNTS,
+ VIR_STORAGE_FILE_FEATURE_LAZY_REFCOUNTS = 0,
VIR_STORAGE_FILE_FEATURE_LAST
};
--
1.8.1.5
11 years, 4 months
[libvirt] Investigate VM via Libvirt API
by Yaniv Hadad
Hi All,
I am Java developer that want to start working with Libvirt API.
My first target is to investigate Host + all his instances.
(CPU,Storage,Network,State,Name..etc.)
Can some one give me good code example or article for that purpose.
I prefer to use Java , but , python is also good for this target
Thanks
Yaniv Hadad
Servers & Network Group, IBM R&D Labs in Israel
Software Devloper
yanivh(a)il.ibm.com, +972-4-829-65947
Fax: +972-4-829-6111, Cell: +972-50-4078908
11 years, 4 months
[libvirt] [PATCH 0/2] Implement virConnectGetSysinfo in libxl and xen drivers
by Jim Fehlig
While discussing a recent libxl patch, we realized virConnectGetSysinfo was
never implemented in the libxl and legacy xen drivers. This small series
provides an implementation for these drivers.
Jim Fehlig (2):
libxl: Implement virConnectGetSysinfo
xen: Implement virConnectGetSysinfo
src/libxl/libxl_conf.h | 1 +
src/libxl/libxl_driver.c | 29 +++++++++++++++++++++++++++++
src/xen/xen_driver.c | 37 ++++++++++++++++++++++++++++++++++++-
3 files changed, 66 insertions(+), 1 deletions(-)
--
1.7.7
11 years, 4 months
[libvirt] [PATCH 1/2] BSD: implement virNetDevBridgeCreate() and virNetDevBridgeDelete()
by Roman Bogorodskiy
Implementation uses SIOCIFCREATE2 and SIOCIFDESTROY ioctls.
Also, drop static virNetDevSetupControl() as we have
public one avialable now.
---
src/util/virnetdevbridge.c | 91 ++++++++++++++++++++++++----------------------
1 file changed, 48 insertions(+), 43 deletions(-)
diff --git a/src/util/virnetdevbridge.c b/src/util/virnetdevbridge.c
index 130829c..df606d2 100644
--- a/src/util/virnetdevbridge.c
+++ b/src/util/virnetdevbridge.c
@@ -23,6 +23,7 @@
#include <config.h>
#include "virnetdevbridge.h"
+#include "virnetdev.h"
#include "virerror.h"
#include "virutil.h"
#include "virfile.h"
@@ -48,49 +49,6 @@
#if defined(HAVE_STRUCT_IFREQ) && defined(__linux__)
-static int virNetDevSetupControlFull(const char *ifname,
- struct ifreq *ifr,
- int domain,
- int type)
-{
- int fd;
-
- if (ifname && ifr) {
- memset(ifr, 0, sizeof(*ifr));
-
- if (virStrcpyStatic(ifr->ifr_name, ifname) == NULL) {
- virReportSystemError(ERANGE,
- _("Network interface name '%s' is too long"),
- ifname);
- return -1;
- }
- }
-
- if ((fd = socket(domain, type, 0)) < 0) {
- virReportSystemError(errno, "%s",
- _("Cannot open network interface control socket"));
- return -1;
- }
-
- if (virSetInherit(fd, false) < 0) {
- virReportSystemError(errno, "%s",
- _("Cannot set close-on-exec flag for socket"));
- VIR_FORCE_CLOSE(fd);
- return -1;
- }
-
- return fd;
-}
-
-
-static int virNetDevSetupControl(const char *ifname,
- struct ifreq *ifr)
-{
- return virNetDevSetupControlFull(ifname, ifr, AF_PACKET, SOCK_DGRAM);
-}
-#endif
-
-#if defined(HAVE_STRUCT_IFREQ) && defined(__linux__)
# define SYSFS_NET_DIR "/sys/class/net"
/*
* Bridge parameters can be set via sysfs on newish kernels,
@@ -233,6 +191,31 @@ cleanup:
VIR_FORCE_CLOSE(fd);
return ret;
}
+#elif defined(HAVE_STRUCT_IFREQ) && defined(SIOCIFCREATE2)
+int virNetDevBridgeCreate(const char *brname)
+{
+ int s;
+ struct ifreq ifr;
+ int ret = - 1;
+
+ if ((s = virNetDevSetupControl("bridge", &ifr)) < 0)
+ return -1;
+
+ if (ioctl(s, SIOCIFCREATE2, &ifr) < 0) {
+ virReportSystemError(errno, "%s",
+ _("Unable to create bridge device"));
+ goto cleanup;
+ }
+
+ if (virNetDevSetName(ifr.ifr_name, brname) == -1) {
+ goto cleanup;
+ }
+
+ ret = 0;
+cleanup:
+ VIR_FORCE_CLOSE(s);
+ return ret;
+}
#else
int virNetDevBridgeCreate(const char *brname)
{
@@ -271,6 +254,28 @@ cleanup:
VIR_FORCE_CLOSE(fd);
return ret;
}
+#elif defined(HAVE_STRUCT_IFREQ) && defined(SIOCIFDESTROY)
+int virNetDevBridgeDelete(const char *brname)
+{
+ int s;
+ struct ifreq ifr;
+ int ret = -1;
+
+ if ((s = virNetDevSetupControl(brname, &ifr)) < 0)
+ return -1;
+
+ if (ioctl(s, SIOCIFDESTROY, &ifr) < 0) {
+ virReportSystemError(errno,
+ _("Unable to remove bridge %s"),
+ brname);
+ goto cleanup;
+ }
+
+ ret = 0;
+cleanup:
+ VIR_FORCE_CLOSE(s);
+ return ret;
+}
#else
int virNetDevBridgeDelete(const char *brname ATTRIBUTE_UNUSED)
{
--
1.8.2.3
11 years, 4 months
[libvirt] [PATCH] libxl: Allow libxl to set NIC devid
by Jim Fehlig
libxl contains logic to determine an appropriate devid for new devices
that do not specify one in their configuration. For all device types
except NICs, the libxl driver allows libxl to determine devid. Do the
same for NICs.
---
src/libxl/libxl_conf.c | 2 --
1 files changed, 0 insertions(+), 2 deletions(-)
diff --git a/src/libxl/libxl_conf.c b/src/libxl/libxl_conf.c
index 812d380..1be66da 100644
--- a/src/libxl/libxl_conf.c
+++ b/src/libxl/libxl_conf.c
@@ -609,8 +609,6 @@ libxlMakeNicList(virDomainDefPtr def, libxl_domain_config *d_config)
}
for (i = 0; i < nnics; i++) {
- x_nics[i].devid = i;
-
if (libxlMakeNic(l_nics[i], &x_nics[i]))
goto error;
}
--
1.7.7
11 years, 4 months
[libvirt] [PATCH 0/6] Support to use iscsi storage in domain conf
by Osier Yang
This supports to use libvirt iscsi storage volume for qemu with
either the LUN's path on host (e.g. /dev/disk/by-path/*-lun-1),
or the the libiscsi uri (e.g iscsi://demo.org:6000/$iqn/1)in
domain conf.
Osier Yang (6):
storage_iscsi: Reflect the default target port
conf: Introduce new XML tag "mode" for disk source
qemu: Translate the iscsi pool/volume disk source
security: Ignore to manage the volume type disk if its mode is uri
conf: Ignore the volume type disk if its mode is "uri"
qemu: Translate the volume type disk source before cgroup setting
docs/formatdomain.html.in | 9 ++-
docs/schemas/domaincommon.rng | 8 +++
src/conf/domain_conf.c | 71 +++++++++++++++++++++-
src/conf/domain_conf.h | 25 ++++++++
src/libvirt_private.syms | 1 +
src/qemu/qemu_command.c | 20 ++++--
src/qemu/qemu_conf.c | 117 +++++++++++++++++++++++++++++-------
src/qemu/qemu_process.c | 13 ++--
src/security/security_apparmor.c | 10 ++-
src/security/security_dac.c | 10 ++-
src/security/security_selinux.c | 10 ++-
src/storage/storage_backend_iscsi.c | 6 +-
tests/qemuxml2xmltest.c | 1 +
13 files changed, 261 insertions(+), 40 deletions(-)
11 years, 4 months
Re: [libvirt] [libvirt-users] Not able to open Xen Connection using libvirt
by varun bhatnagar
No it was not booted with xen kernel. Actually I tried booting it with xen
kernel but I am getting a message saying Error No 15 : File not found.
I tried editing the grub entry and noticed that there are 3 entries:
1) kernel /boot/xen.gz vga= mode-0x345
2) module /boot/vmlinuz-3.0.13-0.27-xen.......
3) module /boot/initrd-3.0.13-0.27-xen
And in /boot i listed down the files, only xen.gz is there. Rest of the 2
files are not there (pasted the screenshot below).
Even at one site it was given to remove /boot from the path but that also
din't work.
How shall I solve this one?
//
Varun
On Wed, Jun 19, 2013 at 1:07 AM, Prasad <prasad(a)mukhedkar.com> wrote:
> On 06/18/2013 10:03 PM, varun bhatnagar wrote:
>
> Hi,
>
> I am trying to create virtual machine through libvirt using xen
> hypervisor. I was able to install xen successfully but when I tried
> connecting to the hypervisor it gave an error. And while installing libvirt
> (libvirt-1.0.1) I installed it with xen support.
> I am pasting the snapshot of the error below:
>
> [image: Inline image 1]
>
> Can anyone tell me why I am getting this error?
>
> //
> Varun
>
>
> _______________________________________________
> libvirt-users mailing listlibvirt-users@redhat.comhttps://www.redhat.com/mailman/listinfo/libvirt-users
>
> Is this system booted with xen kernel? xen virtualization required
> special kernel it doesn't work with standard kernel.
>
>
11 years, 4 months