Bug 1657651 - Requested operation is not valid: migration with shmem device is not supported
Summary: Requested operation is not valid: migration with shmem device is not supported
Keywords:
Status: NEW
Alias: None
Product: Virtualization Tools
Classification: Community
Component: libvirt
Version: unspecified
Hardware: x86_64
OS: Linux
unspecified
high
Target Milestone: ---
Assignee: Libvirt Maintainers
QA Contact: Jing Qi
URL:
Whiteboard:
: 1657436 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-12-10 08:45 UTC by wuaq
Modified: 2018-12-11 08:04 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed:


Attachments (Terms of Use)

Description wuaq 2018-12-10 08:45:33 UTC
1.Description of problem:
     It report migration with shmem device is not supported , when I use the command "virsh migrate --live" to migrate a VM to another host.  

2.Version-Release number of selected component (if applicable):
     libvirt 3.9.0
     qemu-kvm  2.8.1

3.Steps to Reproduce:
   1)add serveral lines below to guest configuration
    <shmem name='my_shmem1'>
      <model type='ivshmem-plain'/>
      <size unit='M'>4</size>
    </shmem>

   2)virsh start guest-1

   3)virsh migrate --live guest-1 qemu+ssh://target/system

Actual results:
     error: Requested operation is not valid: migration with shmem device is not supported

4.Code Review
   When using the command “virsh create guset-1.xml,it produce corresponding command below.
   “qemu-kvm -device ivshmem-plain, id=shmem0,memdev=shmmem-shmem0,bus=pci.0,addr=0xa”
    
I read qemu-doc.texi in qemu-2.8.1 source code, which have a explain of migrating ivshmem below 
   “With device property @option{master=on}, the guest will copy the shared
   memory on migration to the destination host.  With @option{master=off},
   the guest will not be able to migrate with the device attached.” 

But libvirt library can not recognize the property “master=on”. When I directly used command "qemu-kvm -device ivshmem-plain,id=shmem0,memdev=shmmem-shmem0,master=on,bus=pci.0,addr=0xa” to launch a guest, it can migrate in live.

    I review the code about qemu code with branch 2.8.1 and master from https://github.com/libvirt/libvirt, it have no configuration definition for “master=on”
    The below is the part of source code

domain_conf.h
struct _virDomainShmemDef {
    char *name;
    unsigned long long size;
    int model; /* enum virDomainShmemModel */
    struct {
        bool enabled;
        virDomainChrSourceDef chr;
    } server;
    struct {
        bool enabled;
        unsigned vectors;
        virTristateSwitch ioeventfd;
    } msi;
    virDomainDeviceInfo info;
};

Comment 2 Jiri Denemark 2018-12-10 09:07:42 UTC
*** Bug 1657436 has been marked as a duplicate of this bug. ***

Comment 3 Jiri Denemark 2018-12-10 09:15:40 UTC
Could you please share the exact version of libvirt and qemu-kvm RPM packages
you use? It's unclear whether you use RHEL packages, upstream versions or a
combination of them.

Comment 4 wuaq 2018-12-10 09:37:54 UTC
I found the cause for this problem
libvirt/src/qemu/qemu_migration.c

        if (vm->def->nshmems) {

	            virReportError(VIR_ERR_OPERATION_INVALID, "%s",

	                           _("migration with shmem device is not supported"));

	            return false;

	        }

Comment 5 wuaq 2018-12-10 09:42:15 UTC
(In reply to Jiri Denemark from comment #3)
> Could you please share the exact version of libvirt and qemu-kvm RPM packages
> you use? It's unclear whether you use RHEL packages, upstream versions or a
> combination of them.

I found the cause for this problem
libvirt/src/qemu/qemu_migration.c

        if (vm->def->nshmems) {

	            virReportError(VIR_ERR_OPERATION_INVALID, "%s",

	                           _("migration with shmem device is not supported"));

	            return false;

Comment 6 Jiri Denemark 2018-12-10 09:43:35 UTC
This is not the cause. If you remove the check, you won't see the error
anymore, but that doesn't mean the domain will be migrated and keep working on
the destination host.

Anyway, please reply to comment 3.

Comment 7 wuaq 2018-12-10 09:59:16 UTC
(In reply to Jiri Denemark from comment #6)
> This is not the cause. If you remove the check, you won't see the error
> anymore, but that doesn't mean the domain will be migrated and keep working
> on
> the destination host.
> 
> Anyway, please reply to comment 3.

I read qemu-doc.texi in qemu-2.8.1 source code, which have a explain of migrating ivshmem below 
   “With device property @option{master=on}, the guest will copy the shared
   memory on migration to the destination host.  With @option{master=off},
   the guest will not be able to migrate with the device attached.”

Comment 8 Jiri Denemark 2018-12-10 10:55:59 UTC
I don't think copying random parts of the bug description to comments helps
with anything.

Could you please reply to comment 3?

Comment 9 wuaq 2018-12-11 01:32:36 UTC
(In reply to Jiri Denemark from comment #3)
> Could you please share the exact version of libvirt and qemu-kvm RPM packages
> you use? It's unclear whether you use RHEL packages, upstream versions or a
> combination of them.

libvirt 3.9.0  qemu-kvm  2.8.1

these two package are compiled, not rpm

Comment 10 Jiri Denemark 2018-12-11 08:04:10 UTC
Thanks. I'm moving the bug to upstream tracker then.


Note You need to log in before you can comment on or make changes to this bug.