Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 1518042 - Black txt window keeps after deleting description for a guest
Summary: Black txt window keeps after deleting description for a guest
Keywords:
Status: ASSIGNED
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: libvirt
Version: ---
Hardware: x86_64
OS: Unspecified
unspecified
low
Target Milestone: rc
: ---
Assignee: Pavel Hrdina
QA Contact: zhoujunqin
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-11-28 02:28 UTC by zhoujunqin
Modified: 2019-04-12 05:51 UTC (History)
8 users (show)

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


Attachments (Terms of Use)
screenshot-1 for step4 (deleted)
2017-11-28 02:28 UTC, zhoujunqin
no flags Details
screenshot-1 for step6 (deleted)
2017-11-28 02:32 UTC, zhoujunqin
no flags Details
screenshot-3 (deleted)
2017-11-28 02:33 UTC, zhoujunqin
no flags Details

Description zhoujunqin 2017-11-28 02:28:30 UTC
Created attachment 1359668 [details]
screenshot-1 for step4

Description of problem:
Black txt window keeps after deleting description for a guest

Version-Release number of selected component (if applicable):
virt-manager-1.4.3-2.el7.noarch

How reproducible:
100%

Steps to Reproduce:
1. Prepare a running guest.
2. Launch virt-manager, double click guest, click "Show virtual hardware details".
3. Click "Overview", edit "Description" in "Basic Details",input some txt(eg:test), then click "Apply".
4. Go back to virt-manager main page, move the cursor above guest name.
5. Turn to "Show virtual hardware details" page again, delete content in 'Description', then click 'Apply'.
6. Repeat step4 again.

Actual results:
After step4, the description 'test' is taken effective immediately, detail in Screenshot-1.
After step6, the description txt window keeps in black, detail in Screenshot-2.

Expected results:
After step6, hide description txt window.

Additional info:
After restart libvirtd service, then re-open virt-manager, check description for guest again, there is no txt window.
Detail in Screenshot-3.

Comment 2 zhoujunqin 2017-11-28 02:32:28 UTC
Created attachment 1359669 [details]
screenshot-1 for step6

Comment 3 zhoujunqin 2017-11-28 02:33:39 UTC
Created attachment 1359670 [details]
screenshot-3

Comment 5 Pavel Hrdina 2019-02-26 11:33:11 UTC
Hi, I'm not able to reproduce it on latest RHEL-7 with virt-manager-1.5.0-1.el7.noarch.  Please make sure that in description there is no empty space left and just to be sure check guest XML whether there is <description> element.

Comment 6 zhoujunqin 2019-02-27 03:02:40 UTC
Hi Pavel,
I can also reproduce this issue with virt-manager-1.5.0-1.el7.noarch

1. Prepare a running guest.

2. Launch virt-manager, double click guest, click "Show virtual hardware details".

3. Click "Overview", edit "Description" in "Basic Details",input some text(eg:test), then click "Apply".

Result: description has been added in guest's xml file

# virsh dumpxml rhel7.6
<domain type='kvm' id='9'>
  <name>rhel7.6</name>
  <uuid>bc5eeeef-e26b-483a-a662-992373f90c5c</uuid>
  <description>test</description>
  <memory unit='KiB'>1048576</memory>
...

4. Go back to virt-manager main page, move the cursor above guest name.

Result: the description 'test' is taken effective immediately.
5. Turn to "Show virtual hardware details" page again, delete content in 'Description', then click 'Apply'.

Result for step5: description keeps in guest's xml file and with no value.

# virsh dumpxml rhel7.6
<domain type='kvm' id='9'>
  <name>rhel7.6</name>
  <uuid>bc5eeeef-e26b-483a-a662-992373f90c5c</uuid>
  <description></description>
  <memory unit='KiB'>1048576</memory>
...

6. Repeat step4 again.

Result: The description text window keeps in black, but no value.
So Pavel, I expected that we can hide this black text for i have removed value for description.

I also checked virt-manager debug log, the difference is that when i remove description value from virt-manager UI, debug log shows:
[Wed, 27 Feb 2019 10:55:19 virt-manager 6543] DEBUG (libvirtobject:73) Redefining <vmmDomain name=rhel7.6 id=0x7f2360781500> with XML diff:
--- Original XML
+++ New XML
@@ -111,4 +111,5 @@
       <address type="pci" domain="0x0000" bus="0x00" slot="0x08" function="0x0"/>
     </memballoon>
   </devices>
+  <description>test</description>
 </domain>

[Wed, 27 Feb 2019 10:55:19 virt-manager 6543] DEBUG (connection:788) domain lifecycle event: domain=rhel7.6 event=0 reason=1
[Wed, 27 Feb 2019 10:55:31 virt-manager 6543] DEBUG (libvirtobject:73) Redefining <vmmDomain name=rhel7.6 id=0x7f2360781500> with XML diff:
--- Original XML
+++ New XML
@@ -1,7 +1,6 @@
 <domain type="kvm">
   <name>rhel7.6</name>
   <uuid>bc5eeeef-e26b-483a-a662-992373f90c5c</uuid>
-  <description>test</description>
   <memory unit="KiB">1048576</memory>
   <currentMemory unit="KiB">1048576</currentMemory>
   <vcpu placement="static">1</vcpu>
...

It shows removing the whole line of description in debug log, but in fact just remove the value for 'description', hope it can help you, thanks.

Comment 7 Pavel Hrdina 2019-02-27 11:34:12 UTC
Thanks for testing it, I'm still not able to reproduce it.  So the issue is that for some reason the empty <description> element remains in the domain XML, I thought that is not possible.

What version of libvirt are you using?

Comment 8 Pavel Hrdina 2019-02-27 12:32:27 UTC
So I managed to finally reproduce it, the important part is that the guest has to be running, in that case virt-manager uses virDomainSetMetadata API which will end up having empty <description> in the domain XML.

The issue here is that virt-manager sends empty string '' if you remove description over the virDomainSetMetadata API and that will result in XML containing <description></description>.  However, if you try to add that empty element into XML and use virDomainDefineXML API it will correctly remove the empty element.

The bug is in libvirt where we should remove the description even for empty string.

Comment 10 Pavel Hrdina 2019-03-08 14:04:26 UTC
Upstream commit:

commit e387afeb9a148c5b1bb33fce5b0243369b74ceee
Author: Pavel Hrdina <phrdina@redhat.com>
Date:   Wed Feb 27 15:52:45 2019 +0100

    conf: fix title and description for virDomainSetMetadata API


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