[libvirt] ANNOUNCE: virt-manager 0.8.7 and virtinst 0.500.6 released
by Cole Robinson
I'm happy to announce two new releases:
virt-manager 0.8.7: virt-manager is a desktop application for managing
KVM and Xen virtual machines via libvirt.
virtinst 0.500.6: virtinst is a collection of command line tools for
provisioning libvirt virtual machines, including virt-install and
virt-clone.
The releases can be downloaded from:
http://virt-manager.org/download.html
The direct download links are:
http://virt-manager.org/download/sources/virt-manager/virt-manager-0.8.7....
http://virt-manager.org/download/sources/virtinst/virtinst-0.500.6.tar.gz
Here are the highlights for the past 2 releases (since I neglected to
send out a release announcement for the previous round :) )
The virt-manager release includes:
virt-manager 0.8.7:
- Allow renaming an offline VM
- Spice password support (Marc-André Lureau)
- Allow editting NIC <virtualport> settings (Gerhard Stenzel)
- Allow enabling/disabling individual CPU features
- Allow easily changing graphics type between VNC and SPICE for existing
VM
- Allow easily changing network source device for existing VM
virt-manager 0.8.6:
- SPICE support (requires spice-gtk) (Marc-André Lureau)
- Option to configure CPU model
- Option to configure CPU topology
- Save and migration cancellation (Wen Congyang)
- Save and migration progress reporting
- Option to enable bios boot menu
- Option to configure direct kernel/initrd boot
virtinst 0.500.6:
- virt-install: --graphics spice now enables spicevmc and qxl
- virt-install: New --disk parameter io=native|threads
virtinst 0.500.5:
- New virt-install --cpu option for configuring CPU model/features
- virt-install --vcpus option can not specify topology and maxvcpus
- New virt-install --graphics option to unify --vnc, --sdl, spice config
- New virt-install --print-xml option to skip install and print XML
Thanks to everyone who has contributed to this release through testing,
bug reporting, submitting patches, and otherwise sending in feedback!
Thanks,
Cole
13 years, 8 months
[libvirt] [PATCHv6 1/3] libvirt/qemu - support persistent modification of devices.
by KAMEZAWA Hiroyuki
Thank you for comments. This is a rebased/fixed one.
=
>From 5858b9d6b33a9d917576f6179be13a306272ff45 Mon Sep 17 00:00:00 2001
From: KAMEZAWA Hiroyuki <kamezawa.hiroyu(a)jp.fujitsu.com>
Date: Wed, 23 Mar 2011 17:45:12 +0900
Subject: [PATCHv6 1/3] libvirt/qemu - support persistent modification of devices.
Now, qemudDomainAttachDeviceFlags() and qemudDomainDetachDeviceFlags()
doesn't support VIR_DOMAIN_DEVICE_MODIFY_CONFIG. By this, virsh's
at(de)tatch-device --persistent cannot modify qemu config.
(Xen allows it.)
This patch is a base patch for adding support of devices in
step by step manner. Following patches will add some device
support.
Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu(a)jp.fujitsu.com>
Changelog v5->v6
- fixed Indentation
- clean up.
Changelog v4->v5:
- fixed error codes at reporting Error.
- fixed unlock code after calling qemuDomainObjBeginJobWithDriver()
- fixed virDomainFindByUUID() to be virDomainFindByName()
- fixed spelling, indent, etc..
- removed unnecessary checks.
---
src/qemu/qemu_driver.c | 137 +++++++++++++++++++++++++++++++++++++++++++-----
1 files changed, 124 insertions(+), 13 deletions(-)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 6f296c9..468361b 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -4140,16 +4140,124 @@ cleanup:
return ret;
}
-static int qemudDomainAttachDeviceFlags(virDomainPtr dom,
- const char *xml,
- unsigned int flags) {
- if (flags & VIR_DOMAIN_DEVICE_MODIFY_CONFIG) {
- qemuReportError(VIR_ERR_OPERATION_INVALID,
- "%s", _("cannot modify the persistent configuration of a domain"));
+/*
+ * Attach a device given by XML, the change will be persistent
+ * and domain XML definition file is updated.
+ */
+static int qemuDomainAttachDevicePersistent(virDomainDefPtr vmdef,
+ virDomainDeviceDefPtr newdev)
+{
+
+ switch(newdev->type) {
+ default:
+ qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+ _("Sorry, the device is not supported for now"));
+ return -1;
+ }
+
+ return 0;
+}
+
+static int qemuDomainDetachDevicePersistent(virDomainDefPtr vmdef,
+ virDomainDeviceDefPtr device)
+{
+ switch(device->type) {
+ default:
+ qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+ _("Sorry, the device is not supported for now"));
return -1;
}
+ return 0;
+}
+
+static int qemuDomainModifyDevicePersistent(virDomainPtr dom,
+ const char *xml,
+ unsigned int attach, unsigned int flags)
+{
+ struct qemud_driver *driver;
+ virDomainDeviceDefPtr device;
+ virDomainDefPtr vmdef;
+ virDomainObjPtr vm;
+ int ret = -1;
+
+ /*
+ * When both of MODIFY_CONFIG and MODIFY_LIVE is specified at the same time,
+ * return error for now. We should support this later.
+ */
+ if (flags & VIR_DOMAIN_DEVICE_MODIFY_LIVE) {
+ qemuReportError(VIR_ERR_OPERATION_INVALID, "%s",
+ _("Now, cannot modify alive domain and its definition "
+ "at the same time."));
+ return -1;
+ }
+
+ driver = dom->conn->privateData;
+ qemuDriverLock(driver);
+ vm = virDomainFindByName(&driver->domains, dom->name);
+ if (!vm) {
+ qemuReportError(VIR_ERR_NO_DOMAIN, _("no domain with name : '%s'"),
+ dom->name);
+ goto unlock_out;
+ }
+
+ if (qemuDomainObjBeginJobWithDriver(driver, vm) < 0)
+ goto unlock_out;
+
+ if (virDomainObjIsActive(vm)) {
+ /*
+ * For now, just allow updating inactive domains. Further development
+ * will allow updating both active domain and its config file at
+ * the same time.
+ */
+ qemuReportError(VIR_ERR_OPERATION_INVALID, "%s",
+ _("unsupported to update active domain's definition."));
+ goto endjob;
+ }
+
+ vmdef = virDomainObjGetPersistentDef(driver->caps, vm);
- return qemudDomainAttachDevice(dom, xml);
+ if (!vmdef)
+ goto endjob;
+
+ device = virDomainDeviceDefParse(driver->caps,
+ vmdef, xml, VIR_DOMAIN_XML_INACTIVE);
+ if (!device)
+ goto endjob;
+
+ if (attach)
+ ret = qemuDomainAttachDevicePersistent(vmdef, device);
+ else
+ ret = qemuDomainDetachDevicePersistent(vmdef, device);
+
+ if (!ret) /* save the result */
+ ret = virDomainSaveConfig(driver->configDir, vmdef);
+
+ virDomainDeviceDefFree(device);
+
+endjob:
+ if (qemuDomainObjEndJob(vm) == 0)
+ vm = NULL;
+unlock_out:
+ if (vm)
+ virDomainObjUnlock(vm);
+ qemuDriverUnlock(driver);
+ return ret;
+}
+
+static int qemudDomainAttachDeviceFlags(virDomainPtr dom,
+ const char *xml,
+ unsigned int flags)
+{
+ if (flags & VIR_DOMAIN_DEVICE_MODIFY_CONFIG)
+ return qemuDomainModifyDevicePersistent(dom, xml, 1, flags);
+
+ if (flags & VIR_DOMAIN_DEVICE_MODIFY_LIVE)
+ return qemudDomainAttachDevice(dom, xml);
+
+ qemuReportError(VIR_ERR_INVALID_ARG,
+ _("bad flag: %x not supported"), flags);
+
+ return -1;
}
@@ -4364,13 +4472,16 @@ cleanup:
static int qemudDomainDetachDeviceFlags(virDomainPtr dom,
const char *xml,
unsigned int flags) {
- if (flags & VIR_DOMAIN_DEVICE_MODIFY_CONFIG) {
- qemuReportError(VIR_ERR_OPERATION_INVALID,
- "%s", _("cannot modify the persistent configuration of a domain"));
- return -1;
- }
- return qemudDomainDetachDevice(dom, xml);
+ if (flags & VIR_DOMAIN_DEVICE_MODIFY_CONFIG)
+ return qemuDomainModifyDevicePersistent(dom, xml, 0, flags);
+
+ if (flags & VIR_DOMAIN_DEVICE_MODIFY_LIVE)
+ return qemudDomainDetachDevice(dom, xml);
+
+ qemuReportError(VIR_ERR_INVALID_ARG,
+ _("bad flag: %x not supported now"), flags);
+ return -1;
}
static int qemudDomainGetAutostart(virDomainPtr dom,
--
1.7.4.1
13 years, 8 months
[libvirt] [PATCH] update domain status forcibly even if attach a device failed
by Wen Congyang
Steps to reproduce this bug:
1. virsh attach-disk domain --source diskimage --target sdb --sourcetype file --driver qemu --subdriver qcow2
error: Failed to attach disk
error: operation failed: adding scsi-disk,bus=scsi0.0,scsi-id=1,drive=drive-scsi0-0-1,id=scsi0-0-1 device failed: Property 'scsi-disk.drive' can't find value 'drive-scsi0-0-1'
2. service libvirtd restart
Stopping libvirtd daemon: [ OK ]
Starting libvirtd daemon: [ OK ]
3. virsh attach-disk domain --source diskimage --target sdb --sourcetype file --driver qemu --subdriver raw
error: Failed to attach disk
error: operation failed: adding lsi,id=scsi0,bus=pci.0,addr=0x6 device failed: Duplicate ID 'scsi0' for device
The reason is that we create a new scsi controller but we do not update
/var/run/libvirt/qemu/domain.xml.
Signed-off-by: Wen Congyang <wency(a)cn.fujitsu.com>
---
src/qemu/qemu_driver.c | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 82a2210..5dff64a 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -6638,7 +6638,11 @@ static int qemudDomainAttachDevice(virDomainPtr dom,
goto endjob;
}
- if (!ret && virDomainSaveStatus(driver->caps, driver->stateDir, vm) < 0)
+ /* update domain status forcibly because the domain status may be changed
+ * even if we attach the device failed. For example, a new controller may
+ * be created.
+ */
+ if (virDomainSaveStatus(driver->caps, driver->stateDir, vm) < 0)
ret = -1;
endjob:
--
1.7.1
13 years, 8 months
[libvirt] [PATCH] build: nuke all .x-sc* files
by Eric Blake
Not every day you see a patch that nukes 27 files!
* .gnulib: Update to latest, for maint.mk improvements
* bootstrap: Resync to gnulib.
* bootstrap.conf (ACLOCAL): Swap the secondary aclocal include
directory, now that bootstrap picks up gnulib/m4 instead of m4.
* Makefile.am (syntax_check_exceptions, EXTRA_DIST): No longer
worry about nuked files.
* cfg.mk (sc_x_sc_dist_check): Delete dead rule.
(VC_LIST_ALWAYS_EXCLUDE_REGEX): Add HACKING.
(exclude_file_name_regexp--sc_*): Inline and simplify contents...
* .x-sc_*: ...from here, then delete the files.
---
* .gnulib c2090a8...0baae9c (28):
> maint.mk: allow fine-grained syntax-check exclusion via Make variables
> ignore-value tests: Avoid warnings.
> passfd: Fix link error on Solaris.
> passfd: Fix link error on AIX 5.2.
> passfd: Work around bug with CMSG_FIRSTHDR on FreeBSD 6.4.
> passfd: Fix compilation error on OpenBSD.
> passfd test: Fix warnings.
> passfd test: Fix warnings.
> passfd module, part 4, tweaks.
> passfd module, part 4.
> Makefile: rely on GNU make; derive syntax-check rule names
> passfd module, part 3.
> passfd module, part 2, tweaks.
> passfd module, part 2.
> wcswidth, mbswidth: Avoid integer overflow.
> Oops, fix last commit.
> futimens, utimensat: Avoid endless recursion on Solaris 10.
> maint.mk: relax a regexp to accommodate other formatting styles
> maint.mk: suppress a syntax check false positive
> wchar: add explicit dependencies, for Tru64
> passfd module, part 1, tweaks.
> passfd module, part 1.
> regex-quote: New API.
> regex-quote: Fix creation of POSIX extended regular expressions.
> doc: Improve doc regarding autopoint vs. gnulib.
> Update AC_OPENMP macro for Lahey compiler on GNU/Linux.
> parse-duration: remove xalloc.h dependency
> bootstrap: honor m4_base when running aclocal
.gnulib | 2 +-
.x-sc_avoid_ctype_macros | 1 -
.x-sc_avoid_if_before_free | 1 -
.x-sc_avoid_write | 9 ----
.x-sc_bindtextdomain | 2 -
.x-sc_m4_quote_check | 1 -
.x-sc_po_check | 1 -
.x-sc_prohibit_HAVE_MBRTOWC | 1 -
.x-sc_prohibit_VIR_ERR_NO_MEMORY | 5 --
.x-sc_prohibit_always_true_header_tests | 4 --
.x-sc_prohibit_asprintf | 5 --
.x-sc_prohibit_close | 9 ----
.x-sc_prohibit_empty_lines_at_EOF | 5 --
.x-sc_prohibit_fork_wrappers | 8 ----
.x-sc_prohibit_gethostby | 2 -
.x-sc_prohibit_gethostname | 2 -
.x-sc_prohibit_gettext_noop | 2 -
.x-sc_prohibit_have_config_h | 1 -
.x-sc_prohibit_nonreentrant | 10 -----
.x-sc_prohibit_readlink | 2 -
.x-sc_prohibit_sprintf | 4 --
.x-sc_prohibit_strncpy | 2 -
.x-sc_prohibit_test_minus_ao | 1 -
.x-sc_prohibit_xmlGetProp | 1 -
.x-sc_require_config_h | 4 --
.x-sc_require_config_h_first | 1 -
.x-sc_trailing_blank | 7 ---
.x-sc_unmarked_diagnostics | 2 -
Makefile.am | 30 -------------
bootstrap | 6 +-
bootstrap.conf | 2 +-
cfg.mk | 68 ++++++++++++++++++++++++------
32 files changed, 59 insertions(+), 142 deletions(-)
delete mode 100644 .x-sc_avoid_ctype_macros
delete mode 100644 .x-sc_avoid_if_before_free
delete mode 100644 .x-sc_avoid_write
delete mode 100644 .x-sc_bindtextdomain
delete mode 100644 .x-sc_m4_quote_check
delete mode 100644 .x-sc_po_check
delete mode 100644 .x-sc_prohibit_HAVE_MBRTOWC
delete mode 100644 .x-sc_prohibit_VIR_ERR_NO_MEMORY
delete mode 100644 .x-sc_prohibit_always_true_header_tests
delete mode 100644 .x-sc_prohibit_asprintf
delete mode 100644 .x-sc_prohibit_close
delete mode 100644 .x-sc_prohibit_empty_lines_at_EOF
delete mode 100644 .x-sc_prohibit_fork_wrappers
delete mode 100644 .x-sc_prohibit_gethostby
delete mode 100644 .x-sc_prohibit_gethostname
delete mode 100644 .x-sc_prohibit_gettext_noop
delete mode 100644 .x-sc_prohibit_have_config_h
delete mode 100644 .x-sc_prohibit_nonreentrant
delete mode 100644 .x-sc_prohibit_readlink
delete mode 100644 .x-sc_prohibit_sprintf
delete mode 100644 .x-sc_prohibit_strncpy
delete mode 100644 .x-sc_prohibit_test_minus_ao
delete mode 100644 .x-sc_prohibit_xmlGetProp
delete mode 100644 .x-sc_require_config_h
delete mode 100644 .x-sc_require_config_h_first
delete mode 100644 .x-sc_trailing_blank
delete mode 100644 .x-sc_unmarked_diagnostics
diff --git a/.gnulib b/.gnulib
index c2090a8..0baae9c 160000
--- a/.gnulib
+++ b/.gnulib
@@ -1 +1 @@
-Subproject commit c2090a84dc3997acada3166772afac94f2d3a25c
+Subproject commit 0baae9cadd08c9704e3c704dd69fb75640293e9d
diff --git a/.x-sc_avoid_ctype_macros b/.x-sc_avoid_ctype_macros
deleted file mode 100644
index 06e95c1..0000000
--- a/.x-sc_avoid_ctype_macros
+++ /dev/null
@@ -1 +0,0 @@
-^gnulib/.*
diff --git a/.x-sc_avoid_if_before_free b/.x-sc_avoid_if_before_free
deleted file mode 100644
index 7e6ce62..0000000
--- a/.x-sc_avoid_if_before_free
+++ /dev/null
@@ -1 +0,0 @@
-^ChangeLog
diff --git a/.x-sc_avoid_write b/.x-sc_avoid_write
deleted file mode 100644
index f6fc1b2..0000000
--- a/.x-sc_avoid_write
+++ /dev/null
@@ -1,9 +0,0 @@
-^src/libvirt\.c$
-^src/fdstream\.c$
-^src/qemu/qemu_monitor\.c$
-^src/util/command\.c$
-^src/util/util\.c$
-^src/xen/xend_internal\.c$
-^daemon/libvirtd.c$
-^gnulib/
-^tools/console.c$
diff --git a/.x-sc_bindtextdomain b/.x-sc_bindtextdomain
deleted file mode 100644
index 08acb01..0000000
--- a/.x-sc_bindtextdomain
+++ /dev/null
@@ -1,2 +0,0 @@
-^tests/.*
-^examples/.*
diff --git a/.x-sc_m4_quote_check b/.x-sc_m4_quote_check
deleted file mode 100644
index 10dfa97..0000000
--- a/.x-sc_m4_quote_check
+++ /dev/null
@@ -1 +0,0 @@
-^gnulib/m4/intl\.m4$
diff --git a/.x-sc_po_check b/.x-sc_po_check
deleted file mode 100644
index d2fc2f2..0000000
--- a/.x-sc_po_check
+++ /dev/null
@@ -1 +0,0 @@
-^docs/
diff --git a/.x-sc_prohibit_HAVE_MBRTOWC b/.x-sc_prohibit_HAVE_MBRTOWC
deleted file mode 100644
index 36775da..0000000
--- a/.x-sc_prohibit_HAVE_MBRTOWC
+++ /dev/null
@@ -1 +0,0 @@
-gnulib/.*
diff --git a/.x-sc_prohibit_VIR_ERR_NO_MEMORY b/.x-sc_prohibit_VIR_ERR_NO_MEMORY
deleted file mode 100644
index 5c96e83..0000000
--- a/.x-sc_prohibit_VIR_ERR_NO_MEMORY
+++ /dev/null
@@ -1,5 +0,0 @@
-^ChangeLog$
-^ChangeLog-old$
-^include/libvirt/virterror\.h$
-^daemon/dispatch\.c$
-^src/util/virterror\.c$
diff --git a/.x-sc_prohibit_always_true_header_tests b/.x-sc_prohibit_always_true_header_tests
deleted file mode 100644
index ff753ce..0000000
--- a/.x-sc_prohibit_always_true_header_tests
+++ /dev/null
@@ -1,4 +0,0 @@
-ChangeLog*
-docs/news.html.in
-python/libvirt-override.c
-python/typewrappers.c
diff --git a/.x-sc_prohibit_asprintf b/.x-sc_prohibit_asprintf
deleted file mode 100644
index d03b947..0000000
--- a/.x-sc_prohibit_asprintf
+++ /dev/null
@@ -1,5 +0,0 @@
-ChangeLog
-^bootstrap.conf$
-^gnulib/
-^po/
-^src/util/util.c$
diff --git a/.x-sc_prohibit_close b/.x-sc_prohibit_close
deleted file mode 100644
index ab14617..0000000
--- a/.x-sc_prohibit_close
+++ /dev/null
@@ -1,9 +0,0 @@
-# Non-C files:
-^docs/.*
-^ChangeLog*
-^HACKING$
-*\.py$
-# Wrapper implementation:
-^src/util/files\.c$
-# Only uses close in documentation comments:
-^src/libvirt\.c$
diff --git a/.x-sc_prohibit_empty_lines_at_EOF b/.x-sc_prohibit_empty_lines_at_EOF
deleted file mode 100644
index 2e9aa63..0000000
--- a/.x-sc_prohibit_empty_lines_at_EOF
+++ /dev/null
@@ -1,5 +0,0 @@
-^docs/api_extension/.*
-^tests/qemuhelpdata/.*
-*.gif$
-*.ico$
-*.png$
diff --git a/.x-sc_prohibit_fork_wrappers b/.x-sc_prohibit_fork_wrappers
deleted file mode 100644
index 7f8fc6c..0000000
--- a/.x-sc_prohibit_fork_wrappers
+++ /dev/null
@@ -1,8 +0,0 @@
-^docs/.*
-^HACKING$
-^src/util/util\.c$
-^tests/testutils\.c$
-# Files that we may want to convert over to virCommand someday...
-^daemon/libvirtd\.c$
-^src/libvirt\.c$
-^src/lxc/lxc_controller\.c$
diff --git a/.x-sc_prohibit_gethostby b/.x-sc_prohibit_gethostby
deleted file mode 100644
index 7c052f4..0000000
--- a/.x-sc_prohibit_gethostby
+++ /dev/null
@@ -1,2 +0,0 @@
-^gnulib/lib/getaddrinfo\.c$
-^gnulib/m4/
diff --git a/.x-sc_prohibit_gethostname b/.x-sc_prohibit_gethostname
deleted file mode 100644
index e7acb03..0000000
--- a/.x-sc_prohibit_gethostname
+++ /dev/null
@@ -1,2 +0,0 @@
-^src/util/util\.c$
-^ChangeLog-old$
diff --git a/.x-sc_prohibit_gettext_noop b/.x-sc_prohibit_gettext_noop
deleted file mode 100644
index c40474e..0000000
--- a/.x-sc_prohibit_gettext_noop
+++ /dev/null
@@ -1,2 +0,0 @@
-ChangeLog*
-docs/news.html.in
diff --git a/.x-sc_prohibit_have_config_h b/.x-sc_prohibit_have_config_h
deleted file mode 100644
index f106267..0000000
--- a/.x-sc_prohibit_have_config_h
+++ /dev/null
@@ -1 +0,0 @@
-^gnulib/lib/strsep\.c$
diff --git a/.x-sc_prohibit_nonreentrant b/.x-sc_prohibit_nonreentrant
deleted file mode 100644
index 0ab2f5d..0000000
--- a/.x-sc_prohibit_nonreentrant
+++ /dev/null
@@ -1,10 +0,0 @@
-^gnulib/
-^po/
-^ChangeLog$
-^ChangeLog-old$
-^Makefile*
-^docs/
-^tests/
-^tools/virsh\.c$
-^tools/console\.c$
-^build-aux/
diff --git a/.x-sc_prohibit_readlink b/.x-sc_prohibit_readlink
deleted file mode 100644
index e7acb03..0000000
--- a/.x-sc_prohibit_readlink
+++ /dev/null
@@ -1,2 +0,0 @@
-^src/util/util\.c$
-^ChangeLog-old$
diff --git a/.x-sc_prohibit_sprintf b/.x-sc_prohibit_sprintf
deleted file mode 100644
index a67f51c..0000000
--- a/.x-sc_prohibit_sprintf
+++ /dev/null
@@ -1,4 +0,0 @@
-^docs/
-^po/
-^ChangeLog
-^HACKING
diff --git a/.x-sc_prohibit_strncpy b/.x-sc_prohibit_strncpy
deleted file mode 100644
index 173d233..0000000
--- a/.x-sc_prohibit_strncpy
+++ /dev/null
@@ -1,2 +0,0 @@
-^src/util/util\.c$
-^tools/virsh\.c$
diff --git a/.x-sc_prohibit_test_minus_ao b/.x-sc_prohibit_test_minus_ao
deleted file mode 100644
index 3939616..0000000
--- a/.x-sc_prohibit_test_minus_ao
+++ /dev/null
@@ -1 +0,0 @@
-docs/news.html.in
diff --git a/.x-sc_prohibit_xmlGetProp b/.x-sc_prohibit_xmlGetProp
deleted file mode 100644
index f6d7ee2..0000000
--- a/.x-sc_prohibit_xmlGetProp
+++ /dev/null
@@ -1 +0,0 @@
-^src/util/xml.c$
diff --git a/.x-sc_require_config_h b/.x-sc_require_config_h
deleted file mode 100644
index a530ae0..0000000
--- a/.x-sc_require_config_h
+++ /dev/null
@@ -1,4 +0,0 @@
-^examples/
-^gnulib/lib/dummy\.c$
-^gnulib/tests/dummy\.c$
-^ChangeLog$
diff --git a/.x-sc_require_config_h_first b/.x-sc_require_config_h_first
deleted file mode 100644
index 0390cd4..0000000
--- a/.x-sc_require_config_h_first
+++ /dev/null
@@ -1 +0,0 @@
-^examples/
diff --git a/.x-sc_trailing_blank b/.x-sc_trailing_blank
deleted file mode 100644
index de3369e..0000000
--- a/.x-sc_trailing_blank
+++ /dev/null
@@ -1,7 +0,0 @@
-\.fig$
-\.gif$
-\.ico$
-\.png$
-^ChangeLog$
-^NEWS$
-^docs/.*
diff --git a/.x-sc_unmarked_diagnostics b/.x-sc_unmarked_diagnostics
deleted file mode 100644
index 4135cc7..0000000
--- a/.x-sc_unmarked_diagnostics
+++ /dev/null
@@ -1,2 +0,0 @@
-docs/apibuild.py
-tests/virt-aa-helper-test
diff --git a/Makefile.am b/Makefile.am
index 882e676..0b4ae9d 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -14,35 +14,6 @@ XML_EXAMPLES = \
$(patsubst $(srcdir)/%,%,$(wildcard $(addprefix $(srcdir)/examples/xml/, \
test/*.xml storage/*.xml)))
-syntax_check_exceptions = \
- .x-sc_avoid_ctype_macros \
- .x-sc_avoid_if_before_free \
- .x-sc_avoid_write \
- .x-sc_bindtextdomain \
- .x-sc_m4_quote_check \
- .x-sc_po_check \
- .x-sc_prohibit_always_true_header_tests \
- .x-sc_prohibit_asprintf \
- .x-sc_prohibit_close \
- .x-sc_prohibit_empty_lines_at_EOF \
- .x-sc_prohibit_fork_wrappers \
- .x-sc_prohibit_gethostby \
- .x-sc_prohibit_gethostname \
- .x-sc_prohibit_gettext_noop \
- .x-sc_prohibit_have_config_h \
- .x-sc_prohibit_HAVE_MBRTOWC \
- .x-sc_prohibit_nonreentrant \
- .x-sc_prohibit_readlink \
- .x-sc_prohibit_sprintf \
- .x-sc_prohibit_strncpy \
- .x-sc_prohibit_test_minus_ao \
- .x-sc_prohibit_VIR_ERR_NO_MEMORY \
- .x-sc_prohibit_xmlGetProp \
- .x-sc_require_config_h \
- .x-sc_require_config_h_first \
- .x-sc_trailing_blank \
- .x-sc_unmarked_diagnostics
-
EXTRA_DIST = \
ChangeLog-old \
libvirt.spec libvirt.spec.in \
@@ -53,7 +24,6 @@ EXTRA_DIST = \
autogen.sh \
cfg.mk \
examples/domain-events/events-python \
- $(syntax_check_exceptions) \
$(XML_EXAMPLES)
pkgconfigdir = $(libdir)/pkgconfig
diff --git a/bootstrap b/bootstrap
index e9ec11e..f004ad3 100755
--- a/bootstrap
+++ b/bootstrap
@@ -1,6 +1,6 @@
#! /bin/sh
# Print a version string.
-scriptversion=2011-01-21.16; # UTC
+scriptversion=2011-03-03.12; # UTC
# Bootstrap this package from checked-out sources.
@@ -874,7 +874,7 @@ grep -E '^[ ]*AC_CONFIG_HEADERS?\>' configure.ac >/dev/null ||
for command in \
libtool \
- "${ACLOCAL-aclocal} --force -I m4 $ACLOCAL_FLAGS" \
+ "${ACLOCAL-aclocal} --force -I '$m4_base' $ACLOCAL_FLAGS" \
"${AUTOCONF-autoconf} --force" \
"${AUTOHEADER-autoheader} --force" \
"${AUTOMAKE-automake} --add-missing --copy --force-missing"
@@ -885,7 +885,7 @@ do
command="${LIBTOOLIZE-libtoolize} -c -f"
fi
echo "$0: $command ..."
- $command || exit
+ eval "$command" || exit
done
diff --git a/bootstrap.conf b/bootstrap.conf
index a9d4ba4..6070204 100644
--- a/bootstrap.conf
+++ b/bootstrap.conf
@@ -145,7 +145,7 @@ gnulib_tool_option_extras="\
# Convince bootstrap to use multiple m4 directories.
: ${ACLOCAL=aclocal}
-ACLOCAL="$ACLOCAL -I gnulib/m4"
+ACLOCAL="$ACLOCAL -I m4"
export ACLOCAL
# Build prerequisites
diff --git a/cfg.mk b/cfg.mk
index c12f199..f5c7ed0 100644
--- a/cfg.mk
+++ b/cfg.mk
@@ -66,7 +66,7 @@ local-checks-to-skip = \
sc_useless_cpp_parens
# Files that should never cause syntax check failures.
-VC_LIST_ALWAYS_EXCLUDE_REGEX = ^docs/news.html.in$$
+VC_LIST_ALWAYS_EXCLUDE_REGEX = ^(HACKING|docs/news\.html\.in)$$
# Functions like free() that are no-ops on NULL arguments.
useless_free_options = \
@@ -481,19 +481,6 @@ sc_prohibit_gettext_markup:
halt='do not mark these strings for translation' \
$(_sc_search_regexp)
-# Ensure that the syntax_check_exceptions file list in Makefile.am
-# stays in sync with corresponding files in the repository.
-sce = syntax_check_exceptions
-sc_x_sc_dist_check:
- @test "$$( ($(VC_LIST) | sed -n '/\.x-sc_/p' \
- | sed 's|^$(_dot_escaped_srcdir)/||'; \
- sed -n '/^$(sce) =[ ]*\\$$/,/[^\]$$/p' \
- $(srcdir)/Makefile.am \
- | sed 's/^ *//;/^$(sce) =/d' \
- | tr -s '\012\\' ' ' | fmt -1 \
- ) | sort | uniq -u)" \
- && { echo 'Makefile.am: $(sce) mismatch' >&2; exit 1; } || :;
-
# We don't use this feature of maint.mk.
prev_version_file = /dev/null
@@ -550,3 +537,56 @@ _makefile_at_at_check_exceptions = ' && !/(SCHEMA|SYSCONF)DIR/'
# regenerate HACKING as part of the syntax-check
syntax-check: $(top_srcdir)/HACKING
+
+# List all syntax-check exemptions:
+_src1=libvirt|fdstream|qemu/qemu_monitor|util/(command|util)|xen/xend_internal
+exclude_file_name_regexp--sc_avoid_write = \
+ ^(src/($(_src1))|daemon/libvirtd|tools/console)\.c$$
+
+exclude_file_name_regexp--sc_bindtextdomain = ^(tests|examples)/
+
+exclude_file_name_regexp--sc_po_check = ^docs/
+
+exclude_file_name_regexp--sc_prohibit_VIR_ERR_NO_MEMORY = \
+ ^(include/libvirt/virterror\.h|daemon/dispatch\.c|src/util/virterror\.c)$$
+
+exclude_file_name_regexp--sc_prohibit_always_true_header_tests = \
+ (^docs|^python/(libvirt-override|typewrappers)\.c$$)
+
+exclude_file_name_regexp--sc_prohibit_asprintf = \
+ ^(bootstrap.conf$$|po/|src/util/util\.c$$)
+
+exclude_file_name_regexp--sc_prohibit_close = \
+ (\.py$$|^docs/|(src/util/files\.c|src/libvirt\.c)$$)
+
+exclude_file_name_regexp--sc_prohibit_empty_lines_at_EOF = \
+ (^docs/api_extension/|^tests/qemuhelpdata/|\.(gif|ico|png)$$)
+
+_src2=src/(util/util|libvirt|lxc/lxc_controller)
+exclude_file_name_regexp--sc_prohibit_fork_wrappers = \
+ (^docs|^($(_src2)|tests/testutils|daemon/libvirtd)\.c$$)
+
+exclude_file_name_regexp--sc_prohibit_gethostname = ^src/util/util\.c$$
+
+exclude_file_name_regexp--sc_prohibit_gettext_noop = ^docs/
+
+exclude_file_name_regexp--sc_prohibit_nonreentrant = \
+ ^((po|docs|tests)/|tools/(virsh|console)\.c$$)
+
+exclude_file_name_regexp--sc_prohibit_readlink = ^src/util/util\.c$$
+
+exclude_file_name_regexp--sc_prohibit_sprintf = ^(docs/|HACKING$$)
+
+exclude_file_name_regexp--sc_prohibit_strncpy = \
+ ^(src/util/util|tools/virsh)\.c$$
+
+exclude_file_name_regexp--sc_prohibit_xmlGetProp = ^src/util/xml\.c$$
+
+exclude_file_name_regexp--sc_require_config_h = ^examples/
+
+exclude_file_name_regexp--sc_require_config_h_first = ^examples/
+
+exclude_file_name_regexp--sc_trailing_blank = (^docs/|\.(fig|gif|ico|png)$$)
+
+exclude_file_name_regexp--sc_unmarked_diagnostics = \
+ ^(docs/apibuild.py|tests/virt-aa-helper-test)$$
--
1.7.4
13 years, 8 months
[libvirt] [PATCH] qemu: add two hook script events "prepare" and "release"
by Thibault VINCENT
>From 827261dbe2ab8f1cfd8c84df14bb42fd04df2307 Mon Sep 17 00:00:00 2001
From: Thibault VINCENT <thibault.vincent(a)smartjog.com>
Date: Mon, 21 Mar 2011 10:18:06 +0100
Subject: [PATCH] qemu: add two hook script events "prepare" and "release"
* Fix for bug #618970
* The "prepare" hook is called very early in the VM statup process
before device labeling, so that it can allocate ressources not
managed by libvirt, such as DRBD, or for instance create missing
bridges and vlan interfaces.
* To shutdown these devices, the "release" hook is also required at
the very end of the VM destruction.
Signed-off-by: Thibault VINCENT <thibault.vincent(a)smartjog.com>
---
src/qemu/qemu_process.c | 26 ++++++++++++++++++++++++++
src/util/hooks.c | 4 +++-
src/util/hooks.h | 2 ++
3 files changed, 31 insertions(+), 1 deletions(-)
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index 793a43c..7831c3b 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -1927,6 +1927,22 @@ int qemuProcessStart(virConnectPtr conn,
vm->def->id = driver->nextvmid++;
+ /* Run a early hook to set-up missing devices */
+ if (virHookPresent(VIR_HOOK_DRIVER_QEMU)) {
+ char *xml = virDomainDefFormat(vm->def, 0);
+ int hookret;
+
+ hookret = virHookCall(VIR_HOOK_DRIVER_QEMU, vm->def->name,
+ VIR_HOOK_QEMU_OP_PREPARE, VIR_HOOK_SUBOP_BEGIN,
NULL, xml);
+ VIR_FREE(xml);
+
+ /*
+ * If the script raised an error abort the launch
+ */
+ if (hookret < 0)
+ goto cleanup;
+ }
+
/* Must be run before security labelling */
VIR_DEBUG0("Preparing host devices");
if (qemuPrepareHostDevices(driver, vm->def) < 0)
@@ -2419,6 +2435,16 @@ retry:
VIR_FREE(priv->vcpupids);
priv->nvcpupids = 0;
+ /* The "release" hook cleans up additional ressources */
+ if (virHookPresent(VIR_HOOK_DRIVER_QEMU)) {
+ char *xml = virDomainDefFormat(vm->def, 0);
+
+ /* we can't stop the operation even if the script raised an
error */
+ virHookCall(VIR_HOOK_DRIVER_QEMU, vm->def->name,
+ VIR_HOOK_QEMU_OP_RELEASE, VIR_HOOK_SUBOP_END, NULL,
xml);
+ VIR_FREE(xml);
+ }
+
if (vm->newDef) {
virDomainDefFree(vm->def);
vm->def = vm->newDef;
diff --git a/src/util/hooks.c b/src/util/hooks.c
index 5ba2036..c258318 100644
--- a/src/util/hooks.c
+++ b/src/util/hooks.c
@@ -70,8 +70,10 @@ VIR_ENUM_IMPL(virHookSubop, VIR_HOOK_SUBOP_LAST,
"end")
VIR_ENUM_IMPL(virHookQemuOp, VIR_HOOK_QEMU_OP_LAST,
+ "prepare",
"start",
- "stopped")
+ "stopped",
+ "release")
VIR_ENUM_IMPL(virHookLxcOp, VIR_HOOK_LXC_OP_LAST,
"start",
diff --git a/src/util/hooks.h b/src/util/hooks.h
index f311ed1..66b378a 100644
--- a/src/util/hooks.h
+++ b/src/util/hooks.h
@@ -52,8 +52,10 @@ enum virHookSubopType {
};
enum virHookQemuOpType {
+ VIR_HOOK_QEMU_OP_PREPARE, /* domain startup initiated */
VIR_HOOK_QEMU_OP_START, /* domain is about to start */
VIR_HOOK_QEMU_OP_STOPPED, /* domain has stopped */
+ VIR_HOOK_QEMU_OP_RELEASE, /* domain destruction is over */
VIR_HOOK_QEMU_OP_LAST,
};
--
1.7.2.3
13 years, 8 months
[libvirt] [libvirt-snmp][PATCH v3 0/3] Add SNMP trap/notification support
by Michal Privoznik
The third version with micro-version number change.
Finally, we have a proof-of-concept implementation of SNMP trap.
Two new files were first generated using mib2c then edited, so be
careful when re-generating them.
Destination of traps is defined in snmpd.conf (trap2sink), and to
receive them snmptrapd must be configured and up.
The idea behind is - create a thread in which we poll for domain
events. Once we receive event notification, we just fire up
trap sending.
Michal Privoznik (3):
Add notification-type object to libvirt MIB
Create functions to fill in and send notification packets.
Add SNMP trap/notification support.
INSTALL.1st | 9 +-
configure.ac | 9 ++-
libvirt-snmp.spec.in | 5 +-
src/LIBVIRT-MIB.txt | 9 ++
src/Makefile.am | 3 +
src/README.txt | 9 +-
src/libvirtNotifications.c | 121 +++++++++++++++++++
src/libvirtNotifications.h | 33 +++++
src/libvirtSnmp.c | 277 +++++++++++++++++++++++++++++++++++++++++++-
9 files changed, 464 insertions(+), 11 deletions(-)
create mode 100644 src/libvirtNotifications.c
create mode 100644 src/libvirtNotifications.h
--
1.7.4
13 years, 8 months
[libvirt] [PATCH] logging: fix off-by-one bug
by Eric Blake
Valgrind caught that our log wrap-around was going 1 past the end.
Regression introduced in commit b16f47a; previously the
buffer was static and size+1 bytes, but now it is dynamic and
exactly size bytes.
* src/util/logging.c (virLogStr): Don't write past end of log.
---
An alternative would be to malloc one larger; but since the log
is likely to be a page size multiple and large enough to be worth
malloc using mmap, going one larger is likely to waste the bulk
of a page. Also, I like always NUL-terminating the current end
of the log (without including that NUL in the log length).
src/util/logging.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/util/logging.c b/src/util/logging.c
index b972f8a..f4910ad 100644
--- a/src/util/logging.c
+++ b/src/util/logging.c
@@ -326,7 +326,7 @@ static void virLogStr(const char *str, int len) {
return;
if (len <= 0)
len = strlen(str);
- if (len > virLogSize)
+ if (len >= virLogSize)
return;
virLogLock();
@@ -336,13 +336,13 @@ static void virLogStr(const char *str, int len) {
if (virLogEnd + len >= virLogSize) {
tmp = virLogSize - virLogEnd;
memcpy(&virLogBuffer[virLogEnd], str, tmp);
- virLogBuffer[virLogSize] = 0;
memcpy(&virLogBuffer[0], &str[tmp], len - tmp);
virLogEnd = len - tmp;
} else {
memcpy(&virLogBuffer[virLogEnd], str, len);
virLogEnd += len;
}
+ virLogBuffer[virLogEnd] = 0;
/*
* Update the log length, and if full move the start index
*/
--
1.7.4
13 years, 8 months
[libvirt] [PATCH] rpm: require radvd when building network support
by Eric Blake
Otherwise, if the build machine doesn't have radvd, then the
configure test won't wire in anything for the radvd executable,
and attempts to use that rpm for ipv6 will fail even on machines
where radvd is present.
error: Failed to start network ipv6net
error: Cannot find radvd - Possibly the package isn't installed: No such file
or directory
Note that this is a build requirement; the runtime requirement
is still optional, and the above failure is still expected for
an rpm built with radvd but installed on a non-ipv6 machine.
* libvirt.spec.in (with_network): Add BuildRequires for radvd.
---
.gnulib | 2 +-
libvirt.spec.in | 2 ++
2 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/.gnulib b/.gnulib
index c2090a8..a01e7c4 160000
--- a/.gnulib
+++ b/.gnulib
@@ -1 +1 @@
-Subproject commit c2090a84dc3997acada3166772afac94f2d3a25c
+Subproject commit a01e7c4c58d3c6cad50974367ec60139cc919973
diff --git a/libvirt.spec.in b/libvirt.spec.in
index 4a62c80..1e6b5b5 100644
--- a/libvirt.spec.in
+++ b/libvirt.spec.in
@@ -78,6 +78,7 @@
%define with_audit 0%{!?_without_audit:0}
%define with_dtrace 0%{!?_without_dtrace:0}
%define with_cgconfig 0%{!?_without_cgconfig:0}
+%define with_ipv6 0%{!?_without_ipv6:0}
# Non-server/HV driver defaults which are always enabled
%define with_python 0%{!?_without_python:1}
@@ -339,6 +340,7 @@ BuildRequires: libselinux-devel
%endif
%if %{with_network}
BuildRequires: dnsmasq >= 2.41
+BuildRequires: radvd
%endif
BuildRequires: bridge-utils
%if %{with_sasl}
--
1.7.4
13 years, 8 months
[libvirt] [PATCH] domain_conf: drop unused ref-count in snapshot object
by Eric Blake
The ref count was assigned to 1 at creation, then never modified again
until it was decremented just before freeing the object.
* src/conf/domain_conf.h (_virDomainSnapshotObj): Delete unused
field.
(virDomainSnapshotObjUnref): Delete unused prototype.
* src/libvirt_private.syms: Likewise.
* src/conf/domain_conf.c (virDomainSnapshotObjNew)
(virDomainSnapshotObjListDataFree): Update users.
(virDomainSnapshotObjUnref): Delete.
---
I was about to add ATTRIBUTE_RETURN_CHECK to all Unref methods,
when I discovered that this method is (currently) worthless.
If we ever change things in the future to have multiple threads
referring to snapshot objects and need a reference counter, we
can use Wen's proposed new base-class object to do that in a
saner manner. In the meantime, let's just delete the bloat.
src/conf/domain_conf.c | 15 +--------------
src/conf/domain_conf.h | 3 ---
src/libvirt_private.syms | 1 -
3 files changed, 1 insertions(+), 18 deletions(-)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index c637300..1b02c25 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -8722,8 +8722,6 @@ static virDomainSnapshotObjPtr virDomainSnapshotObjNew(void)
return NULL;
}
- snapshot->refs = 1;
-
VIR_DEBUG("obj=%p", snapshot);
return snapshot;
@@ -8740,17 +8738,6 @@ static void virDomainSnapshotObjFree(virDomainSnapshotObjPtr snapshot)
VIR_FREE(snapshot);
}
-int virDomainSnapshotObjUnref(virDomainSnapshotObjPtr snapshot)
-{
- snapshot->refs--;
- VIR_DEBUG("obj=%p refs=%d", snapshot, snapshot->refs);
- if (snapshot->refs == 0) {
- virDomainSnapshotObjFree(snapshot);
- return 0;
- }
- return snapshot->refs;
-}
-
virDomainSnapshotObjPtr virDomainSnapshotAssignDef(virDomainSnapshotObjListPtr snapshots,
const virDomainSnapshotDefPtr def)
{
@@ -8782,7 +8769,7 @@ virDomainSnapshotObjListDataFree(void *payload,
{
virDomainSnapshotObjPtr obj = payload;
- virDomainSnapshotObjUnref(obj);
+ virDomainSnapshotObjFree(obj);
}
int virDomainSnapshotObjListInit(virDomainSnapshotObjListPtr snapshots)
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index cbd0f98..9f595d6 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -998,8 +998,6 @@ struct _virDomainSnapshotDef {
typedef struct _virDomainSnapshotObj virDomainSnapshotObj;
typedef virDomainSnapshotObj *virDomainSnapshotObjPtr;
struct _virDomainSnapshotObj {
- int refs;
-
virDomainSnapshotDefPtr def;
};
@@ -1028,7 +1026,6 @@ virDomainSnapshotObjPtr virDomainSnapshotFindByName(const virDomainSnapshotObjLi
const char *name);
void virDomainSnapshotObjListRemove(virDomainSnapshotObjListPtr snapshots,
virDomainSnapshotObjPtr snapshot);
-int virDomainSnapshotObjUnref(virDomainSnapshotObjPtr snapshot);
int virDomainSnapshotHasChildren(virDomainSnapshotObjPtr snap,
virDomainSnapshotObjListPtr snapshots);
diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
index 55be36e..b4b6c63 100644
--- a/src/libvirt_private.syms
+++ b/src/libvirt_private.syms
@@ -305,7 +305,6 @@ virDomainSnapshotHasChildren;
virDomainSnapshotObjListGetNames;
virDomainSnapshotObjListNum;
virDomainSnapshotObjListRemove;
-virDomainSnapshotObjUnref;
virDomainSoundDefFree;
virDomainSoundModelTypeFromString;
virDomainSoundModelTypeToString;
--
1.7.4
13 years, 8 months