[libvirt] fdisk still shows the "/dev/sdb" partitions even after the removal of scsi disk
by chandrashekar shastri
Hi,
I have filed a bug "fdisk still shows the "/dev/sdb" partitions even
after the removal of scsi disk" for the upstream kernel.
Bug link:
https://bugs.launchpad.net/qemu/+bug/1190525
RHEL guest shows the partittions even after the removal of scsi disk:
fdisk still shows the "/dev/sdb" partitions even after the removal of
scsi disk.
Guest details:
-------------------
Kernel : 2.6.32-358
Host Details :
Upstream Kernel, Qemu, Libvirt and virt-manager
---------------------------------------------------------------------
kernel version : 3.9.0+
qemu version : QEMU emulator version 1.5.0
libvirt version : 1.0.5
virt-install : 0.600.3
Steps to reproduce the issue:
I. Add the SCSI disk through the virt-manager.
2. Create the partition using fdisk (eg: /dev/sbb)
3. Create a filesystem and format using mkfs.ext3 or mkfs.ext4
4. Remove the scsi disk through the virt-manager.
5. Again run the fdisk /dev/sdb, the guests still shows the partition
even after the removal of the disk.
This issue is not seen with virt-io disk.
This issue is also reproducible without even creating the partitions.
Expected Result:
The output of fdisk /dev/sd* should not show the enties after the
removal of scsi disks
Thanks,
Chandrashekar
11 years, 5 months
[libvirt] [PATCH] qemu: allow restore with non-migratable XML input
by Ján Tomko
Convert input XML to migratable before using it in
qemuDomainSaveImageOpen.
XML in the save image is migratable, i.e. doesn't contain implicit
controllers. If these controllers were in a non-default order in the
input XML, the ABI check would fail. Removing and re-adding these
controllers fixes it.
https://bugzilla.redhat.com/show_bug.cgi?id=834196
---
src/qemu/qemu_domain.c | 29 +++++++++++++++++++++++++++++
src/qemu/qemu_domain.h | 4 ++++
src/qemu/qemu_driver.c | 13 ++++++++++---
3 files changed, 43 insertions(+), 3 deletions(-)
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index fdcf7bc..8d79066 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -1275,6 +1275,35 @@ void qemuDomainObjExitRemote(virDomainObjPtr obj)
}
+virDomainDefPtr
+qemuDomainDefCopy(virQEMUDriverPtr driver,
+ virDomainDefPtr src,
+ unsigned int flags)
+{
+ virBuffer buf = VIR_BUFFER_INITIALIZER;
+ virDomainDefPtr ret = NULL;
+ virCapsPtr caps = NULL;
+ const char *xml = NULL;
+
+ if (qemuDomainDefFormatBuf(driver, src, flags, &buf) < 0)
+ goto cleanup;
+
+ xml = virBufferContentAndReset(&buf);
+
+ if (!(caps = virQEMUDriverGetCapabilities(driver, false)))
+ goto cleanup;
+
+ if (!(ret = virDomainDefParseString(xml, caps, driver->xmlopt,
+ QEMU_EXPECTED_VIRT_TYPES,
+ VIR_DOMAIN_XML_INACTIVE)))
+ goto cleanup;
+
+cleanup:
+ VIR_FREE(xml);
+ virObjectUnref(caps);
+ return ret;
+}
+
int
qemuDomainDefFormatBuf(virQEMUDriverPtr driver,
virDomainDefPtr def,
diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h
index f241296..068a4c3 100644
--- a/src/qemu/qemu_domain.h
+++ b/src/qemu/qemu_domain.h
@@ -241,6 +241,10 @@ void qemuDomainObjEnterRemote(virDomainObjPtr obj)
void qemuDomainObjExitRemote(virDomainObjPtr obj)
ATTRIBUTE_NONNULL(1);
+virDomainDefPtr qemuDomainDefCopy(virQEMUDriverPtr driver,
+ virDomainDefPtr src,
+ unsigned int flags);
+
int qemuDomainDefFormatBuf(virQEMUDriverPtr driver,
virDomainDefPtr vm,
unsigned int flags,
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index c886378..93c7d14 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -4877,17 +4877,24 @@ qemuDomainSaveImageOpen(virQEMUDriverPtr driver,
goto error;
if (xmlin) {
virDomainDefPtr def2 = NULL;
+ virDomainDefPtr newdef = NULL;
if (!(def2 = virDomainDefParseString(xmlin, caps, driver->xmlopt,
QEMU_EXPECTED_VIRT_TYPES,
VIR_DOMAIN_XML_INACTIVE)))
goto error;
- if (!virDomainDefCheckABIStability(def, def2)) {
- virDomainDefFree(def2);
+
+ newdef = qemuDomainDefCopy(driver, def2, VIR_DOMAIN_XML_MIGRATABLE);
+ virDomainDefFree(def2);
+ if (!newdef)
+ goto error;
+
+ if (!virDomainDefCheckABIStability(def, newdef)) {
+ virDomainDefFree(newdef);
goto error;
}
virDomainDefFree(def);
- def = def2;
+ def = newdef;
}
VIR_FREE(xml);
--
1.8.1.5
11 years, 5 months
[libvirt] AttributeError in virConnect.__del__ at program exit
by Sandro Bonazzola
Hi,
using vdsm python code, I've the following error at program exit that
seems to be related to libvirt python code, something wrong in a destructor:
Exception AttributeError: AttributeError("virConnect instance has no
attribute 'domainEventCallbacks'",) in <bound method virConnect.__del__
of <libvirt.virConnect instance at 0x4280f38>> ignored
I'm using libvirt 1.0.6
Is it a known issue? Is there any workaround / fix ?
--
Sandro Bonazzola
Better technology. Faster innovation. Powered by community collaboration.
See how it works at redhat.com
11 years, 5 months
[libvirt] [PATCH] udev: fix crash in libudev logging
by Ján Tomko
VIR_ERROR_INT calls virLogMessage(..., const char *fmt, ...).
Call virLogVMessage(..., const char *fmt, va_list list) instead,
since libudev called us with a va_list object, not a list of arguments.
https://bugzilla.redhat.com/show_bug.cgi?id=969152
---
Without the cast, I was getting:
node_device/node_device_udev.c: In function 'nodeStateInitialize':
node_device/node_device_udev.c:1684:5: error: argument 2 of 'udev_set_log_fn' might be a candidate for a format attribute [-Werror=missing-format-attribute]
node_device/node_device_udev.c: At top level:
cc1: error: unrecognized command line option "-Wno-unused-command-line-argument" [-Werror]
Is there a nicer way to get rid of it?
src/libvirt_private.syms | 1 +
src/node_device/node_device_udev.c | 30 +++++++++++++++++++++---------
2 files changed, 22 insertions(+), 9 deletions(-)
diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
index b93629f..d73a4d0 100644
--- a/src/libvirt_private.syms
+++ b/src/libvirt_private.syms
@@ -1486,6 +1486,7 @@ virLogSetBufferSize;
virLogSetDefaultPriority;
virLogSetFromEnv;
virLogUnlock;
+virLogVMessage;
# util/virmacaddr.h
diff --git a/src/node_device/node_device_udev.c b/src/node_device/node_device_udev.c
index 620cd58..ffcae16 100644
--- a/src/node_device/node_device_udev.c
+++ b/src/node_device/node_device_udev.c
@@ -348,15 +348,26 @@ static int udevGenerateDeviceName(struct udev_device *device,
}
-static void udevLogFunction(struct udev *udev ATTRIBUTE_UNUSED,
- int priority ATTRIBUTE_UNUSED,
- const char *file,
- int line,
- const char *fn,
- const char *fmt,
- va_list args)
+typedef void (*udevLogFunctionPtr) (struct udev *udev,
+ int priority,
+ const char *file,
+ int line,
+ const char *fn,
+ const char *format,
+ va_list args);
+
+static void
+ATTRIBUTE_FMT_PRINTF(6,0)
+udevLogFunction(struct udev *udev ATTRIBUTE_UNUSED,
+ int priority ATTRIBUTE_UNUSED,
+ const char *file,
+ int line,
+ const char *fn,
+ const char *fmt,
+ va_list args)
{
- VIR_ERROR_INT(VIR_LOG_FROM_LIBRARY, file, line, fn, fmt, args);
+ virLogVMessage(VIR_LOG_FROM_LIBRARY, VIR_LOG_ERROR,
+ file, line, fn, NULL, fmt, args);
}
@@ -1672,7 +1683,8 @@ static int nodeStateInitialize(bool privileged ATTRIBUTE_UNUSED,
* its return value.
*/
udev = udev_new();
- udev_set_log_fn(udev, udevLogFunction);
+ /* cast to get rid of missing-format-attribute warning */
+ udev_set_log_fn(udev, (udevLogFunctionPtr) udevLogFunction);
priv->udev_monitor = udev_monitor_new_from_netlink(udev, "udev");
if (priv->udev_monitor == NULL) {
--
1.8.1.5
11 years, 5 months
Re: [libvirt] [Qemu-devel] virsh live migration with non-shared storage fails with error as vm is not running
by Eric Blake
On 06/12/2013 04:21 PM, chandrashekar shastri wrote:
> Hi All,
>
> I have attached the dedug log of libvirt, please let me with your comments.
Spamming 3 separate lists with nearly a megabyte of logs is considered
poor netiquette. It causes lots of server time to multiply that out to
all the recipients, and not every one is able to cheaply download that
much material, especially if they are subscribed to multiple lists.
Your post was moderated and dropped before it hit libvirt, but looks
like it still got through to qemu-devel and virt-tools. Please be more
careful in the future.
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
11 years, 5 months
[libvirt] Upstream : virt-install and virt-manager fails to install the guest with the error "qemu: could not load PC BIOS 'bios.bin'"
by chandrashekar shastri
Hi All,
Upstream : virt-install and virt-manager fails to install the guest with the error "qemu: could not load PC BIOS 'bios.bin'"
Kernel, Qemu, Libvirt, Virt-Manager is built from the source (git).
kernel version : 3.9.0+
qemu version : QEMU emulator version 1.5.0
libvirt version : 1.0.5
virt-install : 0.600.3
Guest installation fails for Standard PC machine type.
virt-install --name vm_name --cdrom <iso path> --disk <disk path > --ram 2000 --machine pc
Starting install...
ERROR internal error process exited while connecting to monitor: char device redirected to /dev/pts/1
qemu: could not load PC BIOS 'bios.bin'
Domain installation does not appear to have been successful.
If it was, you can restart your domain by running:
virsh --connect qemu:///system start win7
otherwise, please restart your installation.
Where as the qemu installation succeeds with the same machine type (standard pc)
qemu-system-x86_64 -cdrom <iso_path> -hda <disk_path> -boot d -m 1000 -machine pc
Below is the list of supported machine type:
qemu-system-x86_64 -M ?
Supported machines are:
none empty machine
pc Standard PC (i440FX + PIIX, 1996) (alias of pc-i440fx-1.5)
pc-i440fx-1.5 Standard PC (i440FX + PIIX, 1996) (default)
pc-i440fx-1.4 Standard PC (i440FX + PIIX, 1996)
pc-1.3 Standard PC
pc-1.2 Standard PC
pc-1.1 Standard PC
pc-1.0 Standard PC
pc-0.15 Standard PC
pc-0.14 Standard PC
pc-0.13 Standard PC
pc-0.12 Standard PC
pc-0.11 Standard PC, qemu 0.11
pc-0.10 Standard PC, qemu 0.10
isapc ISA-only PC
q35 Standard PC (Q35 + ICH9, 2009) (alias of pc-q35-1.5)
pc-q35-1.5 Standard PC (Q35 + ICH9, 2009)
pc-q35-1.4 Standard PC (Q35 + ICH9, 2009)
Installation fails (virt-install) for all machine types expect pc-i440fx-1.5 and pc-i440fx-1.4.
Thanks,
Chandrashekar
11 years, 5 months
[libvirt] ANNOUNCE: libvirt 1.0.5.2 maintenance release
by Cole Robinson
libvirt 1.0.5.2 maintenance release is now available. This is
libvirt 1.0.5 with additional bugfixes that have accumulated
upstream since the initial release.
This release can be downloaded at:
http://libvirt.org/sources/stable_updates/libvirt-1.0.5.2.tar.gz
Changes in this version:
* virsh: migrate: Don't disallow --p2p and --migrateuri
* qemu: migration: error if tunnelled + storage specified
* qemu: migration: Improve p2p error if we can't open conn
* Add a virGetLastErrorMessage() function
* qemu: Don't report error on successful media eject
* qemuDomainChangeEjectableMedia: Unlock domain while waiting for event
* storage: Ensure 'qemu-img resize' size arg is a 512 multiple
* nwfilter: grab driver lock earlier during init (bz96649)
* Fix use of VIR_STRDUP vs strdup
* qemu: Fix crash in migration of graphics-less guests.
* qemu: prevent termination of guests w/hostdev on driver reconnect
* qemu: escape literal IPv6 address in NBD migration
* build: fix build with older gcc
* qemu: fix NBD migration to hosts with IPv6 enabled
* cgroup: be robust against cgroup movement races
For info about past maintenance releases, see:
http://wiki.libvirt.org/page/Maintenance_Releases
Thanks,
Cole
11 years, 5 months
[libvirt] ANNOUNCE: libvirt 0.9.11.10 maintenance release
by Cole Robinson
libvirt 0.9.11.10 maintenance release is now available. This is
libvirt 0.9.11 with additional bugfixes that have accumulated
upstream since the initial release.
This release can be downloaded at:
http://libvirt.org/sources/stable_updates/libvirt-0.9.11.10.tar.gz
Changes in this version:
* storage: Ensure 'qemu-img resize' size arg is a 512 multiple
* smartcard: spell ccid-card-emulated qemu property correctly
* Revert "build: work around broken kernel header"
* Revert "build: further fixes for broken if_bridge.h"
* build: further fixes for broken if_bridge.h
* build: work around broken kernel header
* build: avoid infinite autogen loop
* netlink: Fix build with libnl-3
* build: fix detection of netcf linked with libnl1
* build: force libnl1 if netcf also used libnl1
* build: support libnl-3
* Skip libxl driver on Xen 4.2
* Fix compilation of legacy xen driver with Xen 4.2
* qemu: Set migration FD blocking
* build: further fixes for broken if_bridge.h
* build: work around broken kernel header
For info about past maintenance releases, see:
http://wiki.libvirt.org/page/Maintenance_Releases
Thanks,
Cole
11 years, 5 months
[libvirt] ANNOUNCE: libvirt 0.10.2.6 maintenance release
by Cole Robinson
libvirt 0.10.2.6 maintenance release is now available. This is
libvirt 0.10.2 with additional bugfixes that have accumulated
upstream since the initial release.
This release can be downloaded at:
http://libvirt.org/sources/stable_updates/libvirt-0.10.2.6.tar.gz
Changes in this version:
* qemu: Don't report error on successful media eject
* qemuDomainChangeEjectableMedia: Unlock domain while waiting for event
* qemu_hotplug: Rework media changing process
* nwfilter: grab driver lock earlier during init (bz96649)
* storage: Ensure 'qemu-img resize' size arg is a 512 multiple
* Tweak EOF handling of streams
* smartcard: spell ccid-card-emulated qemu property correctly
* cgroup: be robust against cgroup movement races, part 2
* cgroup: be robust against cgroup movement races
* Avoid spamming logs with cgroups warnings
* Don't try to add non-existant devices to ACL
For info about past maintenance releases, see:
http://wiki.libvirt.org/page/Maintenance_Releases
Thanks,
Cole
11 years, 5 months
[libvirt] [PATCH v2 0/2]impl separite module for hostdev passthrough
by Chunyan Liu
This patch series include two patches:
1/2 is the implementation of the hostdev passthrough common library.
To meet two purposes:
a. move qemu hostdev APIs to common library so that it could be used by all
hypervisor drivers.
b. maintain a global hostdev in-use state.
2/2 is the implementation of pci passthrough to libxl driver.
Using common library APIs to implement pci passthrough for libxl driver.
(Changes to qemu/lxc driver are not included yet. That could be done after common
library is confirmed.)
Changes to v1:
1/2:
* add scsi part to common library
* instead of hardcode, check for <driver name='kvm/vfio/xen'/> setting, call
virPCIDeviceSetStubDriver to set stub driver. For libxl driver, a <driver
name='xen' /> is needed.
* rebase to current libvirt changes
2/2:
* Add device-attach/detach a pci hostdev implementataion to libxl driver
Chunyan Liu (2):
add hostdev passthrough common library
add pci passthrough impl to libxl
po/POTFILES.in | 1 +
src/Makefile.am | 1 +
src/conf/domain_conf.c | 3 +-
src/conf/domain_conf.h | 1 +
src/libvirt.c | 5 +
src/libvirt_private.syms | 22 +-
src/libxl/libxl_conf.c | 106 +++
src/libxl/libxl_conf.h | 3 +-
src/libxl/libxl_driver.c | 250 +++++++-
src/util/virhostdevmanager.c | 1486 ++++++++++++++++++++++++++++++++++++++++++
src/util/virhostdevmanager.h | 109 +++
src/util/virpci.c | 17 +-
src/util/virpci.h | 7 +-
src/util/virscsi.c | 18 +-
src/util/virscsi.h | 4 +-
src/util/virusb.c | 19 +-
src/util/virusb.h | 4 +-
17 files changed, 2026 insertions(+), 30 deletions(-)
create mode 100644 src/util/virhostdevmanager.c
create mode 100644 src/util/virhostdevmanager.h
11 years, 5 months