[libvirt] [PATCH] vmx: Adapt to emptyBackingString for cdrom-image

https://bugzilla.redhat.com/show_bug.cgi?id=1266088 We are missing this value for cdrom-image device. Honestly, I have no idea whether it can happen for other disk devices too. Signed-off-by: Michal Privoznik <mprivozn@redhat.com> --- src/vmx/vmx.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/vmx/vmx.c b/src/vmx/vmx.c index 568b2c7..baf27de 100644 --- a/src/vmx/vmx.c +++ b/src/vmx/vmx.c @@ -2317,6 +2317,16 @@ virVMXParseDisk(virVMXContext *ctx, virDomainXMLOptionPtr xmlopt, virConfPtr con */ goto ignore; } + } else if (STREQ(fileName, "emptyBackingString")) { + if (deviceType && STRCASENEQ(deviceType, "cdrom-image")) { + virReportError(VIR_ERR_INTERNAL_ERROR, + _("Expecting VMX entry '%s' to be 'cdrom-image' " + "but found '%s'"), deviceType_name, deviceType); + goto cleanup; + } + + virDomainDiskSetType(*def, VIR_STORAGE_TYPE_FILE); + ignore_value(virDomainDiskSetSource(*def, NULL)); } else { virReportError(VIR_ERR_INTERNAL_ERROR, _("Invalid or not yet handled value '%s' " -- 2.4.10

On Thu, Jan 07, 2016 at 09:59:09AM +0100, Michal Privoznik wrote:
https://bugzilla.redhat.com/show_bug.cgi?id=1266088
We are missing this value for cdrom-image device. Honestly, I have no idea whether it can happen for other disk devices too.
Signed-off-by: Michal Privoznik <mprivozn@redhat.com> --- src/vmx/vmx.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
print(random.choice(famous_last_quotes)) Shouldn't hurt ACK

2016-01-11 17:03 GMT+01:00 Martin Kletzander <mkletzan@redhat.com>:
On Thu, Jan 07, 2016 at 09:59:09AM +0100, Michal Privoznik wrote:
https://bugzilla.redhat.com/show_bug.cgi?id=1266088
We are missing this value for cdrom-image device. Honestly, I have no idea whether it can happen for other disk devices too.
Signed-off-by: Michal Privoznik <mprivozn@redhat.com> --- src/vmx/vmx.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
print(random.choice(famous_last_quotes)) Shouldn't hurt
ACK
This patch is missing a test case and a corresponding addition to the format function to allow for proper round-trip. I'll propose an improve version later today. -- Matthias Bolte http://photron.blogspot.com
participants (3)
-
Martin Kletzander
-
Matthias Bolte
-
Michal Privoznik